instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_41 (
winner VARCHAR,
pole_position VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Winner, when Pole Position is Ben Spies, and when Date is Elkhart Lake, Wisconsin?
| SELECT winner FROM table_name_41 WHERE pole_position = "ben spies" AND date = "elkhart lake, wisconsin" | sql_create_context |
CREATE TABLE table_name_76 (
gold VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won gold in the games where Pan Cheng-Tsung won silver?
| SELECT gold FROM table_name_76 WHERE silver = "pan cheng-tsung" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_42091 (
"Office" text,
"Democratic ticket" text,
"Republican ticket" text,
"American Labor ticket" text,
"Socialist ticket" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Democrtic candidate ran against the Socialist candida... | SELECT "Democratic ticket" FROM table_42091 WHERE "Socialist ticket" = 'edna mitchell blue' | wikisql |
CREATE TABLE table_52220 (
"Year" text,
"Builder" text,
"Motors" text,
"Trailers" text,
"Control Trailers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the trailers for motors of 145
| SELECT "Trailers" FROM table_52220 WHERE "Motors" = '145' | wikisql |
CREATE TABLE table_train_117 (
"id" int,
"mini_mental_state_examination_mmse" int,
"systolic_blood_pressure_sbp" int,
"renal_disease" bool,
"total_serum_protein" int,
"diastolic_blood_pressure_dbp" int,
"geriatric_depression_scale_gds" int,
"serum_creatinine" float,
"uncontrolled_blo... | SELECT * FROM table_train_117 WHERE uncontrolled_blood_pressure = 1 OR systolic_blood_pressure_sbp >= 140 OR diastolic_blood_pressure_dbp >= 90 | criteria2sql |
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.dob_year < "1846" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_11961582_4 (
high_rebounds VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the most high rebounds in the game 24?
| SELECT high_rebounds FROM table_11961582_4 WHERE game = 24 | sql_create_context |
CREATE TABLE table_name_87 (
gold INTEGER,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the highest Gold that has the Bronze smaller than 1, and the Total larger than 4?
| SELECT MAX(gold) FROM table_name_87 WHERE bronze < 1 AND total > 4 | sql_create_context |
CREATE TABLE table_61386 (
"Draft" real,
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of rounds of the player with a pick of 20?
| SELECT COUNT("Round") FROM table_61386 WHERE "Pick" = '20' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id 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.short_title = "Late ef-hemplga side NOS" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_name_68 (
location VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which location had a year over 2006?
| SELECT location FROM table_name_68 WHERE year > 2006 | sql_create_context |
CREATE TABLE table_14133 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent had an Attendance of 78,883?
| SELECT "Opponent" FROM table_14133 WHERE "Attendance" = '78,883' | wikisql |
CREATE TABLE table_name_14 (
class VARCHAR,
part_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which class has a part 2 of halp war ?
| SELECT class FROM table_name_14 WHERE part_2 = "halp warþ" | sql_create_context |
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.JYXMDM, zyjybgb.JYXMMC FROM zyjybgb WHERE zyjybgb.BGDH = '59688367241' UNION SELECT mzjybgb.JYXMDM, mzjybgb.JYXMMC FROM mzjybgb WHERE mzjybgb.BGDH = '59688367241' | css |
CREATE TABLE table_25872 (
"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.
-- When c... | SELECT "High points" FROM table_25872 WHERE "High assists" = 'Chauncey Billups (4)' | wikisql |
CREATE TABLE table_76955 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many spectators attended the game on 11/09/1935?
| SELECT "Attendance" FROM table_76955 WHERE "Date" = '11/09/1935' | wikisql |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51466" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_35355 (
"Game" real,
"April" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which April has a Game of 84
| SELECT MAX("April") FROM table_35355 WHERE "Game" = '84' | wikisql |
CREATE TABLE table_name_73 (
note VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the note for catalog of 32xa-106
| SELECT note FROM table_name_73 WHERE catalog = "32xa-106" | sql_create_context |
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 prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ISOS10" | mimicsql_data |
CREATE TABLE table_22012 (
"Name" text,
"Volume" text,
"Engine" text,
"Fuel" text,
"Output" text,
"Torque" text,
"Engine ID code(s)" text,
"0\u2013100km/h,s" text,
"Top speed" text,
"CO 2" text,
"Years" text
)
-- Using valid SQLite, answer the following questions for the ta... | SELECT "Volume" FROM table_22012 WHERE "CO 2" = '168 g/km' | wikisql |
CREATE TABLE table_name_19 (
year INTEGER,
engine VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average yeara for engine of renault v10 with points more than 4
| SELECT AVG(year) FROM table_name_19 WHERE engine = "renault v10" AND points > 4 | sql_create_context |
CREATE TABLE table_62965 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT AVG("ANSI code") FROM table_62965 WHERE "Township" = 'sherman' AND "Water (sqmi)" < '0.005' | wikisql |
CREATE TABLE table_name_21 (
qual_2 VARCHAR,
qual_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time for the second qualification where the first qualification time was 1:21.523?
| SELECT qual_2 FROM table_name_21 WHERE qual_1 = "1:21.523" | sql_create_context |
CREATE TABLE ReviewTaskStates (
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,
DownV... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Pakistan%' OR UPPER(Location) LIKE '%Pak' ORDER BY Reputation DESC LIMIT 250 | sede |
CREATE TABLE table_1117 (
"Locale" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Locale" FROM table_1117 WHERE "Skip" = 'Colleen Jones' | wikisql |
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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_type = "URGENT" | mimicsql_data |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (... | SELECT DISTINCT ground_service.ground_fare, ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_code = airport_service.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_name = 'P... | atis |
CREATE TABLE table_26460435_5 (
monarch VARCHAR,
heir VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of monarchs that had Yan Maw la Mon as the heir?
| SELECT COUNT(monarch) FROM table_26460435_5 WHERE heir = "Yan Maw La Mon" | sql_create_context |
CREATE TABLE table_27183 (
"No. in series" real,
"No. in 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.
-- What is the episod... | SELECT "Title" FROM table_27183 WHERE "U.S. viewers (millions)" = '8.16' | wikisql |
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 t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '凤香馨' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3461.35) | css |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
Party_ID int,
... | SELECT Committee, COUNT(Committee) FROM election GROUP BY Committee ORDER BY Committee DESC | nvbench |
CREATE TABLE table_41852 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ICAO when the IATA is ist?
| SELECT "ICAO" FROM table_41852 WHERE "IATA" = 'ist' | wikisql |
CREATE TABLE table_name_70 (
original_name VARCHAR,
language VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original name of the song performed in Swedish?
| SELECT original_name FROM table_name_70 WHERE language = "swedish" | sql_create_context |
CREATE TABLE table_name_35 (
chassis VARCHAR,
year VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which chassis is from 1974 and was an entrant of Goldie Hexagon racing?
| SELECT chassis FROM table_name_35 WHERE year = 1974 AND entrant = "goldie hexagon racing" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
... | SELECT c.Id AS "comment_link", c.Text, c.UserId AS "user_link", c.CreationDate FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE (p.OwnerUserId = '##UserId?8297##') AND (c.Text LIKE '%##Word?chat##%' COLLATE Latin1_General_CI_AI) AND (p.PostTypeId = '##type?1##') | sede |
CREATE TABLE table_name_85 (
model VARCHAR,
seats VARCHAR,
built VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Model of the Engine with 29 Seats Built in 1941 1942?
| SELECT model FROM table_name_85 WHERE seats = 29 AND built = "1941–1942" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "SYNCOPE;TELEMETRY" | mimicsql_data |
CREATE TABLE table_15013825_8 (
copa_libertadores_1992 VARCHAR,
copa_conmebol_1992 VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the copa libertadores 1992 for round of 16 and team of fluminense
| SELECT copa_libertadores_1992 FROM table_15013825_8 WHERE copa_conmebol_1992 = "Round of 16" AND team = "Fluminense" | sql_create_context |
CREATE TABLE txmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb... | css |
CREATE TABLE table_7444 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Against has a Position larger than 8, and ... | SELECT "Against" FROM table_7444 WHERE "Position" > '8' AND "Points" > '9' | wikisql |
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 USE_FRE, EACH_DOSAGE FROM t_kc22 WHERE MED_CLINIC_ID = '31414220389' AND SOC_SRT_DIRE_CD = '047472-s' | css |
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Ac posthemorrhag anemia" AND prescriptions.route = "NG" | mimicsql_data |
CREATE TABLE table_14626 (
"Name" text,
"Country" text,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the source of a move from ... | SELECT "Source" FROM table_14626 WHERE "Moving from" = 'swindon town' | 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 q.Id AS "post_link", q.Tags, q.Score, q.Title, q.ClosedDate, (SELECT SUM(Score) FROM Posts AS A WHERE q.Id = A.ParentId AND A.Score > 0) AS asco FROM Posts AS q WHERE q.PostTypeId = 1 AND q.Score > 0 AND q.Tags LIKE '%<' + @Tag + '>%' AND (SELECT SUM(Score) FROM Posts AS A WHERE q.Id = A.ParentId AND A.Score > 0... | sede |
CREATE TABLE table_62672 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total Money ( ) of Player of nick faldo?
| SELECT SUM("Money ( \u00a3 )") FROM table_62672 WHERE "Player" = 'nick faldo' | wikisql |
CREATE TABLE table_69636 (
"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 has a value of k293bg for its call sign?
| SELECT "City of license" FROM table_69636 WHERE "Call sign" = 'k293bg' | wikisql |
CREATE TABLE table_name_40 (
attendance INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average attendance on October 12?
| SELECT AVG(attendance) FROM table_name_40 WHERE date = "october 12" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patient... | SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-11731')) AND NOT vitalperiodic.heartrate IS NULL AND ... | eicu |
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 MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" | mimicsql_data |
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_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '昌正平' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 1846.9) | css |
CREATE TABLE table_73526 (
"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.
-- When w... | SELECT "Date" FROM table_73526 WHERE "High assists" = 'Deron Williams (13)' | wikisql |
CREATE TABLE table_65785 (
"Draw" real,
"Language" text,
"Song" text,
"English translation" text,
"Place" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of points when the English translation is Long Live L... | SELECT COUNT("Points") FROM table_65785 WHERE "English translation" = 'long live life' AND "Draw" < '2' | wikisql |
CREATE TABLE table_name_84 (
fcc_info VARCHAR,
frequency_mhz INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which FCC info has a Frequency MHz larger than 102.3?
| SELECT fcc_info FROM table_name_84 WHERE frequency_mhz > 102.3 | sql_create_context |
CREATE TABLE table_74565 (
"Area" text,
"Advertisement date" text,
"Block" text,
"Winning applicant" text,
"Ensemble name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Winning Applicant of Block 10B in Derbyshire Area?
| SELECT "Winning applicant" FROM table_74565 WHERE "Block" = '10b' AND "Area" = 'derbyshire' | wikisql |
CREATE TABLE table_203_229 (
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.
-- what team had the first pick in round 17 of the 1969 nfl draft ?
| SELECT "nfl team" FROM table_203_229 ORDER BY "pick #" LIMIT 1 | squall |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '章乐悦' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE office_locations (
building_id number,
company_id number,
move_in_year number
)
CREATE TABLE companies (
id number,
name text,
headquarters text,
industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value_billion text
)
CRE... | SELECT industry FROM companies GROUP BY industry ORDER BY COUNT(*) DESC | spider |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Cou... | SELECT Id AS "comment_link", Score, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('%##CommentText##%') AND UserId = '##userId##' ORDER BY Score DESC | sede |
CREATE TABLE table_61198 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"4:30 pm" text,
"5:00 pm" ... | SELECT "1:00 pm" FROM table_61198 WHERE "4:00 pm" = 'local programs' AND "8:00 am" = 'the early show' | wikisql |
CREATE TABLE takes (
id text,
course_id text,
sec_id text,
semester text,
year number,
grade text
)
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE course (
course_id text,
title text,
dept_name text,
cr... | SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History' | spider |
CREATE TABLE table_44664 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the rider for Honda with a grid of 25?
| SELECT "Rider" FROM table_44664 WHERE "Manufacturer" = 'honda' AND "Grid" = '25' | wikisql |
CREATE TABLE table_name_49 (
nationality VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality has a pick of 1?
| SELECT nationality FROM table_name_49 WHERE pick = "1" | sql_create_context |
CREATE TABLE table_64324 (
"Name" text,
"Career" text,
"Matches" real,
"Overs" real,
"Maidens" real,
"Runs" real,
"Wickets" real,
"Average" real,
"Best" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest number of wic... | SELECT MAX("Wickets") FROM table_64324 WHERE "Maidens" > '630' AND "Best" = '7/72' | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "KCL40I" | mimicsql_data |
CREATE TABLE table_name_35 (
school_club_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school does John Crotty play for?
| SELECT school_club_team FROM table_name_35 WHERE player = "john crotty" | sql_create_context |
CREATE TABLE table_42248 (
"Event" text,
"Record" text,
"Nation" text,
"Date" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Record of 8:39.49?
| SELECT "Date" FROM table_42248 WHERE "Record" = '8:39.49' | wikisql |
CREATE TABLE table_76123 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Country with Reteconomy as the Television service?
| SELECT "Country" FROM table_76123 WHERE "Television service" = 'reteconomy' | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.drug = "Dexamethasone" | mimicsql_data |
CREATE TABLE table_31977 (
"Candidate" text,
"Party" text,
"Constituency" text,
"Year" text,
"Days" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the number of days in 1945 where the constituent was heywood and radcliffe?
| SELECT "Days" FROM table_31977 WHERE "Year" = '1945' AND "Constituency" = 'heywood and radcliffe' | wikisql |
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.diagnosisname FROM (SELECT t2.diagnosisname, 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 = 'intracranial injury - with loss of consc... | eicu |
CREATE TABLE table_62095 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft (m)" text,
"Floors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the height in ft and m of the regions bank building?
| SELECT "Height ft (m)" FROM table_62095 WHERE "Name" = 'regions bank building' | wikisql |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '0036659' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-05-11' AND '2014-02-03' UNION SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_k... | css |
CREATE TABLE table_72511 (
"Round" real,
"Pick #" text,
"Player" text,
"Position" text,
"Nationality" text,
"College/junior/club team (league)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the college/junior/club team (league) of the p... | SELECT "College/junior/club team (league)" FROM table_72511 WHERE "Pick #" = '130' | wikisql |
CREATE TABLE table_22349 (
"State (class)" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date of successors formal installation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the state (class) where the new successor w... | SELECT "State (class)" FROM table_22349 WHERE "Date of successors formal installation" = 'May 11, 1966' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, 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 = '75549243' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-06-05' AND '2019-12-01' | css |
CREATE TABLE table_203_119 (
id number,
"jamo" text,
"hangul compatibility" text,
"hangul jamo area" text,
"hanyang private use" text,
"halfwidth" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which symbol is listed at the top of the jamo colum... | SELECT "jamo" FROM table_203_119 ORDER BY id LIMIT 1 | squall |
CREATE TABLE table_name_95 (
enrollment VARCHAR,
_number___county VARCHAR,
ihsaa_class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total enrollment in 57 Noble having a # and AA as the IHSAA Class?
| SELECT COUNT(enrollment) FROM table_name_95 WHERE _number___county = "57 noble" AND ihsaa_class = "aa" | sql_create_context |
CREATE TABLE table_name_91 (
date VARCHAR,
label VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The release from Simply Vinyl label was on what date?
| SELECT date FROM table_name_91 WHERE label = "simply vinyl" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4044') AND NOT patient.unitdischargetime IS NULL ... | eicu |
CREATE TABLE procedures (
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 MIN(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "T5 FRACTURE" | mimicsql_data |
CREATE TABLE Ref_document_types (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the number of document types.
| SELECT COUNT(*) FROM Ref_document_types | 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 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 WHERE demographic.admission_type = "URGENT" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" | mimicsql_data |
CREATE TABLE table_38963 (
"Week 2 Sept 7" text,
"Week 3 Sept 14" text,
"Week 4 Sept 21" text,
"Week 5 Sept 28" text,
"Week 6 Oct 5" text,
"Week 7 Oct 12" text,
"Week 10 Nov 2" text,
"Week 12 Nov 16" text,
"Week 14 Nov 30" text,
"Week 15 Dec 7" text,
"Week 16 (Final) Jan 9" t... | SELECT "Week 14 Nov 30" FROM table_38963 WHERE "Week 10 Nov 2" = 'michigan state (8-2)' | wikisql |
CREATE TABLE table_49066 (
"Party" text,
"Previous council" real,
"Staying councillors" real,
"Seats up for election" real,
"Election result" real,
"New council" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many staying councillors were th... | SELECT AVG("Staying councillors") FROM table_49066 WHERE "Election result" > '0' AND "Party" = 'conservatives' AND "New council" < '27' | wikisql |
CREATE TABLE table_name_32 (
event_2 VARCHAR,
air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the 2nd event aired on 8 June 2008?
| SELECT event_2 FROM table_name_32 WHERE air_date = "8 june 2008" | 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 t_kc24.t_kc21_IN_DIAG_DIS_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '苗伟懋' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6998.54) | css |
CREATE TABLE table_name_23 (
date VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of week 8?
| SELECT date FROM table_name_23 WHERE week = 8 | sql_create_context |
CREATE TABLE table_204_608 (
id number,
"name" text,
"elected party" text,
"constituency" text,
"elected date" text,
"military service" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many of these members were elected in october ?
| SELECT COUNT("name") FROM table_204_608 WHERE "elected date" = 10 | squall |
CREATE TABLE table_name_84 (
loses VARCHAR,
points VARCHAR,
points_against VARCHAR,
points_for VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What losses have points for less than 1175, wins greater than 2, points against greater th... | SELECT loses FROM table_name_84 WHERE points_for < 1175 AND wins > 2 AND points_against > 894 AND points = 24 | sql_create_context |
CREATE TABLE table_55673 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the grid when the time/retired is +27.112?
| SELECT "Grid" FROM table_55673 WHERE "Time/Retired" = '+27.112' | wikisql |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '8159857' AND RYDJSJ BETWEEN '2010-08-09' AND '2018-02-21' AND DATEDIFF(CYSJ, RYSJ) > 26 | css |
CREATE TABLE table_19052 (
"#" real,
"Episode title" text,
"Writer(s)" text,
"Director" text,
"Prod. Code" text,
"Original airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the the writer(s) with original airdate being february 7, 2... | SELECT "Writer(s)" FROM table_19052 WHERE "Original airdate" = 'February 7, 2001' | wikisql |
CREATE TABLE table_name_29 (
pick VARCHAR,
school VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many picks did Central State have before round 2?
| SELECT COUNT(pick) FROM table_name_29 WHERE school = "central state" AND round < 2 | sql_create_context |
CREATE TABLE table_23827 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many directors were i... | SELECT COUNT("Directed by") FROM table_23827 WHERE "Season #" = '2' | wikisql |
CREATE TABLE table_52037 (
"Country" text,
"OF-5" text,
"OF-4" text,
"OF-2" text,
"OF-1" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which OF-5 is in Ghana?
| SELECT "OF-5" FROM table_52037 WHERE "Country" = 'ghana' | wikisql |
CREATE TABLE table_18332845_2 (
calling_at VARCHAR,
departure VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the calling at for the 09.50 departure?
| SELECT calling_at FROM table_18332845_2 WHERE departure = "09.50" | sql_create_context |
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.JCFF FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.