instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_73741 (
"Year" real,
"Division" real,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of years for usisl pro league
| SELECT COUNT("Year") FROM table_73741 WHERE "League" = 'USISL Pro League' | wikisql |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course... | advising |
CREATE TABLE table_60803 (
"Episode" text,
"1 season" text,
"2 season" text,
"3 season" text,
"4 season" text,
"5 season" text,
"6 season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 4 Season, when 2 Season is '3 168 673 (2 April ... | SELECT "4 season" FROM table_60803 WHERE "2 season" = '3 168 673 (2 april 2008)' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.admission_location = "EMERGENCY ROOM ADMIT" | mimicsql_data |
CREATE TABLE table_name_86 (
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which party was joseph t. johnson in?
| SELECT party FROM table_name_86 WHERE incumbent = "joseph t. johnson" | sql_create_context |
CREATE TABLE table_7964 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the Home Team is Newport County what is the Score?
| SELECT "Score" FROM table_7964 WHERE "Home team" = 'newport county' | wikisql |
CREATE TABLE table_78718 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Result, when Date is 'June 11, 1994', and when Venue is 'Miami, United States'?
| SELECT "Result" FROM table_78718 WHERE "Date" = 'june 11, 1994' AND "Venue" = 'miami, united states' | wikisql |
CREATE TABLE table_name_69 (
location VARCHAR,
court_surface VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which location was in China, and played on a hard court?
| SELECT location FROM table_name_69 WHERE court_surface = "hard" AND country = "china" | sql_create_context |
CREATE TABLE table_name_2 (
poles VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Poles do Team jva have?
| SELECT poles FROM table_name_2 WHERE team = "team jva" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Cardiac rhythm conv NEC" | mimicsql_data |
CREATE TABLE table_57937 (
"Year" text,
"Driver" text,
"Constructor" text,
"Category" text,
"Location" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the driver of the vehicle constructed by Bugatti in Anfa?
| SELECT "Driver" FROM table_57937 WHERE "Constructor" = 'bugatti' AND "Location" = 'anfa' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY diagnoses_icd.... | mimic_iii |
CREATE TABLE table_55969 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Bronze has a Silver smaller than 1, and a Total larger than 3?
| SELECT AVG("Bronze") FROM table_55969 WHERE "Silver" < '1' AND "Total" > '3' | wikisql |
CREATE TABLE table_43258 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week's date was September 27, 1953?
| SELECT "Week" FROM table_43258 WHERE "Date" = 'september 27, 1953' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comme... | SELECT u.Id AS "user_link", COUNT(1) AS questions_count, SUM(a.Score) AS total_score, SUM(a.Score) * 1.0 / COUNT(1) AS avg_score FROM Users AS u JOIN Posts AS a ON u.Id = a.OwnerUserId AND a.PostTypeId = 1 GROUP BY u.Id, u.DisplayName HAVING COUNT(1) >= 10 ORDER BY avg_score DESC, questions_count DESC | sede |
CREATE TABLE table_name_90 (
position VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Position, when Laps is 156?
| SELECT position FROM table_name_90 WHERE laps = 156 | sql_create_context |
CREATE TABLE table_name_32 (
date VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date is Jerilyn Britz the runner-up?
| SELECT date FROM table_name_32 WHERE runner_s__up = "jerilyn britz" | sql_create_context |
CREATE TABLE table_58363 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home team has an Away team of collingwood?... | SELECT "Home team" FROM table_58363 WHERE "Away team" = 'collingwood' | wikisql |
CREATE TABLE table_24937583_1 (
poles INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum amount of poles?
| SELECT MIN(poles) FROM table_24937583_1 | sql_create_context |
CREATE TABLE table_25471 (
"Player" text,
"Field Goals" text,
"Three Pointers" text,
"Free Throws" text,
"Assists" real,
"Steals" real,
"Rebounds" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has 18-50 .360 ... | SELECT "Player" FROM table_25471 WHERE "Field Goals" = '18-50 .360' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9519) AND NOT transfers.careunit IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY transfers.intime DESC LIMI... | mimic_iii |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnon... | SELECT OwnerDisplayName, COUNT(Id) FROM Posts WHERE OwnerUserId IS NULL GROUP BY OwnerDisplayName ORDER BY COUNT(Id) DESC | sede |
CREATE TABLE table_2668367_21 (
party VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the party for virginia 12
| SELECT party FROM table_2668367_21 WHERE district = "Virginia 12" | sql_create_context |
CREATE TABLE table_79430 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the least enrolled when the masc... | SELECT MIN("Enrollment") FROM table_79430 WHERE "Mascot" = 'trojans' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY ACC_Percent | nvbench |
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME... | SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC | nvbench |
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
... | SELECT Date, COUNT(Date) FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id GROUP BY Date ORDER BY Date | nvbench |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGDH = '20790393793' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb.BGDH = '20790393793' | css |
CREATE TABLE table_39546 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The United States, with a total medal count of less than 171, and a bronze medal count less ... | SELECT MAX("Gold") FROM table_39546 WHERE "Total" < '171' AND "Nation" = 'united states' AND "Bronze" < '9' | wikisql |
CREATE TABLE table_19116 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the follo... | SELECT "Points for" FROM table_19116 WHERE "Lost" = '4' | wikisql |
CREATE TABLE table_name_39 (
league_goals VARCHAR,
fa_cup_apps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which league goals has FA cup apps of 2?
| SELECT league_goals FROM table_name_39 WHERE fa_cup_apps = 2 | sql_create_context |
CREATE TABLE table_77660 (
"Rank by average" real,
"Place" real,
"Couple" text,
"Total" real,
"Number of dances" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest place number when the total is 16 and average is... | SELECT MIN("Place") FROM table_77660 WHERE "Total" = '16' AND "Average" < '16' | wikisql |
CREATE TABLE table_23121 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the college/junior club team for ian turnbull
| SELECT "College/junior/club team" FROM table_23121 WHERE "Player" = 'Ian Turnbull' | wikisql |
CREATE TABLE table_24790 (
"Year (Ceremony)" text,
"English Title" text,
"Vietnamese title" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every ceremony year for the result of nominee?
| SELECT "Year (Ceremony)" FROM table_24790 WHERE "Result" = 'Nominee' | wikisql |
CREATE TABLE table_name_30 (
location VARCHAR,
project VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the Eren Talu bidding project located?
| SELECT location FROM table_name_30 WHERE project = "eren talu bidding project" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND demographic.admityear < "2176" | mimicsql_data |
CREATE TABLE table_67028 (
"Title" text,
"Year" text,
"Developer" text,
"Publisher" text,
"Platform" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What publisher does Paleo Entertainment develop for?
| SELECT "Publisher" FROM table_67028 WHERE "Developer" = 'paleo entertainment' | wikisql |
CREATE TABLE table_70775 (
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Matches" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the tally with total less than 27 and average more than 3.41
| SELECT "Tally" FROM table_70775 WHERE "Total" < '27' AND "Average" > '3.41' | wikisql |
CREATE TABLE table_25107 (
"Player" text,
"Nat" text,
"Pos" text,
"L Apps" real,
"L G" real,
"C Apps" real,
"C G" real,
"Total Apps" real,
"Total G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of nat for total g of... | SELECT COUNT("Nat") FROM table_25107 WHERE "Total G" = '6' | wikisql |
CREATE TABLE manager (
Name VARCHAR,
Age VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the oldest manager?
| SELECT Name FROM manager ORDER BY Age DESC LIMIT 1 | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753') AND patient.unitdischargetime IS NULL) AND intakeoutput.c... | eicu |
CREATE TABLE table_20913 (
"Central Forest Reserve" text,
"Size in km\u00b2" real,
"Total plant species" real,
"Tree species" real,
"Endemic" real,
"Threatened (CR,VU,EN)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tree species are ... | SELECT "Tree species" FROM table_20913 WHERE "Total plant species" = '258' | wikisql |
CREATE TABLE table_1986692_1 (
league VARCHAR,
open_cup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When final is the open cup what is the league?
| SELECT league FROM table_1986692_1 WHERE open_cup = "Final" | sql_create_context |
CREATE TABLE table_name_38 (
record VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has a Score of 0 2?
| SELECT record FROM table_name_38 WHERE score = "0–2" | sql_create_context |
CREATE TABLE table_204_192 (
id number,
"year" number,
"team" text,
"co-drivers" text,
"car" text,
"class" text,
"laps" number,
"pos." text,
"class\npos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many different teams have t... | SELECT COUNT(DISTINCT "team") FROM table_204_192 WHERE "year" >= 1985 | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND demographic.days_stay > "4" | mimicsql_data |
CREATE TABLE table_name_92 (
attendance VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total attendance of the match with a 1:2 score?
| SELECT COUNT(attendance) FROM table_name_92 WHERE score = "1:2" | sql_create_context |
CREATE TABLE table_name_92 (
runners_up VARCHAR,
winning_years VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of runners-up for a club with winning years of 2010?
| SELECT COUNT(runners_up) FROM table_name_92 WHERE winning_years = "2010" | sql_create_context |
CREATE TABLE table_23575917_4 (
episode VARCHAR,
first_broadcast VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the episode number that was first broadcast on 3 September 2010?
| SELECT episode FROM table_23575917_4 WHERE first_broadcast = "3 September 2010" | sql_create_context |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cine... | SELECT Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID | nvbench |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT zyjybgb.KSBM, zyjybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '09797743' AND zyjybgb.BGRQ BETWEEN '2013-05-06... | css |
CREATE TABLE table_1590652_4 (
no VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number when date is 30 may 2010
| SELECT COUNT(no) FROM table_1590652_4 WHERE date = "30 May 2010" | sql_create_context |
CREATE TABLE grants (
grant_id number,
organisation_id number,
grant_amount number,
grant_start_date time,
grant_end_date time,
other_details text
)
CREATE TABLE staff_roles (
role_code text,
role_description text
)
CREATE TABLE projects (
project_id number,
organisation_id num... | SELECT role_description FROM staff_roles WHERE role_code = 'researcher' | spider |
CREATE TABLE table_27244 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes had the ti... | SELECT COUNT("Season #") FROM table_27244 WHERE "Title" = 'Rise and Fall' | wikisql |
CREATE TABLE table_name_4 (
overall VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times is the postion S?
| SELECT COUNT(overall) FROM table_name_4 WHERE position = "s" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "BRADYCARDIA" | mimicsql_data |
CREATE TABLE bookings (
booking_id number,
customer_id number,
booking_status_code text,
returned_damaged_yn text,
booking_start_date time,
booking_end_date time,
count_hired text,
amount_payable number,
amount_of_discount number,
amount_outstanding number,
amount_of_refund n... | SELECT daily_hire_cost FROM products_for_hire WHERE product_name LIKE '%Book%' | spider |
CREATE TABLE table_9348 (
"Event" text,
"Skip" text,
"Lead" text,
"Alternate" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Lead for the 2009 WCC when Wang Bingyu news was the skip?
| SELECT "Lead" FROM table_9348 WHERE "Skip" = 'wang bingyu' AND "Event" = '2009 wcc' | wikisql |
CREATE TABLE table_204_175 (
id number,
"pos" text,
"no." number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"laps led" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- scott d... | SELECT "laps led" FROM table_204_175 WHERE "driver" = 'scott dixon' | squall |
CREATE TABLE table_name_42 (
label VARCHAR,
catalog VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Under what label was the album with the catalog of 3645 and came out later than 1987?
| SELECT label FROM table_name_42 WHERE catalog = "3645" AND date > 1987 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.short_title = "Percutan liver aspirat" | mimicsql_data |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID ... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE Behavior_Incident (
incident_id INTEGER,
incident_type_code VARCHAR(10),
student_id INTEGER,
date_incident_start DATETIME,
date_incident_end DATETIME,
incident_summary VARCHAR(255),
recommendations VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Assessment_Notes (
... | SELECT student_id, monthly_rental FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '6544632' AND BGRQ BETWEEN '2000-01-12' AND '2021-05-11' GROUP BY JCZBMC, JCZBJGDW | css |
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rati... | SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog... | restaurants |
CREATE TABLE table_21977627_1 (
driver VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many drivers did Bob Gerard Racing have?
| SELECT COUNT(driver) FROM table_21977627_1 WHERE entrant = "Bob Gerard Racing" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3079633' AND t_kc21.MED_ORG_DEPT_NM = '药房') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-02-13' AND '2014-06-04' | css |
CREATE TABLE table_15412381_5 (
LMS VARCHAR,
lms_nos VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the LMS class of trains with numbers 14510-5?
| SELECT LMS AS class FROM table_15412381_5 WHERE lms_nos = "14510-5" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '29201885' AND t_kc22.STA_DATE BETWEEN '2014-05-23' AND '2016-12-27' AND t_kc22.SOC_SRT_DIRE_NM = '香砂养胃丸' | css |
CREATE TABLE table_6725 (
"Year" real,
"Male" text,
"Female" text,
"Band" text,
"Album" text,
"Pop Act" text,
"Lifetime Achievement Award" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the Lifetime Achievement Award when Snow Patrol... | SELECT "Lifetime Achievement Award" FROM table_6725 WHERE "Band" = 'snow patrol' AND "Female" = 'juliet turner' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varc... | SELECT HIRE_DATE, SUM(SALARY) FROM employees ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_zone (
time_zone_cod... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, state WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_0.state_code = 'DC' AND CITY_1.city_code = AIRPORT_SERVICE_1.c... | atis |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREAT... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code | nvbench |
CREATE TABLE table_73157 (
"School" text,
"City / Town" text,
"Website" text,
"Size" real,
"Principal" text,
"Grades" text,
"IDOE Profile" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the principal of Edgewood High School?/
| SELECT "Principal" FROM table_73157 WHERE "School" = 'Edgewood High School' | wikisql |
CREATE TABLE table_33807 (
"Year" real,
"Name" text,
"Nationality" text,
"Time" text,
"Age category" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year has a Time of 13:23:43?
| SELECT "Year" FROM table_33807 WHERE "Time" = '13:23:43' | wikisql |
CREATE TABLE table_name_30 (
section VARCHAR,
level VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What section were they in when there were tier 2 in 1996?
| SELECT section FROM table_name_30 WHERE level = "tier 2" AND season = 1996 | sql_create_context |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC | nvbench |
CREATE TABLE table_1341690_20 (
result VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all results where the voting district is Maryland 7.
| SELECT result FROM table_1341690_20 WHERE district = "Maryland 7" | sql_create_context |
CREATE TABLE table_73105 (
"C_{low}" text,
"C_{high}" text,
"I_{low}" real,
"I_{high}" real,
"Category" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the C_{high} when the C_{low} value is 250.5?
| SELECT "C_{high}" FROM table_73105 WHERE "C_{low}" = '250.5' | wikisql |
CREATE TABLE table_204_449 (
id number,
"no" number,
"episode" text,
"title" text,
"original airdate" text,
"viewers" number,
"nightly\nrank" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many viewers watched the episode together we a... | SELECT "viewers" FROM table_204_449 WHERE "title" = '"together we are one"' | squall |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'normal saline administration - moderate volu... | eicu |
CREATE TABLE table_name_17 (
drobo__2nd_ VARCHAR,
drobo_5d VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Drobo (2nd) has a Drobo 5d of 2012-11-02?
| SELECT drobo__2nd_ FROM table_name_17 WHERE drobo_5d = "2012-11-02" | sql_create_context |
CREATE TABLE table_name_37 (
school VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school is located in Michigan City?
| SELECT school FROM table_name_37 WHERE location = "michigan city" | sql_create_context |
CREATE TABLE table_72386 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the the candidates with incumbent being don fuqua
| SELECT "Candidates" FROM table_72386 WHERE "Incumbent" = 'Don Fuqua' | wikisql |
CREATE TABLE table_name_39 (
season VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What season has a Games listed of 10?
| SELECT season FROM table_name_39 WHERE games = "10" | sql_create_context |
CREATE TABLE table_name_20 (
Box VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the box score during a game that had a score of 86-96?
| SELECT Box AS score FROM table_name_20 WHERE score = "86-96" | sql_create_context |
CREATE TABLE table_48888 (
"Team" text,
"Head coach" text,
"Team captain" text,
"Venue" text,
"Capacity" real,
"Kitmaker" text,
"Shirt sponsor" text,
"Club Chairman" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Team, when Venue... | SELECT "Team" FROM table_48888 WHERE "Venue" = 'şükrü saracoğlu stadium' | wikisql |
CREATE TABLE table_32051 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the opponents for score in ... | SELECT "Opponents in the final" FROM table_32051 WHERE "Score in the final" = '1–6, 2–6' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-16627')) AND intakeoutput.cellpath LIKE '%output%' AND S... | eicu |
CREATE TABLE table_13292 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Mascot has an IHSAA Class of aaa,... | SELECT "Mascot" FROM table_13292 WHERE "IHSAA Class" = 'aaa' AND "Location" = 'russiaville' | wikisql |
CREATE TABLE table_name_2 (
points VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest 1994-1995, when Points is 145, and when Played is less than 114?
| SELECT MIN(1994 AS _1995) FROM table_name_2 WHERE points = 145 AND played < 114 | sql_create_context |
CREATE TABLE gradeconversion (
lettergrade text,
gradepoint number
)
CREATE TABLE enrolled_in (
stuid number,
cid text,
grade text
)
CREATE TABLE member_of (
facid number,
dno number,
appt_type text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age num... | SELECT COUNT(DISTINCT stuid) FROM enrolled_in WHERE grade = "B" | spider |
CREATE TABLE table_train_152 (
"id" int,
"systolic_blood_pressure_sbp" int,
"creatinine_clearance_cl" float,
"diastolic_blood_pressure_dbp" int,
"total_cholesterol" int,
"urine_protein" int,
"proteinuria" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for th... | SELECT * FROM table_train_152 WHERE systolic_blood_pressure_sbp > 145 | criteria2sql |
CREATE TABLE table_39784 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the corinthians have a position of less than 5, what is the average against?
| SELECT AVG("Against") FROM table_39784 WHERE "Position" < '5' AND "Team" = 'corinthians' | wikisql |
CREATE TABLE table_59538 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which method was used when Alessio Sakara was the opponent?
| SELECT "Method" FROM table_59538 WHERE "Opponent" = 'alessio sakara' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND demographic.dod_year <= "2179.0" | mimicsql_data |
CREATE TABLE table_74041 (
"Model" text,
"Launch" text,
"Model Number" text,
"Code name" text,
"Fab ( nm )" real,
"Bus interface" text,
"Memory ( MiB )" text,
"Core ( MHz )" text,
"Memory ( MHz )" text,
"Config core 1" text,
"Pixel ( GP /s)" text,
"Texture ( GT /s)" text,... | SELECT COUNT("Texture ( GT /s)") FROM table_74041 WHERE "TDP (Watts) GPU only" = '18' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayNa... | SELECT Users.DisplayName, Users.Reputation, Users.WebsiteUrl FROM Users WHERE Reputation >= 5000 ORDER BY Reputation DESC | sede |
CREATE TABLE table_11853 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time/retired for the car with over 9 laps and a grid of 6?
| SELECT "Time/Retired" FROM table_11853 WHERE "Laps" > '9' AND "Grid" = '6' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.