instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT SUM(inputevents_cv.amount) 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 = 11914)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
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 jybgb.BGDH 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 = '郑欣嘉' AND NOT ... | css |
CREATE TABLE table_18662026_10 (
gymnast VARCHAR,
parallel_bars VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the parallel bars is 16.150, who is the gymnast?
| SELECT gymnast FROM table_18662026_10 WHERE parallel_bars = "16.150" | sql_create_context |
CREATE TABLE Customers (
customer_address_id VARCHAR,
first_name VARCHAR,
last_name VARCHAR
)
CREATE TABLE Addresses (
country VARCHAR,
address_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country does customer with first name as Caro... | SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.icd9_code = "79439" | mimicsql_data |
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_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
... | SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_400 DESC | nvbench |
CREATE TABLE table_name_20 (
score VARCHAR,
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE SCORE WITH VISITORS CHICAGO BLACK HAWKS ON MARCH 24?
| SELECT score FROM table_name_20 WHERE visitor = "chicago black hawks" AND date = "march 24" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'E70.881' AND jyjgzbb.JCZBMC = '甲胎蛋白' | css |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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.JZ... | css |
CREATE TABLE table_15071 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the year when Spirit Tom's Racing had more than 3 points?
| SELECT SUM("Year") FROM table_15071 WHERE "Entrant" = 'spirit tom''s racing' AND "Points" > '3' | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Arthropathy NOS-unspec" AND lab.label = "Urobilinogen" | mimicsql_data |
CREATE TABLE table_203_756 (
id number,
"year" number,
"title" text,
"role" text,
"network" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many films made in 2003 ?
| SELECT COUNT("title") FROM table_203_756 WHERE "year" = 2003 | squall |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
... | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'DL' | atis |
CREATE TABLE table_79029 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the shooter for the WC Beijing event?
| SELECT "Shooter" FROM table_79029 WHERE "Event" = 'wc beijing' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-27704' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
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... | SELECT Location, COUNT(Location) FROM party GROUP BY Location ORDER BY COUNT(Location) | nvbench |
CREATE TABLE table_name_35 (
name VARCHAR,
license VARCHAR,
current_version VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Name when the License is gpl and the Current Version is 1.72?
| SELECT name FROM table_name_35 WHERE license = "gpl" AND current_version = "1.72" | sql_create_context |
CREATE TABLE table_48698 (
"Year" real,
"Winner" text,
"Finalist" text,
"Result" text,
"Date" text,
"Venue" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner when the finalist was fsv frankfurt?
| SELECT "Winner" FROM table_48698 WHERE "Finalist" = 'fsv frankfurt' | wikisql |
CREATE TABLE table_21553 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the ... | SELECT "Date of appointment" FROM table_21553 WHERE "Manner of departure" = 'Sacked' AND "Position in table" = '14th' AND "Replaced by" = 'Marco Kostmann' | wikisql |
CREATE TABLE table_64790 (
"Position" text,
"Gymnast" text,
"A Score" real,
"B Score" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the greatest B score when the A score was less than 6.5?
| SELECT MAX("B Score") FROM table_64790 WHERE "A Score" < '6.5' | wikisql |
CREATE TABLE table_7659 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Result for the game played 10/02/1982 where the Attendance was greater than 21,500?
| SELECT "Result" FROM table_7659 WHERE "Attendance" > '21,500' AND "Date" = '10/02/1982' | wikisql |
CREATE TABLE table_8946 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team at the Fo... | SELECT "Away team" FROM table_8946 WHERE "Ground" = 'football park' | 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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '88565682' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' | css |
CREATE TABLE table_37111 (
"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 Played has a Lost larger than 4, and a Te... | SELECT SUM("Played") FROM table_37111 WHERE "Lost" > '4' AND "Team" = 'américa' AND "Points" < '5' | wikisql |
CREATE TABLE table_203_55 (
id number,
"japanese title" text,
"western title" text,
"regions" text,
"release" number,
"platform(s)" text,
"genre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the total of super chinese games releas... | SELECT COUNT("japanese title") FROM table_203_55 | squall |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid num... | 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-77687')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation number,
iata text,
icao text
)
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE ... | SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_32825 (
"Network" text,
"Origin of Programming" text,
"Language" text,
"Genre" text,
"Service" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which language is used by the optimum TV service that shows cricket and is based in the ... | SELECT "Language" FROM table_32825 WHERE "Service" = 'optimum tv' AND "Origin of Programming" = 'united states' AND "Genre" = 'cricket' | wikisql |
CREATE TABLE producer (
pid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE made_by (
id int,
msid int,
pid int
)
CREATE TABLE tags (
id int,
msid int,
kid int
)
CREATE TABLE tv_series (
sid int,
title text,
rel... | SELECT movie.title FROM company, copyright, movie WHERE company.name = 'Netflix' AND copyright.cid = company.id AND movie.mid = copyright.msid | imdb |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_35097 (
"Date" text,
"Result" text,
"Score" text,
"Venue" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Result of l, and a Date of 15-oct-64 had what score?
| SELECT "Score" FROM table_35097 WHERE "Result" = 'l' AND "Date" = '15-oct-64' | wikisql |
CREATE TABLE table_name_7 (
city VARCHAR,
host VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city is the Northeast Louisiana University located in?
| SELECT city FROM table_name_7 WHERE host = "northeast louisiana university" | sql_create_context |
CREATE TABLE table_59042 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What attendance is listed against the date of bye?
| SELECT "Attendance" FROM table_59042 WHERE "Date" = 'bye' | wikisql |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id number,
medicine_id number,
interaction_type text
)
CREATE TABLE medicine (
id number,
name text,
trade_name text,
fda_approved text
)
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosom... | SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id = T3.id WHERE T3.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor' | spider |
CREATE TABLE table_name_66 (
time INTEGER,
rank VARCHAR,
nationality VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the lowest Time of jamaica with a Lane larger than 4 and a Rank smaller than 1?
| SELECT MIN(time) FROM table_name_66 WHERE nationality = "jamaica" AND lane > 4 AND rank < 1 | sql_create_context |
CREATE TABLE table_67222 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was a friendly competition and a result of 3 0?
| SELECT "Date" FROM table_67222 WHERE "Competition" = 'friendly' AND "Result" = '3–0' | 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.icd9_code = "78057" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_57154 (
"Year" real,
"Award ceremony" text,
"Category" text,
"Nominee" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Aaron Tveit nominated in the Favorite Male Replacement category?
| SELECT AVG("Year") FROM table_57154 WHERE "Result" = 'nominated' AND "Category" = 'favorite male replacement' AND "Nominee" = 'aaron tveit' | wikisql |
CREATE TABLE table_name_84 (
away_team VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What away team scored 107-104?
| SELECT away_team FROM table_name_84 WHERE score = "107-104" | sql_create_context |
CREATE TABLE table_name_34 (
attendance INTEGER,
opponent VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Attendance when Middlesbrough played at Venue A?
| SELECT MIN(attendance) FROM table_name_34 WHERE opponent = "middlesbrough" AND venue = "a" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL ABSCESS" AND demographic.age < "58" | mimicsql_data |
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int... | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name DESC | nvbench |
CREATE TABLE table_50839 (
"Date" text,
"Opponent" text,
"Score" text,
"Leading Scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Leading Scorer has a Record of 3-3?
| SELECT "Leading Scorer" FROM table_50839 WHERE "Record" = '3-3' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... | SELECT UserId AS "user_link", COUNT(*) AS "comments" FROM Comments WHERE CreationDate >= 2014 - 05 - 01 GROUP BY UserId ORDER BY COUNT(*) DESC | sede |
CREATE TABLE keyword (
id int,
keyword text
)
CREATE TABLE written_by (
id int,
msid int,
wid int
)
CREATE TABLE writer (
wid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE made_by (
id int,
msid int,
pid int
)
CR... | SELECT cast.role FROM actor, cast, movie WHERE cast.aid = actor.aid AND movie.mid = cast.msid AND movie.title = 'Daddy Long Legs' | imdb |
CREATE TABLE table_25636 (
"No." real,
"Place & date" text,
"Target" text,
"Area damaged" text,
"Cause of damage" text,
"Intercepted by Patriot" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What area was damaged when King Khalid Military City ... | SELECT "Area damaged" FROM table_25636 WHERE "Target" = 'King Khalid Military City' | wikisql |
CREATE TABLE table_204_541 (
id number,
"name" text,
"area" text,
"height" text,
"floors" number,
"year" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the tallest building in kanpur ?
| SELECT "name" FROM table_204_541 ORDER BY "height" DESC LIMIT 1 | squall |
CREATE TABLE table_name_98 (
attendance VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game against away team Cambridge City?
| SELECT attendance FROM table_name_98 WHERE away_team = "cambridge city" | sql_create_context |
CREATE TABLE table_29541 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. No." real,
"Viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes have 18.7... | SELECT COUNT("No. in series") FROM table_29541 WHERE "Viewers (millions)" = '18.73' | 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 * FROM gwyjzb WHERE gwyjzb.PERSON_ID = '97484967' AND gwyjzb.MED_SER_ORG_NO = '0560668' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%急诊%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '97484967' AND fgwyjzb.MED_SER_ORG_NO = '0560668' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%急诊%' | css |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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
)
CR... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17608) AND STRFTIME('%y', procedures_icd.charttime) = '2104' ORDER B... | mimic_iii |
CREATE TABLE table_13672 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the outcome on april 24, 1988?
| SELECT "Outcome" FROM table_13672 WHERE "Date" = 'april 24, 1988' | wikisql |
CREATE TABLE table_25766 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the serie... | SELECT MAX("No. in series") FROM table_25766 WHERE "Written by" = 'Dan Vebber' | wikisql |
CREATE TABLE table_74752 (
"Year" real,
"Date" text,
"Location" text,
"Theme" text,
"Anthem" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year it was located in gelredome, arnhem, and a Anthem of technoboy - next dimensional w... | SELECT MIN("Year") FROM table_74752 WHERE "Location" = 'gelredome, arnhem' AND "Anthem" = 'technoboy - next dimensional world' | wikisql |
CREATE TABLE table_27615520_1 (
form_factor VARCHAR,
bandwidth__gb_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the shape distortion for the range frequency of 10?
| SELECT form_factor FROM table_27615520_1 WHERE bandwidth__gb_s_ = "10" | sql_create_context |
CREATE TABLE table_204_121 (
id number,
"year" text,
"game" text,
"developer" text,
"setting" text,
"platform" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of games from produced from 1963 to 1973 ?
| SELECT COUNT("game") FROM table_204_121 WHERE "year" >= 1963 AND "year" <= 1973 | squall |
CREATE TABLE table_31816 (
"Source" text,
"Date" text,
"Donoghue (D)" text,
"Eldridge (D)" text,
"Finegold (D)" text,
"Miceli (D)" text,
"Tsongas (D)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the tsongas of may 22, 2007
| SELECT "Tsongas (D)" FROM table_31816 WHERE "Date" = 'may 22, 2007' | wikisql |
CREATE TABLE table_name_68 (
points INTEGER,
club VARCHAR,
loses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points have utenis utena as the club, with loses less than 16?
| SELECT SUM(points) FROM table_name_68 WHERE club = "utenis utena" AND loses > 16 | sql_create_context |
CREATE TABLE table_203_782 (
id number,
"year" number,
"actor" text,
"award" text,
"category" text,
"role" text,
"episode" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many annie awards were won before 2009 ?
| SELECT COUNT(*) FROM table_203_782 WHERE "award" = 'annie award' AND "year" < 2009 | squall |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count num... | SELECT DATEPART(hh, p.CreationDate) AS "post_hour", COUNT(p.Id) AS "questions_asked", AVG(CAST(p.Score AS DECIMAL)) AS "avg_score", AVG(p.ViewCount) AS "avg_views", AVG(CAST(p.AnswerCount AS DECIMAL)) AS "avg_answers", AVG(CAST(u.Reputation AS BIGINT)) AS "avg_asker_rep", AVG(CAST(DATEDIFF(dd, u.CreationDate, CreationD... | sede |
CREATE TABLE swimmer (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find all details for each swimmer.
| SELECT * FROM swimmer | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_1137694_3 (
winning_driver VARCHAR,
winning_constructor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who drove the winning car constructed by Jordan - Mugen-Honda?
| SELECT winning_driver FROM table_1137694_3 WHERE winning_constructor = "Jordan - Mugen-Honda" | sql_create_context |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Injection oxazolidinone" | mimicsql_data |
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 EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC | nvbench |
CREATE TABLE customers (
customer_id number,
customer_type_code text,
address_line_1 text,
address_line_2 text,
town_city text,
state text,
email_address text,
phone_number text
)
CREATE TABLE staff (
staff_id number,
gender text,
first_name text,
last_name text,
ema... | SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1 | spider |
CREATE TABLE device (
Device_ID int,
Device text,
Carrier text,
Package_Version text,
Applications text,
Software_Platform text
)
CREATE TABLE stock (
Shop_ID int,
Device_ID int,
Quantity int
)
CREATE TABLE shop (
Shop_ID int,
Shop_Name text,
Location text,
Open_Dat... | SELECT Shop_Name, COUNT(Shop_Name) FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID GROUP BY Shop_Name ORDER BY Shop_Name | nvbench |
CREATE TABLE table_2102714_1 (
archive VARCHAR,
run_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the archive for the episode with a run time of 25:24?
| SELECT archive FROM table_2102714_1 WHERE run_time = "25:24" | sql_create_context |
CREATE TABLE table_66924 (
"!accented mora" text,
"one mora" text,
"two-mora word" text,
"three-mora word" text,
"gloss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the one mora for a low tone mora with a gloss of / okiru/ [ k ]?
| SELECT "one mora" FROM table_66924 WHERE "!accented mora" = 'low tone' AND "gloss" = '/˩okiru/ [òkìɽɯ́]' | wikisql |
CREATE TABLE table_name_2 (
notes VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the notes when his position was 10th?
| SELECT notes FROM table_name_2 WHERE position = "10th" | sql_create_context |
CREATE TABLE table_44074 (
"Subject" real,
"Proximity" text,
"Honor" text,
"Singular" text,
"Plural" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Proximity, when Plural is amader (our)?
| SELECT "Proximity" FROM table_44074 WHERE "Plural" = 'amader (our)' | wikisql |
CREATE TABLE table_37393 (
"Surname" text,
"First" text,
"D.O.B." text,
"Bats" text,
"Throws" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is Collins' DOB?
| SELECT "D.O.B." FROM table_37393 WHERE "Surname" = 'collins' | 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 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 = "3079" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_name_69 (
date_made VARCHAR,
names VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the locomotive named Blacklion Glencar?
| SELECT date_made FROM table_name_69 WHERE names = "blacklion glencar" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org... | SELECT (SELECT SUM(inputevents_cv.amount) 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 = 12775)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_... | mimic_iii |
CREATE TABLE table_42253 (
"Round" text,
"Date" text,
"Home team" text,
"Score" text,
"Away team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the 4th round, with home team Itabuna, played?
| SELECT "Date" FROM table_42253 WHERE "Round" = '4th' AND "Home team" = 'itabuna' | wikisql |
CREATE TABLE table_name_97 (
population INTEGER,
area_km_2 VARCHAR,
official_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Population of the New Bandon Parish with an Area km 2 larger than 326.76?
| SELECT MAX(population) FROM table_name_97 WHERE area_km_2 > 326.76 AND official_name = "new bandon" | sql_create_context |
CREATE TABLE table_name_72 (
academic_ VARCHAR,
_university_affairs VARCHAR,
local_affairs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was in Academic & University Affairs when Andrew Langille was in local affairs?
| SELECT academic_ & _university_affairs FROM table_name_72 WHERE local_affairs = "andrew langille" | sql_create_context |
CREATE TABLE table_73950 (
"Name" text,
"Turbines" text,
"Capacity (MW)" text,
"Power (MW\u00b7hr/yr)" text,
"Location (county)" text,
"Year Operational" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Fayette ope... | SELECT MIN("Year Operational") FROM table_73950 WHERE "Location (county)" = 'Fayette' AND "Capacity (MW)" = '46' | 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 fzzmzjzjlb (
HXPLC number,
HZ... | SELECT zzmzjzjlb.ZZYSGH, zzmzjzjlb.QTJZYSGH FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '82258211835' UNION SELECT fzzmzjzjlb.ZZYSGH, fzzmzjzjlb.QTJZYSGH FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '82258211835' | css |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID ... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE swimmer (
name VARCHAR,
id VARCHAR
)
CREATE TABLE record (
swimmer_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of swimmers who has a result of 'win'.
| SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' | sql_create_context |
CREATE TABLE table_name_77 (
race_winners VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the race winners for the date of 23 june?
| SELECT race_winners FROM table_name_77 WHERE date = "23 june" | sql_create_context |
CREATE TABLE Products_in_Events (
Product_in_Event_ID INTEGER,
Event_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Channels (
Channel_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Parties_in_Events (
Party_ID INTEGER,
Event_ID INTEGER,
Role_Code CHAR(15)
)
CREATE TABLE Agreeme... | SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY Product_Name | nvbench |
CREATE TABLE table_204_376 (
id number,
"date" text,
"venue" text,
"opponents" text,
"score" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times has guam been an opponent ?
| SELECT COUNT(*) FROM table_204_376 WHERE "opponents" = 'guam' | squall |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_27532 (
"June 10-11" text,
"March 27-29" text,
"January 15-16" text,
"November 3" text,
"August 21-22" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many solar eclipse during January 15-16 and august 21-22 on august 21, 2017?... | SELECT "January 15-16" FROM table_27532 WHERE "August 21-22" = 'August 21, 2017' | wikisql |
CREATE TABLE table_25438 (
"Administrative Region" text,
"Population (2002 census data)" real,
"Surface km 2" real,
"Main Rivers" text,
"Average annual rainfall (mm)" text,
"Average annual runoff (mm)" text,
"Per capita average annual renewable water resources m 3" real
)
-- Using valid SQ... | SELECT "Average annual rainfall (mm)" FROM table_25438 WHERE "Population (2002 census data)" = '493984' | wikisql |
CREATE TABLE table_57396 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of bronze for Canada and silver is less than 0?
| SELECT SUM("Bronze") FROM table_57396 WHERE "Nation" = 'canada' AND "Silver" < '0' | wikisql |
CREATE TABLE table_name_85 (
cyclist VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the cyclist from Belgium?
| SELECT cyclist FROM table_name_85 WHERE nation = "belgium" | sql_create_context |
CREATE TABLE table_70600 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which round was a player from the Long Island Lizards drafted in first?
| SELECT MAX("Round") FROM table_70600 WHERE "Team" = 'long island lizards' | wikisql |
CREATE TABLE table_train_164 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"fasting_plasma_glucose" int,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- must be between 30 and 60 years of age
| SELECT * FROM table_train_164 WHERE age >= 30 AND age <= 60 | criteria2sql |
CREATE TABLE table_49578 (
"Date" text,
"Place" text,
"Race winners" text,
"GP winner" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the race winners for the date of 23 june?
| SELECT "Race winners" FROM table_49578 WHERE "Date" = '23 june' | wikisql |
CREATE TABLE table_13258823_2 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the record with opponent atlanta falcons
| SELECT record FROM table_13258823_2 WHERE opponent = "Atlanta Falcons" | sql_create_context |
CREATE TABLE table_49884 (
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "Circuit" FROM table_49884 WHERE "Pole position" = 'andré ribeiro' | wikisql |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters ... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'LACS' AND course.number = 456 AND semester.semester = 'WN' AND semester.semester_id = course_off... | advising |
CREATE TABLE table_65477 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the enrollment number for Rockville?
| SELECT COUNT("Enrollment") FROM table_65477 WHERE "Location" = 'rockville' | wikisql |
CREATE TABLE table_47346 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place in Lon Hinkle in?
| SELECT "Place" FROM table_47346 WHERE "Player" = 'lon hinkle' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE d_icd_diagnoses (
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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numb... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY pres... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.