instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_host... | SELECT Location, COUNT(Location) FROM party GROUP BY Location | nvbench |
CREATE TABLE table_11295 (
"Parties and voter communities" text,
"% 2006" real,
"Seats 2006" real,
"% 2001" real,
"Seats 2001" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- There are communities listed that a percentage larger than 7.6 in 2001, but... | SELECT SUM("Seats 2001") FROM table_11295 WHERE "Seats 2006" = '2' AND "% 2001" > '7.6' | wikisql |
CREATE TABLE user_profiles (
uid number,
name text,
email text,
partitionid number,
followers number
)
CREATE TABLE tweets (
id number,
uid number,
text text,
createdate time
)
CREATE TABLE follows (
f1 number,
f2 number
)
-- Using valid SQLite, answer the following quest... | SELECT COUNT(*) FROM follows | spider |
CREATE TABLE table_name_1 (
title VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the title of the episode with the production code of ad1a22?
| SELECT title FROM table_name_1 WHERE production_code = "ad1a22" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 594)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d5.0' AND ... | mimic_iii |
CREATE TABLE table_name_85 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the Competition with a Score of 1 2?
| SELECT date FROM table_name_85 WHERE score = "1–2" | sql_create_context |
CREATE TABLE table_train_181 (
"id" int,
"systolic_blood_pressure_sbp" int,
"fasting_plasma_glucose_fpg" float,
"hemoglobin_a1c_hba1c" float,
"hepatitis_c" bool,
"hepatitis_b" bool,
"exposure_to_hiv" bool,
"diastolic_blood_pressure_dbp" int,
"hypertension" bool,
"NOUSE" float
)
... | SELECT * FROM table_train_181 WHERE hypertension = 1 OR systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100 | criteria2sql |
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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Other bronchoscopy" | mimicsql_data |
CREATE TABLE table_name_14 (
score VARCHAR,
player VARCHAR,
place VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Score for T9 United States Player Kirk Triplett?
| SELECT score FROM table_name_14 WHERE place = "t9" AND country = "united states" AND player = "kirk triplett" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'valve repair < 7 days - aortic' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105' GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE table_name_54 (
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the position for andrew paopao?
| SELECT position FROM table_name_54 WHERE player = "andrew paopao" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-15363')) AND lab.labname = '-eos' AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TI... | eicu |
CREATE TABLE table_name_67 (
country VARCHAR,
rank VARCHAR,
notes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country were the athletes where ranked smaller than 5 with notes listed as fb?
| SELECT country FROM table_name_67 WHERE rank < 5 AND notes = "fb" | sql_create_context |
CREATE TABLE table_79234 (
"School" text,
"Mascot" text,
"Location" 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 school has south bend as the location,... | SELECT "School" FROM table_79234 WHERE "Location" = 'south bend' AND "Mascot" = 'indians' | wikisql |
CREATE TABLE table_49900 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time does the trainer, Todd Pletcher have?
| SELECT "Time" FROM table_49900 WHERE "Trainer" = 'todd pletcher' | wikisql |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB d... | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_58001 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city of license is associated with call sign w244bk?
| SELECT "City of license" FROM table_58001 WHERE "Call sign" = 'w244bk' | wikisql |
CREATE TABLE table_19766 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the result for October 14, 1956?
| SELECT "Result" FROM table_19766 WHERE "Date" = 'October 14, 1956' | wikisql |
CREATE TABLE table_204_421 (
id number,
"name" text,
"nationality" text,
"position" text,
"spartak career" text,
"appearances" number,
"goals" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which player has the most appearances with the cl... | SELECT "name" FROM table_204_421 ORDER BY "appearances" DESC LIMIT 1 | squall |
CREATE TABLE table_55437 (
"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.
-- Who was the home team when the away team scored ... | SELECT "Home team score" FROM table_55437 WHERE "Away team score" = '14.21 (105)' | wikisql |
CREATE TABLE table_name_31 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 2007 of 1r is involved in what 2001?
| SELECT 2001 FROM table_name_31 WHERE 2007 = "1r" | sql_create_context |
CREATE TABLE table_name_75 (
animal VARCHAR,
resting_potential__mv_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which animal has a resting potential of 60?
| SELECT animal FROM table_name_75 WHERE resting_potential__mv_ = "−60" | sql_create_context |
CREATE TABLE table_name_5 (
crowd INTEGER,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the largest crowd size at a South Melbourne home game?
| SELECT MAX(crowd) FROM table_name_5 WHERE home_team = "south melbourne" | sql_create_context |
CREATE TABLE table_42716 (
"State" text,
"Type" text,
"Name" text,
"Title" text,
"Royal house" text,
"From" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the state Yi?
| SELECT "State" FROM table_42716 WHERE "Name" = 'yi' | wikisql |
CREATE TABLE table_name_63 (
station VARCHAR,
genre VARCHAR,
operator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which station is operated by BBC Radio under the talk radio genre?
| SELECT station FROM table_name_63 WHERE genre = "talk radio" AND operator = "bbc radio" | sql_create_context |
CREATE TABLE table_66505 (
"Debut year" real,
"Player" text,
"Games" real,
"Goals" real,
"Years at club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Debut year has Goals of 0, and Years at club of 1963, and Games larger than 5?
| SELECT AVG("Debut year") FROM table_66505 WHERE "Goals" = '0' AND "Years at club" = '1963' AND "Games" > '5' | wikisql |
CREATE TABLE table_name_63 (
game_site VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the game held when the attendance was 56,770?
| SELECT game_site FROM table_name_63 WHERE attendance = "56,770" | sql_create_context |
CREATE TABLE table_name_54 (
affiliation VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the affiliation of the University of Maryland?
| SELECT affiliation FROM table_name_54 WHERE school = "university of maryland" | sql_create_context |
CREATE TABLE table_name_18 (
played INTEGER,
lost VARCHAR,
goals_against VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Played, when Goals Against is less than 63, when Team is 'Nelson', and when Lost is greater than... | SELECT AVG(played) FROM table_name_18 WHERE goals_against < 63 AND team = "nelson" AND lost > 16 | sql_create_context |
CREATE TABLE table_36569 (
"Outcome" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent when the score was 6-3, 6-3?
| SELECT "Opponent" FROM table_36569 WHERE "Score" = '6-3, 6-3' | wikisql |
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
)
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
-- Using valid SQLite, answer the follo... | SELECT country FROM mountain WHERE height > 5600 INTERSECT SELECT country FROM mountain WHERE height < 5200 | spider |
CREATE TABLE table_29397 (
"Name" text,
"Nation" text,
"Seasons" text,
"Championship titles" text,
"Races (Starts)" text,
"Poles" real,
"Wins" real,
"Podiums" real,
"Fastest Laps" real,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT COUNT("Poles") FROM table_29397 WHERE "Points" = '0' AND "Nation" = 'Mexico' | wikisql |
CREATE TABLE table_16914 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different locations have the score 207 (-10)... | SELECT COUNT("Location") FROM table_16914 WHERE "Score" = '207 (-10)' | wikisql |
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 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 = '9719119' AND t_kc21.MED_ORG_DEPT_CD = '9117') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-09-02' AND '2007-02-07' | css |
CREATE TABLE table_22171 (
"Greek Designation" text,
"Collegiate Institution" text,
"Charter Date" text,
"Status" text,
"City" text,
"U.S. State/District" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the status in vestal
| SELECT "Status" FROM table_22171 WHERE "City" = 'Vestal' | wikisql |
CREATE TABLE table_name_41 (
director VARCHAR,
producer VARCHAR,
platform_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the director of the game with HIroshi Sato as the producer on the GBA platform?
| SELECT director FROM table_name_41 WHERE producer = "hiroshi sato" AND platform_s_ = "gba" | sql_create_context |
CREATE TABLE table_27115 (
"Afghan" text,
"Albanian" text,
"Arabic" text,
"Bangladeshi" text,
"Bosnian" text,
"Chinese" text,
"Colombian" text,
"Cook Islands" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many bosnian in cook island... | SELECT "Bosnian" FROM table_27115 WHERE "Cook Islands" = 'Sri Lankan' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2065" | mimicsql_data |
CREATE TABLE table_name_87 (
named VARCHAR,
name VARCHAR,
diameter__km_ VARCHAR,
longitude VARCHAR,
latitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the namesake of Ayashe at a longitude less than 270.7, latitude more than -47.1, a... | SELECT named AS after FROM table_name_87 WHERE longitude < 270.7 AND latitude > -47.1 AND diameter__km_ < 7.2 AND name = "ayashe" | sql_create_context |
CREATE TABLE table_14699 (
"Rank" real,
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Liu Limin's time in heat 4?
| SELECT "Time" FROM table_14699 WHERE "Heat" = '4' AND "Name" = 'liu limin' | wikisql |
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 jybgb (
BBCJBW text,
BBDM tex... | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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 jybg... | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE table_47954 (
"Date" text,
"Region" text,
"Label" text,
"Catalogue" text,
"Format" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Format, when Label is Bronze, when Date is 1982, and when Catalogue is 204 636?
| SELECT "Format" FROM table_47954 WHERE "Label" = 'bronze' AND "Date" = '1982' AND "Catalogue" = '204 636' | wikisql |
CREATE TABLE table_22510 (
"Province, Community" text,
"Contestant" text,
"Age" real,
"Height" text,
"Hometown" text,
"Geographical Regions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When toronto is the hometown how many height measurements... | SELECT COUNT("Height") FROM table_22510 WHERE "Hometown" = 'Toronto' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rbc, pleural') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88659) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-3 year'... | mimic_iii |
CREATE TABLE table_80058 (
"Year" text,
"English title" text,
"Original title" text,
"Country" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the English title listed that has an Original title of The Crying Game?
| SELECT "English title" FROM table_80058 WHERE "Original title" = 'the crying game' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATIO... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_203_497 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what country has won no silver medals ?
| SELECT "nation" FROM table_203_497 WHERE "silver" = 0 | squall |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'post spinal surgery - thoracic' AND STRF... | eicu |
CREATE TABLE table_45079 (
"Number notation" real,
"Power notation" text,
"Short scale" text,
"Long scale" text,
"Indian (or South Asian) English" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For a short scale of one quadrillion a thousand trillio... | SELECT "Long scale" FROM table_45079 WHERE "Short scale" = 'one quadrillion a thousand trillion' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '4897749' AND jybgb.BGRQ BETWEEN '2000-07-30' AND '2004-02-29' GROUP BY jybgb.KSBM HAVING COUNT(*) > 30 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb ... | css |
CREATE TABLE table_25365 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What w... | SELECT COUNT("High rebounds") FROM table_25365 WHERE "Date" = 'November 27' | wikisql |
CREATE TABLE table_14779 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the region for Catalog amlh 66078 in stereo lp format?
| SELECT "Region" FROM table_14779 WHERE "Format" = 'stereo lp' AND "Catalog" = 'amlh 66078' | 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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2187" | mimicsql_data |
CREATE TABLE table_20194 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of players for louisiana state
| SELECT COUNT("Player") FROM table_20194 WHERE "School/Club Team" = 'Louisiana State' | wikisql |
CREATE TABLE table_name_27 (
number_of_seasons_in_liga_mx INTEGER,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Number of seasons in Liga MX for Club cruz azul?
| SELECT MAX(number_of_seasons_in_liga_mx) FROM table_name_27 WHERE club = "cruz azul" | 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 (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '8322376' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-05-20' AND '2018-04-07' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 7725.47) AS T | css |
CREATE TABLE table_name_40 (
total VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Total has a Player of matt ruth?
| SELECT total FROM table_name_40 WHERE player = "matt ruth" | sql_create_context |
CREATE TABLE table_train_24 (
"id" int,
"systolic_blood_pressure_sbp" int,
"do_not_resuscitate_dnr" bool,
"temperature" float,
"hypotension" bool,
"cardiac_arrest" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT * FROM table_train_24 WHERE age >= 18 | criteria2sql |
CREATE TABLE table_17210 (
"Round" real,
"Overall" text,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds is the player Matthew Puempel associated with?
| SELECT COUNT("Round") FROM table_17210 WHERE "Player" = 'Matthew Puempel' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) GROUP BY prescriptions.drug) A... | mimic_iii |
CREATE TABLE table_204_532 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times did they place at least 12th ?
| SELECT COUNT(*) FROM table_204_532 WHERE "place" <= 12 | squall |
CREATE TABLE table_14794 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the most points for Coloni Spa?
| SELECT MAX("Points") FROM table_14794 WHERE "Entrant" = 'coloni spa' | wikisql |
CREATE TABLE table_60873 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the highest Against that has the Status of six nations, and the Date of 02/03/2002?
| SELECT MAX("Against") FROM table_60873 WHERE "Status" = 'six nations' AND "Date" = '02/03/2002' | wikisql |
CREATE TABLE table_32779 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Driver has less than 84 laps, more than 9 points and is on Rocketsports Racing Te... | SELECT "Driver" FROM table_32779 WHERE "Laps" < '84' AND "Points" > '9' AND "Team" = 'rocketsports racing' | wikisql |
CREATE TABLE table_name_18 (
rank VARCHAR,
total VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total rank where the total is less than 5, and bronze is less than 0?
| SELECT COUNT(rank) FROM table_name_18 WHERE total < 5 AND bronze < 0 | sql_create_context |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare (
fare_id int,
from_... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1700 AND flight.to_airport = AIRPORT_SERVICE_1... | atis |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT PostId AS "post_link", Score, Text FROM Comments WHERE Text LIKE '%faq#vote-differences%' ORDER BY Score DESC LIMIT 10 | sede |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate ti... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13806 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND ch... | mimic_iii |
CREATE TABLE table_13812785_8 (
high_points VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the high points dated march 13?
| SELECT high_points FROM table_13812785_8 WHERE date = "March 13" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... | mimic_iii |
CREATE TABLE table_204_52 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the last venue on this chart ?
| SELECT "venue" FROM table_204_52 ORDER BY id DESC LIMIT 1 | squall |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "77" AND diagnoses.long_title = "Other psoriasis" | mimicsql_data |
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "72" AND prescriptions.route = "PO/NG" | mimicsql_data |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
even... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.days_stay = "26" | mimicsql_data |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_17304621_14 (
upstream VARCHAR,
price_tl VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the upstream speed of the network that costs 39 tl?
| SELECT upstream FROM table_17304621_14 WHERE price_tl = "39 TL" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name | nvbench |
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 diagnoses.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "21796" | mimicsql_data |
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.discharge_location = "SNF" AND demographic.age < "80" | mimicsql_data |
CREATE TABLE table_name_41 (
april VARCHAR,
june VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the april for candice cassidy
| SELECT april FROM table_name_41 WHERE june = "candice cassidy" | sql_create_context |
CREATE TABLE table_23849 (
"Parish" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What parish did McCain have 45.37% of the votes?
| SELECT "Parish" FROM table_23849 WHERE "McCain%" = '45.37%' | 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 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 WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" | mimicsql_data |
CREATE TABLE station (
id number,
name text,
lat number,
long number,
dock_count number,
city text,
installation_date text
)
CREATE TABLE status (
station_id number,
bikes_available number,
docks_available number,
time text
)
CREATE TABLE weather (
date text,
max_te... | SELECT COUNT(DISTINCT city) FROM station | spider |
CREATE TABLE table_name_12 (
date VARCHAR,
grand_prix VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for the australian grand prix.
| SELECT date FROM table_name_12 WHERE grand_prix = "australian grand prix" | sql_create_context |
CREATE TABLE table_25375 (
"Player" text,
"Games Played" real,
"Minutes" real,
"Field Goals" real,
"Three Pointers" real,
"Free Throws" real,
"Rebounds" real,
"Assists" real,
"Blocks" real,
"Steals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions... | SELECT MAX("Games Played") FROM table_25375 WHERE "Three Pointers" = '5' | wikisql |
CREATE TABLE table_203_815 (
id number,
"pick #" number,
"nfl team" text,
"player" text,
"position" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which position had the least number of players in round nine ?
| SELECT "position" FROM table_203_815 GROUP BY "position" HAVING COUNT("player") = (SELECT COUNT("player") FROM table_203_815 GROUP BY "position" ORDER BY COUNT("player") LIMIT 1) | squall |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '58061433' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2009-08-27' AND '2021-02-09' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHA... | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY Document_Date | nvbench |
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 transfers (
row_id number,
subject_id number,
had... | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29741) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND outputevents.it... | mimic_iii |
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "481" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_197638_6 (
age INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At what age did Roy Emerson complete the Grand Slam?
| SELECT MAX(age) FROM table_197638_6 WHERE player = "Roy Emerson" | sql_create_context |
CREATE TABLE basketball_match (
team_id number,
school_id number,
team_name text,
acc_regular_season text,
acc_percent text,
acc_home text,
acc_road text,
all_games text,
all_games_percent number,
all_home text,
all_road text,
all_neutral text
)
CREATE TABLE university (... | SELECT t1.primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent LIMIT 1 | spider |
CREATE TABLE table_67976 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text,
"10:30" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What 10:00 has a 7:30 of da kink in my hair?
| SELECT "10:00" FROM table_67976 WHERE "7:30" = 'da kink in my hair' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE table_15168 (
"Representative" text,
"Title" text,
"Presentation of Credentials" text,
"Termination of Mission" text,
"Appointed by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Representative has a Termination of Mission as May... | SELECT "Representative" FROM table_15168 WHERE "Termination of Mission" = 'may 24, 1905' | wikisql |
CREATE TABLE table_1341604_10 (
candidates VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many candidates with result being new seat democratic gain
| SELECT COUNT(candidates) FROM table_1341604_10 WHERE result = "New seat Democratic gain" | sql_create_context |
CREATE TABLE table_21623 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the number of seasons that was directed by Joanna Kerns... | SELECT COUNT("Season #") FROM table_21623 WHERE "Directed by" = 'Joanna Kerns' | wikisql |
CREATE TABLE table_46220 (
"Date" text,
"Opponent" text,
"Location" text,
"Time" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was a game played at 7:00 pm?
| SELECT "Date" FROM table_46220 WHERE "Time" = '7:00 pm' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.