instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_3966 (
"Operator" text,
"Number purchased" real,
"Variant" text,
"Bodybuilder" text,
"Year(s) purchased" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the operator when willowbrook was the bodybuilder?
| SELECT "Operator" FROM table_3966 WHERE "Bodybuilder" = 'Willowbrook' | wikisql |
CREATE TABLE table_67390 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term in office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Hon Paul Keating's Party?
| SELECT "Party" FROM table_67390 WHERE "Member" = 'hon paul keating' | wikisql |
CREATE TABLE table_name_14 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Record of 0-2?
| SELECT date FROM table_name_14 WHERE record = "0-2" | sql_create_context |
CREATE TABLE table_name_98 (
time VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the time of IFL: Championship Final?
| SELECT time FROM table_name_98 WHERE event = "ifl: championship final" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-9756')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.cel... | eicu |
CREATE TABLE table_33776 (
"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_33776 WHERE "Fastest lap" = 'unknown' AND "Date" = 'july 19' | wikisql |
CREATE TABLE table_14598_5 (
s_hindu VARCHAR,
buddhist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many s hindu are where buddhists are 955?
| SELECT s_hindu FROM table_14598_5 WHERE buddhist = "955" | sql_create_context |
CREATE TABLE table_name_98 (
name VARCHAR,
spike VARCHAR,
date_of_birth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Name, when Spike is greater than 343, and when Date of Birth is 02.03.1973?
| SELECT name FROM table_name_98 WHERE spike > 343 AND date_of_birth = "02.03.1973" | sql_create_context |
CREATE TABLE table_name_86 (
format VARCHAR,
region_4 VARCHAR,
_number_episodes VARCHAR,
_number_disc_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the format for the 4 disc season that had less than 22 episodes and n/a for region 4?
| SELECT format FROM table_name_86 WHERE _number_episodes < 22 AND _number_disc_s_ = 4 AND region_4 = "n/a" | sql_create_context |
CREATE TABLE table_204_194 (
id number,
"outcome" text,
"edition" number,
"round" text,
"opponent team" text,
"surface" text,
"opponent" text,
"score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- was the game versus canada later than t... | SELECT (SELECT "edition" FROM table_204_194 WHERE "opponent team" = 'canada') > (SELECT "edition" FROM table_204_194 WHERE "opponent team" = 'belgium') | squall |
CREATE TABLE table_27369069_1 (
soccer_stadium VARCHAR,
province VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the soccer stadium in NL providence?
| SELECT soccer_stadium FROM table_27369069_1 WHERE province = "NL" | sql_create_context |
CREATE TABLE table_55020 (
"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.
-- At the venue Vfl Park, what was the Home team sc... | SELECT "Home team score" FROM table_55020 WHERE "Venue" = 'vfl park' | wikisql |
CREATE TABLE table_name_29 (
rank VARCHAR,
finish VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the rank with finish of 12 and year of 1963
| SELECT rank FROM table_name_29 WHERE finish = "12" AND year = "1963" | sql_create_context |
CREATE TABLE diagnoses (
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 procedures (
... | 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.long_title = "Paroxysmal ventricular tachycardia" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
-- Using valid SQLite, answer the following que... | SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee ORDER BY COUNT(Nominee) DESC | nvbench |
CREATE TABLE table_name_82 (
result VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the result for venue of lord's
| SELECT result FROM table_name_82 WHERE venue = "lord's" | sql_create_context |
CREATE TABLE table_39478 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the $51,914 median h... | SELECT "Per capita income" FROM table_39478 WHERE "Median household income" = '$51,914' | wikisql |
CREATE TABLE table_203_7 (
id number,
"pos." number,
"artist" text,
"single" text,
"year" number,
"sales" number,
"peak" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many singles did celine dion sing ?
| SELECT COUNT("single") FROM table_203_7 WHERE "artist" = 'celine dion' | squall |
CREATE TABLE table_47041 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"Career SR" text,
"Career Win-Loss" text
)
-- Using vali... | SELECT "1994" FROM table_47041 WHERE "1997" = 'qf' AND "1995" = '3r' | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Injury to femoral nerve" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_203_57 (
id number,
"year" number,
"round" text,
"against" text,
"score" text,
"scorers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the most goals scored in a game
| SELECT MAX("score" + "score") FROM table_203_57 | squall |
CREATE TABLE table_name_29 (
goals_against INTEGER,
goal_difference VARCHAR,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least goals for goal difference of 7 and losses more than 13
| SELECT MIN(goals_against) FROM table_name_29 WHERE goal_difference = 7 AND losses > 13 | sql_create_context |
CREATE TABLE table_70924 (
"Opening date" text,
"Closing date" text,
"Performances" real,
"Role" text,
"Theatre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most performances for geoffrey fitton
| SELECT MAX("Performances") FROM table_70924 WHERE "Role" = 'geoffrey fitton' | wikisql |
CREATE TABLE table_24629 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT COUNT("Wins") FROM table_24629 WHERE "Starts" = '30' | wikisql |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zo... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND... | atis |
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.days_stay > "29" AND prescriptions.formulary_drug_cd = "ASA300R" | mimicsql_data |
CREATE TABLE table_33864 (
"Frequency" real,
"Callsign" text,
"Brand" text,
"City of License" text,
"Website" text,
"Webcast" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Webcast has a Callsign of kgbt?
| SELECT "Webcast" FROM table_33864 WHERE "Callsign" = 'kgbt' | wikisql |
CREATE TABLE table_203_407 (
id number,
"name" text,
"party" text,
"province" text,
"term expires" number,
"years in office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who has had the shortest term in office
| SELECT "name" FROM table_203_407 ORDER BY "years in office" - "years in office" LIMIT 1 | squall |
CREATE TABLE table_26663 (
"Episode" real,
"Broadcast Date" real,
"BBC One Presenter(s)" text,
"Starring" text,
"Radio 1 Presenter" text,
"Viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the number of viewers in milli... | SELECT "Viewers (millions)" FROM table_26663 WHERE "Broadcast Date" = '2010' | wikisql |
CREATE TABLE table_51735 (
"Rank" real,
"Constituency" text,
"Winning party 2003" text,
"Swing to gain" real,
"Labour's place 2003" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Winning party of 2003 that has ... | SELECT "Winning party 2003" FROM table_51735 WHERE "Constituency" = 'aberdeen north' | 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 prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Phenylephrine" | mimicsql_data |
CREATE TABLE table_56452 (
"Power Plant" text,
"Producer" text,
"Location" text,
"State" text,
"Total Capacity (MWe)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What company is the producer in the chennai mohan power plant?
| SELECT "Producer" FROM table_56452 WHERE "Power Plant" = 'chennai mohan' | wikisql |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE days (
days_code varchar,
... | SELECT DISTINCT class_of_service.booking_class, fare.fare_id FROM class_of_service, fare, fare_basis, flight, flight_fare WHERE fare_basis.booking_class = class_of_service.booking_class AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = 'US' AND flight... | atis |
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.YQBH, jyjgzbb.YQMC 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.JZLSH_MZJZ... | css |
CREATE TABLE table_11622840_1 (
location VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many locations logged a score of 206 (-7)?
| SELECT COUNT(location) FROM table_11622840_1 WHERE score = "206 (-7)" | sql_create_context |
CREATE TABLE table_203_636 (
id number,
"#" number,
"date" text,
"winner" text,
"score" text,
"location" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which team scored the most points in 2008 ?
| SELECT "winner" FROM table_203_636 WHERE "date" = 2008 | squall |
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,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers... | css |
CREATE TABLE table_203_20 (
id number,
"player" text,
"year" number,
"round" text,
"result" text,
"opponent" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who won the first world darts championship ?
| SELECT "player" FROM table_203_20 WHERE "result" = 'won' ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_name_77 (
samples_failed INTEGER,
product VARCHAR,
samples_taken VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What the most samples failed for and had less than 1 samples taken?
| SELECT MAX(samples_failed) FROM table_name_77 WHERE product = "可淇牌嬰幼兒配方乳粉" AND samples_taken < 1 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Magnesium, Urine" | mimicsql_data |
CREATE TABLE table_name_41 (
candidate VARCHAR,
number_of_votes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the candidate with 73,494 votes?
| SELECT candidate FROM table_name_41 WHERE number_of_votes = "73,494" | sql_create_context |
CREATE TABLE table_64995 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest number of gold medals when there were 0 silver medals?
| SELECT MAX("Gold") FROM table_64995 WHERE "Silver" < '0' | 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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6221358' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 8 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID... | css |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description... | SELECT u.Id AS User_Link, SUM(p.Score) AS Question_score FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 1 GROUP BY u.Id ORDER BY Question_score DESC LIMIT 100 | sede |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
... | SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor ORDER BY Governor DESC | nvbench |
CREATE TABLE table_name_19 (
area_of_operation VARCHAR,
services VARCHAR,
years_of_operation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the area of operation that had drilling during the year 1999?
| SELECT area_of_operation FROM table_name_19 WHERE services = "drilling" AND years_of_operation = "1999" | sql_create_context |
CREATE TABLE table_23142 (
"County" text,
"Starky #" real,
"Starky %" text,
"Hancock #" real,
"Hancock %" text,
"McCain #" real,
"McCain %" text,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times was country considere... | SELECT COUNT("County") FROM table_23142 WHERE "Starky %" = '20.96%' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC | nvbench |
CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
file_size varchar2(20),
duration varchar2(20),
formats varchar2(20)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating nu... | SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages DESC | nvbench |
CREATE TABLE table_9230 (
"Club" text,
"Location" text,
"Manager" text,
"Kit maker" text,
"Shirt sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is nac breda club located?
| SELECT "Location" FROM table_9230 WHERE "Club" = 'nac breda' | wikisql |
CREATE TABLE table_203_54 (
id number,
"selected\nlatin american\ncountries" text,
"internl.\ntourism\narrivals\n2010\n(x 1000)" number,
"internl.\ntourism\nreceipts.\n2010\n(usd\n(x1000)" number,
"average\nreceipt\nper visitor\n2009\n(usd/turista)" number,
"tourist\narrivals\nper\n1000 inhab\n(... | SELECT "selected\nlatin american\ncountries" FROM table_203_54 ORDER BY "tourism\nincome\n%\ngdp\n2003" DESC LIMIT 1 | squall |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_CD = 'S71.176' | css |
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.admission_location = "EMERGENCY ROOM ADMIT" AND prescriptions.formulary_drug_cd = "LATA5OS" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'sodium' O... | eicu |
CREATE TABLE table_6129 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record when the team played at Oakland Seals?
| SELECT "Record" FROM table_6129 WHERE "Home" = 'oakland seals' | wikisql |
CREATE TABLE table_18919 (
"Country" text,
"Currency name" text,
"Month with highest inflation rate" text,
"Highest monthly inflation rate" text,
"Equivalent daily inflation rate" text,
"Time required for prices to double" text
)
-- Using valid SQLite, answer the following questions for the ta... | SELECT COUNT("Equivalent daily inflation rate") FROM table_18919 WHERE "Currency name" = 'Republika Srpska dinar' | wikisql |
CREATE TABLE table_name_29 (
bronze INTEGER,
nation VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many bronze medals did west germany win when they had less than 2 silver medals?
| SELECT SUM(bronze) FROM table_name_29 WHERE nation = "west germany" AND silver < 2 | sql_create_context |
CREATE TABLE affected_region (
region_id VARCHAR,
storm_id VARCHAR
)
CREATE TABLE storm (
Name VARCHAR,
storm_id VARCHAR
)
CREATE TABLE region (
region_id VARCHAR,
Region_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of ... | SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id... | sql_create_context |
CREATE TABLE table_13836704_9 (
freight__metric_tonnes_ INTEGER,
airport VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the maximum freight (metric tonnes) with airport being liverpool
| SELECT MAX(freight__metric_tonnes_) FROM table_13836704_9 WHERE airport = "Liverpool" | sql_create_context |
CREATE TABLE table_name_68 (
away_team VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Away team had an Attendance of 3,395?
| SELECT away_team FROM table_name_68 WHERE attendance = "3,395" | sql_create_context |
CREATE TABLE Aircraft (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many aircrafts do we have?
| SELECT COUNT(*) FROM Aircraft | sql_create_context |
CREATE TABLE table_59607 (
"Pick" real,
"AFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does Mike Dennis play?
| SELECT "Position" FROM table_59607 WHERE "Player" = 'mike dennis' | wikisql |
CREATE TABLE table_42218 (
"Year" real,
"Dates" text,
"Champion" text,
"Country" text,
"Score" text,
"Purse ($)" real,
"Winner's share ($)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score where the country is Japan?
| SELECT "Score" FROM table_42218 WHERE "Country" = 'japan' | wikisql |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT gwyjzb.PERSON_NM, gwyjzb.PERSON_SEX, gwyjzb.PERSON_AGE, gwyjzb.IDENTITY_CARD FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '18019014273' UNION SELECT fgwyjzb.PERSON_NM, fgwyjzb.PERSON_SEX, fgwyjzb.PERSON_AGE, fgwyjzb.IDENTITY_CARD FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '18019014273' | css |
CREATE TABLE table_name_44 (
school VARCHAR,
enrollment VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school has enrollment of 887?
| SELECT school FROM table_name_44 WHERE enrollment = 887 | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SEPSIS" AND demographic.dob_year < "2101" | mimicsql_data |
CREATE TABLE table_9179 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the area when the census ranking is 2,290 of 5,008?
| SELECT "Area km 2" FROM table_9179 WHERE "Census Ranking" = '2,290 of 5,008' | wikisql |
CREATE TABLE table_51576 (
"Nat." text,
"Name" text,
"Since" text,
"Goals" real,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest goal number when the transfer fee was 0.8m?
| SELECT MAX("Goals") FROM table_51576 WHERE "Transfer fee" = '£0.8m' | wikisql |
CREATE TABLE table_16546 (
"Season" real,
"Grand FinalDate" text,
"WinningTeam" text,
"Score" text,
"LosingTeam" text,
"Location" text,
"GF Attendance" real,
"Clive Churchill Medal" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was... | SELECT "LosingTeam" FROM table_16546 WHERE "Season" = '1993' | wikisql |
CREATE TABLE table_72073 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school/club team is Amir Johnson on?
| SELECT "School/Club Team" FROM table_72073 WHERE "Player" = 'Amir Johnson' | wikisql |
CREATE TABLE table_8862 (
"Wrestler" text,
"Reign" real,
"Date" text,
"Days held" text,
"Location" text,
"Event" text,
"Successful defenses" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a date of october 11, 2008?
| SELECT "Wrestler" FROM table_8862 WHERE "Date" = 'october 11, 2008' | wikisql |
CREATE TABLE zyb (
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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '41517594' AND t_kc22.STA_DATE BETWEEN '2004-09-01' AND '2015-06-04' AND t_kc22.SOC_SRT_DIRE_CD = '3992-4' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '... | css |
CREATE TABLE services (
service_id number,
service_type_code text
)
CREATE TABLE participants_in_events (
event_id number,
participant_id number
)
CREATE TABLE events (
event_id number,
service_id number,
event_details text
)
CREATE TABLE participants (
participant_id number,
part... | SELECT COUNT(DISTINCT participant_id) FROM participants_in_events | spider |
CREATE TABLE table_name_70 (
round INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Round, when Record is '19-25-5'?
| SELECT SUM(round) FROM table_name_70 WHERE record = "19-25-5" | sql_create_context |
CREATE TABLE table_57954 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the high lap total for tyrrell - yamaha, and a Time/Retired of + 1 lap?
| SELECT MAX("Laps") FROM table_57954 WHERE "Constructor" = 'tyrrell - yamaha' AND "Time/Retired" = '+ 1 lap' | wikisql |
CREATE TABLE table_66997 (
"Stage (Winner)" text,
"General Classification Yellow Jersey" text,
"Mountains Classification Green Jersey" text,
"Points Classification Navy Blue Jersey" text,
"Intermediate Sprints Classification Red Jersey" text,
"Team Classification" text
)
-- Using valid SQLite,... | SELECT "Intermediate Sprints Classification Red Jersey" FROM table_66997 WHERE "Mountains Classification Green Jersey" = 'murilo antonio fischer' AND "Points Classification Navy Blue Jersey" = 'jose joaquin rojas gil' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73530) AND prescriptions.drug = 'sotalol hcl' AND STRFTIME('%y', prescriptions.startdate) >= '2102' | mimic_iii |
CREATE TABLE table_2241841_1 (
laps VARCHAR,
race_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the race with a winning time of 4:17:18, how many laps were run?
| SELECT laps FROM table_2241841_1 WHERE race_time = "4:17:18" | sql_create_context |
CREATE TABLE table_41582 (
"Name" text,
"Japanese" text,
"Date of designation" text,
"Date of reclassification" text,
"Region" text,
"Prefecture" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHose Name has a Region of kansai on 2012-04-01 ( co... | SELECT "Name" FROM table_41582 WHERE "Region" = 'kansai' AND "Date of reclassification" = '2012-04-01 ( core city )' | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | SELECT meter_300, meter_100 FROM swimmer | nvbench |
CREATE TABLE table_22582663_1 (
forfeited_in_seats INTEGER,
seats_won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where 19 seats were won, what was the minimum number of forfeited seats?
| SELECT MIN(forfeited_in_seats) FROM table_22582663_1 WHERE seats_won = 19 | sql_create_context |
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 * FROM qtb WHERE qtb.MED_SER_ORG_NO = '4350123' AND qtb.IN_HOSP_DATE BETWEEN '2005-07-03' AND '2021-04-26' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '4350123' AND gyb.IN_HOSP_DATE BETWEEN '2005-07-03' AND '2021-04-26' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '4350123' AND zyb.IN_HOSP_DATE BETW... | css |
CREATE TABLE table_6220 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Venue has a Date of 21 june 2000?
| SELECT "Venue" FROM table_6220 WHERE "Date" = '21 june 2000' | wikisql |
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 T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_20021 (
"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 "Ends Lost" FROM table_20021 WHERE "PA" = '67' | wikisql |
CREATE TABLE table_79561 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the tie that had Shrewsbury Town as home team?
| SELECT "Score" FROM table_79561 WHERE "Home team" = 'shrewsbury town' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'potassium chl 40 meq / 1000 ml d5 1/2 ns' | mimic_iii |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number ... | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND c... | advising |
CREATE TABLE Nurse (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
Registered BOOLEAN,
SSN INTEGER
)
CREATE TABLE Affiliated_With (
Physician INTEGER,
Department INTEGER,
PrimaryAffiliation BOOLEAN
)
CREATE TABLE Undergoes (
Patient INTEGER,
Procedures INTEGER,
... | SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC | nvbench |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
R... | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id | nvbench |
CREATE TABLE table_74819 (
"Week" real,
"Date" text,
"Kickoff (ET)" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text,
"NFL Recap" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Kickoff (ET) has a Result of w 34... | SELECT "Kickoff (ET)" FROM table_74819 WHERE "Result" = 'w 34–23' | wikisql |
CREATE TABLE table_46481 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the player from the United states that was +1 to par?
| SELECT "Score" FROM table_46481 WHERE "To par" = '+1' AND "Country" = 'united states' | wikisql |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGE... | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY AVG(Age) DESC | nvbench |
CREATE TABLE table_name_45 (
goals INTEGER,
caps VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the goal top with caps of 38 and an average less than 0.579?
| SELECT MAX(goals) FROM table_name_45 WHERE caps = 38 AND average < 0.579 | sql_create_context |
CREATE TABLE table_name_84 (
opponents VARCHAR,
year VARCHAR,
surface VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was Margaret Court's opponent on clay in 1975?
| SELECT opponents FROM table_name_84 WHERE surface = "clay" AND partner = "margaret court" AND year = 1975 | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
... | SELECT FLOOR(2 * LOG10(Users.Reputation) + 1) / 2, COUNT(*) FROM Posts INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Posts.AcceptedAnswerId IS NULL AND Posts.AnswerCount > 0 GROUP BY FLOOR(2 * LOG10(Users.Reputation) + 1) / 2 ORDER BY FLOOR(2 * LOG10(Users.Reputation) + 1) / 2 | sede |
CREATE TABLE Catalog_Contents_Additional_Attributes (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
attribute_id INTEGER,
attribute_value VARCHAR(255)
)
CREATE TABLE Catalogs (
catalog_id INTEGER,
catalog_name VARCHAR(50),
catalog_publisher VARCHAR(80),
date_of_publication DAT... | SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_number DESC | nvbench |
CREATE TABLE table_61534 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the population of the parish with a census ranking of 579 of 5,008?
| SELECT SUM("Population") FROM table_61534 WHERE "Census Ranking" = '579 of 5,008' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'neurosurgery - drainage of hematoma-burr hole' AND DATETIME(treatment.tre... | eicu |
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 SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-151154')) AND intakeoutput.cellpath LIKE '%i... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.