instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tri... | SELECT Position, COUNT(*) FROM player WHERE Points < 30 GROUP BY Position ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_204_741 (
id number,
"rank" number,
"name" text,
"nationality" text,
"1,62" text,
"1,67" text,
"1,72" text,
"1,75" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the next ranked competitor aft... | SELECT "name" FROM table_204_741 WHERE "rank" > (SELECT "rank" FROM table_204_741 WHERE "name" = 'dior delophont') ORDER BY "rank" LIMIT 1 | squall |
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
... | SELECT DEPT_CODE, MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE | nvbench |
CREATE TABLE table_name_9 (
year INTEGER,
reg_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year has a Reg Season of 3rd, western?
| SELECT AVG(year) FROM table_name_9 WHERE reg_season = "3rd, western" | sql_create_context |
CREATE TABLE table_name_45 (
term_start VARCHAR,
political_party VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Term Start date of the Progressive Party Prime Minister?
| SELECT term_start FROM table_name_45 WHERE political_party = "progressive party" | sql_create_context |
CREATE TABLE table_66572 (
"State and District of Columbia" text,
"Obese adults" text,
"Overweight (incl. obese) adults" text,
"Obese children and adolescents" text,
"Obesity rank" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the rank when ... | SELECT SUM("Obesity rank") FROM table_66572 WHERE "Obese children and adolescents" = '14.2%' | wikisql |
CREATE TABLE party (
Governor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the people that have been governor the most times.
| SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM ... | SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '柳... | css |
CREATE TABLE table_66794 (
"Municipality" text,
"Population" real,
"Area km\u00b2" real,
"Density Population per km\u00b2" real,
"Area" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which municipality's area is outer circle south... | SELECT "Municipality" FROM table_66794 WHERE "Area" = 'outer circle south' AND "Area km\u00b2" < '368' AND "County" = 'akershus' AND "Population" > '14,398' | wikisql |
CREATE TABLE table_name_84 (
nation VARCHAR,
performance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nation ran a time of 9.69 seconds?
| SELECT nation FROM table_name_84 WHERE performance = "9.69" | sql_create_context |
CREATE TABLE table_43691 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to par of player johnny miller, who has a t8 place?
| SELECT "To par" FROM table_43691 WHERE "Place" = 't8' AND "Player" = 'johnny miller' | wikisql |
CREATE TABLE table_36074 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Location for the buick-goodwrench open?
| SELECT "Location" FROM table_36074 WHERE "Tournament" = 'buick-goodwrench open' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzj... | css |
CREATE TABLE table_name_39 (
team VARCHAR,
laps VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had 64 laps and 13 points?
| SELECT team FROM table_name_39 WHERE laps = 64 AND points = 13 | sql_create_context |
CREATE TABLE table_name_17 (
finish VARCHAR,
laps INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the finish with Laps more than 200
| SELECT finish FROM table_name_17 WHERE laps > 200 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
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 diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... | mimic_iii |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '0149091' AND t_kc22.SOC_SRT_DIRE_NM = '硝苯地平片(糖衣)' | css |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 14 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE Apartments (
apt_id VARCHAR,
bedroom_count INTEGER
)
CREATE TABLE Apartment_Bookings (
booking_start_date VARCHAR,
apt_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the booking start and end dates of the apartments with mor... | SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 | sql_create_context |
CREATE TABLE table_name_66 (
high_points VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the player with the High points when there was a Record of 31 48?
| SELECT high_points FROM table_name_66 WHERE record = "31–48" | sql_create_context |
CREATE TABLE table_32434 (
"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.
-- On what date is Footscray the away team?
| SELECT "Date" FROM table_32434 WHERE "Away team" = 'footscray' | wikisql |
CREATE TABLE table_21330550_2 (
date VARCHAR,
big_ten_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many dates have a big ten team of #10 purdue?
| SELECT COUNT(date) FROM table_21330550_2 WHERE big_ten_team = "#10 Purdue" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114) AND prescriptions.route = 'po/ng' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-31 month') ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description v... | SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offering.friday = ... | advising |
CREATE TABLE table_name_53 (
fa_cup_apps VARCHAR,
league_goals VARCHAR,
squad_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the FA Cup App for Squad Number 3 having fewer than 4 league goals?
| SELECT fa_cup_apps FROM table_name_53 WHERE league_goals < 4 AND squad_no = 3 | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | SELECT COUNT(DISTINCT course.course_id) FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 15 AND course.department = 'ACC' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Sprin... | advising |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND procedures.short_title = "Drug detoxification" | mimicsql_data |
CREATE TABLE table_15689 (
"Date" text,
"Score" text,
"Location" text,
"Competition" text,
"Serial No." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The game taking place in Lille had what as a score?
| SELECT "Score" FROM table_15689 WHERE "Location" = 'lille' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputeven... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) >= '2100' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 5 | mimic_iii |
CREATE TABLE table_name_74 (
bronze VARCHAR,
total VARCHAR,
competitors VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Bronze in the year there was a Total of 0 medals and 6 Competitors?
| SELECT bronze FROM table_name_74 WHERE total = "0" AND competitors = "6" | sql_create_context |
CREATE TABLE table_name_1 (
rank INTEGER,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of the team with a time of 1:00.61?
| SELECT AVG(rank) FROM table_name_1 WHERE time = "1:00.61" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc24.PER_EXP FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '53864741998' | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-20116'... | eicu |
CREATE TABLE table_name_16 (
overall VARCHAR,
transition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played as overall when Josh Sims was transition?
| SELECT overall FROM table_name_16 WHERE transition = "josh sims" | sql_create_context |
CREATE TABLE table_4907 (
"Player" text,
"Nationality" text,
"Position" text,
"From" real,
"School/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality of the player listed that played in 1996?
| SELECT "Nationality" FROM table_4907 WHERE "From" = '1996' | wikisql |
CREATE TABLE table_name_34 (
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which party has Ken Cuccinelli as an incumbent?
| SELECT party FROM table_name_34 WHERE incumbent = "ken cuccinelli" | sql_create_context |
CREATE TABLE table_16799784_12 (
year_named VARCHAR,
latitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every year named for the latitude of 66.5N?
| SELECT year_named FROM table_16799784_12 WHERE latitude = "66.5N" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-77184') AND NOT patient.unitdischargetime IS NULL O... | eicu |
CREATE TABLE table_name_75 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for 10/04/1947?
| SELECT result FROM table_name_75 WHERE date = "10/04/1947" | sql_create_context |
CREATE TABLE table_7276 (
"Rank" real,
"Airport" text,
"Location" text,
"Code" text,
"Total passengers" real,
"% Change 2011-2012" real,
"Aircraft movements" real,
"Cargo traffic" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you te... | SELECT MAX("Cargo traffic") FROM table_7276 WHERE "Airport" = 'barcelona airport' AND "Aircraft movements" < '290,004' | wikisql |
CREATE TABLE table_71158 (
"Margin" real,
"Score" text,
"Opponent" text,
"Venue" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of year for penrith panthers opponent
| SELECT SUM("Year") FROM table_71158 WHERE "Opponent" = 'penrith panthers' | wikisql |
CREATE TABLE table_name_30 (
iata VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IATA OF Akureyri?
| SELECT iata FROM table_name_30 WHERE city = "akureyri" | sql_create_context |
CREATE TABLE table_56477 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is th... | SELECT "Fastest lap" FROM table_56477 WHERE "Winning driver" = 'giuseppe farina' | wikisql |
CREATE TABLE table_2156758_4 (
no_in_season VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number in season for the episode written by Chris Mitchell and Erik Wiese?
| SELECT no_in_season FROM table_2156758_4 WHERE written_by = "Chris Mitchell and Erik Wiese" | sql_create_context |
CREATE TABLE table_10857 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What race ... | SELECT "Race" FROM table_10857 WHERE "Date" = '15 june' | wikisql |
CREATE TABLE table_20750731_1 (
obama_number INTEGER,
mccain_percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Obama# when McCain% is 64.4%?
| SELECT MAX(obama_number) FROM table_20750731_1 WHERE mccain_percentage = "64.4%" | sql_create_context |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality | nvbench |
CREATE TABLE table_33390 (
"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.
-- What was the essendon score when they were at ho... | SELECT "Home team score" FROM table_33390 WHERE "Home team" = 'essendon' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 9299 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.dischtime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_44 (
rider VARCHAR,
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the rider with less than 15 laps, more than 32 grids, and an accident time/retired?
| SELECT rider FROM table_name_44 WHERE laps < 15 AND grid > 32 AND time_retired = "accident" | sql_create_context |
CREATE TABLE table_name_28 (
round INTEGER,
overall VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average round where Dave Stachelski was picked smaller than 187.
| SELECT AVG(round) FROM table_name_28 WHERE overall < 187 AND player = "dave stachelski" | sql_create_context |
CREATE TABLE table_train_163 (
"id" int,
"pulse_oximetry" int,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"allergy_to_adhesive" bool,
"creatinine_clearance_cl" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- weight > 1... | SELECT * FROM table_train_163 WHERE body_weight > 136.4 OR body_weight < 42 | criteria2sql |
CREATE TABLE table_52833 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the last time a nominee for Best Revival of a Musical was selected?
| SELECT MAX("Year") FROM table_52833 WHERE "Nominee" = 'best revival of a musical' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numbe... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 366) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-135 month') ORDER BY labevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
Di... | SELECT COUNT(*) FROM Users WHERE Reputation > '##ReputationThreshold:int?250000##' | sede |
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.ethnicity = "HISPANIC OR LATINO" AND procedures.long_title = "Incision of vessel, lower limb arteries" | mimicsql_data |
CREATE TABLE table_204_321 (
id number,
"community" text,
"currency" text,
"region" text,
"target date" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what number of proposed communities would use the east african shilling curren... | SELECT COUNT("community") FROM table_204_321 WHERE "currency" = 'east african shilling' | squall |
CREATE TABLE table_333 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the height in ft for the rockets from 1973-... | SELECT "Height in Ft." FROM table_333 WHERE "Years for Rockets" = '1973-78' | wikisql |
CREATE TABLE table_name_15 (
year VARCHAR,
label VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Year which has a Label of atco records and a Type of album? Question 2
| SELECT year FROM table_name_15 WHERE label = "atco records" AND type = "album" | sql_create_context |
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 Votes (
Id number,
PostId number,
VoteTypeId nu... | SELECT TagName, Count FROM Tags WHERE TagName IN ('Python') | sede |
CREATE TABLE table_204_220 (
id number,
"entered" text,
"weeks in\ntop 10" number,
"single" text,
"artist" text,
"peak" number,
"peak\nreached" text,
"weeks\nat peak" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which artist came on ... | SELECT "artist" FROM table_204_220 WHERE id = (SELECT id FROM table_204_220 WHERE "artist" = 'oasis') + 1 | squall |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT u.Id, u.DisplayName, COUNT(*) AS QNum FROM Users AS u INNER JOIN (SELECT OwnerUserId, TIME_TO_STR(CreationDate, 'WEEK') AS Week FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '%python%' AND NOT OwnerUserId IS NULL GROUP BY OwnerUserId, TIME_TO_STR(CreationDate, 'WEEK') HAVING COUNT(*) > 2) AS r ON u.Id = r.OwnerU... | sede |
CREATE TABLE table_28498999_3 (
before VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times is the player vaughn taylor listed?
| SELECT COUNT(before) FROM table_28498999_3 WHERE player = "Vaughn Taylor" | sql_create_context |
CREATE TABLE table_name_74 (
week VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week of the season was November 24, 1957?
| SELECT week FROM table_name_74 WHERE date = "november 24, 1957" | sql_create_context |
CREATE TABLE table_name_30 (
championship VARCHAR,
outcome VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the championship for runner-up outcome of 2010
| SELECT championship FROM table_name_30 WHERE outcome = "runner-up" AND year = 2010 | sql_create_context |
CREATE TABLE table_204_859 (
id number,
"year" number,
"seniors (trood award & rodda medal)" text,
"reserves (rex hartley medal)" text,
"under 18's (bruce wilkinson medal)" text,
"under 16's (shaw/carter medal)" text
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT COUNT("year") FROM table_204_859 | squall |
CREATE TABLE table_75958 (
"Tournament" text,
"2006" text,
"2009" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Tournament when the 2013 is 1r?
| SELECT "Tournament" FROM table_75958 WHERE "2013" = '1r' | wikisql |
CREATE TABLE table_1015914_24 (
them_two__the_two_ VARCHAR,
we_two VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is them two (the two) when we two is ngalbelpa?
| SELECT them_two__the_two_ FROM table_1015914_24 WHERE we_two = "ngalbelpa" | sql_create_context |
CREATE TABLE table_203_660 (
id number,
"county" text,
"obama%" text,
"obama#" number,
"mccain%" text,
"mccain#" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many counties had at least 35 % or more listed under the ob... | SELECT COUNT("county") FROM table_203_660 WHERE "obama%" >= 35 | squall |
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.ethnicity = "BLACK/HAITIAN" AND demographic.admityear < "2127" | mimicsql_data |
CREATE TABLE table_204_966 (
id number,
"region" text,
"date" text,
"label" text,
"format" text,
"catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what label was the only label to be used by france ?
| SELECT "label" FROM table_204_966 WHERE "region" = 'france' | squall |
CREATE TABLE table_72690 (
"Conflict" text,
"United Nations Mission" text,
"Sexual abuse 1" real,
"Murder 2" real,
"Extortion/Theft 3" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sexual abuse rate where the conflict is the Second Suda... | SELECT MIN("Sexual abuse 1") FROM table_72690 WHERE "Conflict" = 'Second Sudanese Civil War' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'systemic glucocorticoid - dexamethasone' AND STRFTIME('%y', treatment.treatmenttime) >= '2104') GROUP BY p... | eicu |
CREATE TABLE table_42181 (
"Name" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Team with a Lap that is 5?
| SELECT "Team" FROM table_42181 WHERE "Laps" = '5' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_6882 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Set 2, when Date is May 31?
| SELECT "Set 2" FROM table_6882 WHERE "Date" = 'may 31' | wikisql |
CREATE TABLE playlists (
id INTEGER,
name VARCHAR(120)
)
CREATE TABLE albums (
id INTEGER,
title VARCHAR(160),
artist_id INTEGER
)
CREATE TABLE artists (
id INTEGER,
name VARCHAR(120)
)
CREATE TABLE employees (
id INTEGER,
last_name VARCHAR(20),
first_name VARCHAR(20),
tit... | SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5 | nvbench |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '张高驰' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2018-12-03') | css |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes nu... | WITH CTE1 AS (SELECT Age, ROW_NUMBER() OVER (ORDER BY Age) AS RN FROM Users) SELECT RN FROM CTE1 WHERE Age = 18 ORDER BY RN LIMIT 1 | sede |
CREATE TABLE table_name_71 (
occupation VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed under occupation for someone from Santa Monica, California?
| SELECT occupation FROM table_name_71 WHERE hometown = "santa monica, california" | sql_create_context |
CREATE TABLE table_774 (
"District" text,
"Incumbent" text,
"Party" text,
"Elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the district for harry lane englebright?
| SELECT "District" FROM table_774 WHERE "Incumbent" = 'Harry Lane Englebright' | wikisql |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
... | 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, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAUKEE' AND date_day.day_number = 20 AND date_day.month_number = 1 A... | atis |
CREATE TABLE table_dev_61 (
"id" int,
"pregnancy_or_lactation" bool,
"allergy_to_gadolinium" bool,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"cardiogenic_shock" bool,
"hypertension" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT * FROM table_dev_61 WHERE renal_disease = 1 OR creatinine_clearance_cl < 30 | criteria2sql |
CREATE TABLE table_14158 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Developer(s) has a Year of 2010?
| SELECT "Developer(s)" FROM table_14158 WHERE "Year" = '2010' | wikisql |
CREATE TABLE table_27094070_4 (
team VARCHAR,
home_avg VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team has the home average of 18125?
| SELECT team FROM table_27094070_4 WHERE home_avg = 18125 | sql_create_context |
CREATE TABLE table_name_74 (
natural_change VARCHAR,
crude_death_rate__per_1000_ VARCHAR,
live_births VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is natural change with a crude death rate of 8.7 and less than 472 live births?
| SELECT natural_change FROM table_name_74 WHERE crude_death_rate__per_1000_ = 8.7 AND live_births < 472 | sql_create_context |
CREATE TABLE table_name_23 (
type VARCHAR,
distance VARCHAR,
course VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type is the sorrento to sapri course with a distance of km (mi)?
| SELECT type FROM table_name_23 WHERE distance = "km (mi)" AND course = "sorrento to sapri" | sql_create_context |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,... | 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'MONDAY' AND flight.flight_days = days.days_code AND fl... | atis |
CREATE TABLE table_24778847_2 (
new_democratic VARCHAR,
date_of_polling VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many figures are given for the New Democratic for the polling range May 11 31, 2010?
| SELECT COUNT(new_democratic) FROM table_24778847_2 WHERE date_of_polling = "May 11–31, 2010" | sql_create_context |
CREATE TABLE table_17973 (
"Round" real,
"Circuit" text,
"Date" text,
"Length" text,
"Pole Position" text,
"GT3 Winner" text,
"GTC Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the gtc winners for pole position no. 21 t... | SELECT "GTC Winner" FROM table_17973 WHERE "Pole Position" = 'No. 21 Team Modena' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Cr... | SELECT YEAR(CreationDate), COUNT(*) FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = 70 GROUP BY YEAR(CreationDate) | sede |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'serology/blood' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'... | mimic_iii |
CREATE TABLE table_name_85 (
stories VARCHAR,
completed VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many stories were done in 2008 with a 16 rank?
| SELECT COUNT(stories) FROM table_name_85 WHERE completed = 2008 AND rank = "16" | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_... | 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 WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DEN... | atis |
CREATE TABLE table_name_40 (
name VARCHAR,
heat VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Name of the swimmer with a Time of 9:04.86 in Heat 2?
| SELECT name FROM table_name_40 WHERE heat = 2 AND time = "9:04.86" | sql_create_context |
CREATE TABLE table_1606824_1 (
pop_density_people_km_2 VARCHAR,
population__percentage_of_eu VARCHAR,
member_state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the population density where population % is 1.1% for slovakia
| SELECT pop_density_people_km_2 FROM table_1606824_1 WHERE population__percentage_of_eu = "1.1%" AND member_state = "Slovakia" | sql_create_context |
CREATE TABLE table_name_3 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game when the record was 18 43?
| SELECT score FROM table_name_3 WHERE record = "18–43" | sql_create_context |
CREATE TABLE addresses (
address_id number,
address_content text,
city text,
zip_postcode text,
state_province_county text,
country text,
other_address_details text
)
CREATE TABLE customer_contact_channels (
customer_id number,
channel_code text,
active_from_date time,
activ... | SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) LIMIT 1 | spider |
CREATE TABLE table_1253396_5 (
goals_for VARCHAR,
overall_record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The Dallas Burn had a 12-9-7 record and what number of goals for?
| SELECT goals_for FROM table_1253396_5 WHERE overall_record = "12-9-7" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.