instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_77662 (
"Rank by average" real,
"Place" real,
"Couple" text,
"Total" real,
"Number of dances" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average place for a couple with the rank by average of 9 ... | SELECT AVG("Place") FROM table_77662 WHERE "Rank by average" = '9' AND "Total" < '83' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21074) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-27 month') ORDER BY labevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_29289372_1 (
area__km²_ VARCHAR,
income_classification VARCHAR,
population__2010_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 318676 is the population of 2010 and 1st class is the income classification what is the area in kilom... | SELECT area__km²_ FROM table_29289372_1 WHERE income_classification = "1st Class" AND population__2010_ = 318676 | sql_create_context |
CREATE TABLE table_10452 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did the home team score 19.15 (129)... | SELECT "Date" FROM table_10452 WHERE "Home team score" = '19.15 (129)' | wikisql |
CREATE TABLE table_40580 (
"Spoofed Title" text,
"Actual Title" text,
"Writer" text,
"Artist" text,
"Issue" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Writer with an Actual Title that is mork & mindy?
| SELECT "Writer" FROM table_40580 WHERE "Actual Title" = 'mork & mindy' | wikisql |
CREATE TABLE table_20423 (
"Issuing network" text,
"IIN ranges" text,
"Active" text,
"Length" text,
"Validation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many validations are listed for the iin range 36?
| SELECT COUNT("Validation") FROM table_20423 WHERE "IIN ranges" = '36' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA... | atis |
CREATE TABLE table_204_822 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many bronze medals were won by the nation with the fewest gol... | SELECT "bronze" FROM table_204_822 ORDER BY "gold" LIMIT 1 | squall |
CREATE TABLE table_36962 (
"Team" text,
"Location" text,
"Venue" text,
"Capacity" real,
"Position in 2004" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue was number 9 for 2004?
| SELECT "Venue" FROM table_36962 WHERE "Position in 2004" = '9' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | SELECT COUNT(*) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '张梦竹' AND wdmzjzjlb.JZKSRQ BETWEEN '2006-07-05' AND '2011-05-15' AND wdmzjzjlb.YLJGDM = '9146029' UNI... | css |
CREATE TABLE table_name_11 (
format VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which format has january 21, 2002 as the date?
| SELECT format FROM table_name_11 WHERE date = "january 21, 2002" | sql_create_context |
CREATE TABLE table_37120 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what game had a score of 86-71
| SELECT "Attendance" FROM table_37120 WHERE "Record" = '86-71' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.YLJGDM = '6451963' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 15 UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = ... | css |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '郎永逸' AND t_kc21.MED_SER_ORG_NO = '7422800') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1 | css |
CREATE TABLE table_47841 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text... | SELECT "2000" FROM table_47841 WHERE "2012" = '4r' | wikisql |
CREATE TABLE table_name_51 (
rating INTEGER,
night_rank VARCHAR,
timeslot_rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rating for the episode with the night rank of 11 and timeslot rank is larger than 4?
| SELECT AVG(rating) FROM table_name_51 WHERE night_rank = "11" AND timeslot_rank > 4 | 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 WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.days_stay > "15" | mimicsql_data |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Co... | SELECT Calendar_Date, Day_Number FROM Ref_Calendar ORDER BY Calendar_Date | nvbench |
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
)
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Select... | SELECT name FROM products | spider |
CREATE TABLE table_52422 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many win total which has the rank smaller than 3 and events smaller than 22
| SELECT COUNT("Wins") FROM table_52422 WHERE "Events" < '22' AND "Rank" < '3' | wikisql |
CREATE TABLE table_train_173 (
"id" int,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"hepatitis_c" bool,
"hepatitis_b" bool,
"cirrhosis" bool,
"renal_disease" bool,
"hepatic_disease" bool,
"allergy_to_egg" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"NOUSE"... | SELECT * FROM table_train_173 WHERE hepatic_disease = 1 OR cirrhosis = 1 | criteria2sql |
CREATE TABLE table_25691838_11 (
introductory_phrase VARCHAR,
episode__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the introductory phrase for episode 794?
| SELECT introductory_phrase FROM table_25691838_11 WHERE episode__number = 794 | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | 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 = '010-11305')) AND intakeoutput.celllabel = 'co' A... | eicu |
CREATE TABLE table_1745843_6 (
part_3 VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the part 3 of the verb whose class is 4?
| SELECT part_3 FROM table_1745843_6 WHERE class = "4" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
... | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '011-53628' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE table_name_12 (
network VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which network broadcasted the cup after 2011?
| SELECT network FROM table_name_12 WHERE year > 2011 | sql_create_context |
CREATE TABLE table_name_81 (
english_translation VARCHAR,
season_in_sanskrit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the english translation of the sanskrit word varsha?
| SELECT english_translation FROM table_name_81 WHERE season_in_sanskrit = "varsha" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, SUM(Price) FROM Products GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_204_361 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the first away team on the chart
| SELECT "away team" FROM table_204_361 WHERE id = 1 | squall |
CREATE TABLE table_261951_1 (
pop_density__per_km²_ VARCHAR,
municipality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the population density per kilometer for the city of calintaan?
| SELECT pop_density__per_km²_ FROM table_261951_1 WHERE municipality = "Calintaan" | sql_create_context |
CREATE TABLE table_2575 (
"Sigma level" real,
"Sigma (with 1.5\u03c3 shift)" text,
"DPMO" text,
"Percent defective" text,
"Percentage yield" text,
"Short-term C pk" text,
"Long-term C pk" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When s... | SELECT "Percent defective" FROM table_2575 WHERE "Sigma (with 1.5\u03c3 shift)" = '2.5' | wikisql |
CREATE TABLE table_11274401_3 (
timeslot VARCHAR,
air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the timeslot for the episode that aired on May 12, 2009?
| SELECT timeslot FROM table_11274401_3 WHERE air_date = "May 12, 2009" | sql_create_context |
CREATE TABLE table_15994 (
"Case/Suffix" text,
"we two" text,
"you and I" text,
"you two" text,
"them two (the two)" text,
"who-two" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is who-two when you two is ngipelngu?
| SELECT "who-two" FROM table_15994 WHERE "you two" = 'ngipelngu' | wikisql |
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 hz_info.person_info_XM FROM hz_info JOIN zyjzjlb JOIN jybgb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '44927016411' | css |
CREATE TABLE table_name_38 (
high_assists VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is High Assists, when Team is 'Oklahoma City'?
| SELECT high_assists FROM table_name_38 WHERE team = "oklahoma city" | sql_create_context |
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 MZZYZDZZBM, MZZYZDZZMC FROM mzjzjlb WHERE JZLSH = '35311934275' | css |
CREATE TABLE table_72534 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of field goals for 19 extra points... | SELECT COUNT("Field goals") FROM table_72534 WHERE "Extra points" = '19' | wikisql |
CREATE TABLE table_16922 (
"Year" real,
"Property Taxes" text,
"Investment Earnings" text,
"Other Local Sources" text,
"State & Federal" text,
"Total Revenue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of local sources for... | SELECT "Other Local Sources" FROM table_16922 WHERE "State & Federal" = '12,929,489' | wikisql |
CREATE TABLE table_name_56 (
sign_in_bicker VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Sign-in/Bicker is at of wash50 on washington rd?
| SELECT sign_in_bicker FROM table_name_56 WHERE location = "wash50 on washington rd" | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
... | 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, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. LOUIS' AND CITY_2.... | atis |
CREATE TABLE table_name_35 (
mountain_range VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which mountain range has a rank of 19?
| SELECT mountain_range FROM table_name_35 WHERE rank = 19 | sql_create_context |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.departure_time = 400 AND flight.to_airport = AIRPORT_SERVICE_1.airport... | atis |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 50286) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
CREATE TABLE wdmzjzjlb (
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 jybgb.SHSJ FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '65243829' AND jybgb.BGRQ BETWEEN '2018-07-03' AND '2020-... | css |
CREATE TABLE table_name_47 (
total_attempts INTEGER,
percentage VARCHAR,
service_aces VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When there is less than 13 services aces with a percentage greater than 0.34900000000000003, what is the smallest total a... | SELECT MIN(total_attempts) FROM table_name_47 WHERE percentage > 0.34900000000000003 AND service_aces < 13 | sql_create_context |
CREATE TABLE table_73987 (
"Name" text,
"Park" text,
"Length (ft)" real,
"Height (ft)" real,
"Speed (mph)" text,
"Opened" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long is the rollar coaster on Kemah Boardwalk
| SELECT "Length (ft)" FROM table_73987 WHERE "Park" = 'Kemah Boardwalk' | wikisql |
CREATE TABLE table_42041 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the set 1 for the date jun 26, and a set 2 of 25-1... | SELECT "Set 1" FROM table_42041 WHERE "Date" = 'jun 26' AND "Set 2" = '25-16' | wikisql |
CREATE TABLE table_name_79 (
australian VARCHAR,
examples VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the entry for the Australian sound that has an example of illyria, cf. cirrhosis?
| SELECT australian FROM table_name_79 WHERE examples = "illyria, cf. cirrhosis" | sql_create_context |
CREATE TABLE table_72096 (
"Year" real,
"Division" text,
"League" text,
"Regular Season" text,
"Playoffs" text,
"U.S. Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the u.s. open cup status for regular season of 4th, atlantic di... | SELECT "U.S. Open Cup" FROM table_72096 WHERE "Regular Season" = '4th, Atlantic Division' | wikisql |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE author (
authorid int... | SELECT DISTINCT paper.title FROM author, paper, writes WHERE author.authorname = 'Donald E Knuth' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
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 prescriptions.route = "IH" | mimicsql_data |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
applica... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... | atis |
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 ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC | nvbench |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Users (
Id number,
Reputation number,... | SELECT Body AS bodyWithJava, Tags AS tagsWithJava FROM Posts AS postsWithJava INNER JOIN (SELECT PostId AS PostIDofJava FROM PostTags AS postTags WHERE PostTags.TagId = (SELECT Id AS TagIDofJava FROM Tags AS TagData WHERE TagName = 'java')) AS PostTagsJava ON postsWithJava.Id = PostTagsJava.PostIDofJava LIMIT 5000 | sede |
CREATE TABLE table_58150 (
"Name" text,
"Founded" real,
"Institution" text,
"Location" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status of the institution that was founded in 1996?
| SELECT "Status" FROM table_58150 WHERE "Founded" = '1996' | wikisql |
CREATE TABLE table_33158 (
"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.
-- Where did Richmond play as an away team?
| SELECT "Venue" FROM table_33158 WHERE "Away team" = 'richmond' | wikisql |
CREATE TABLE table_203_598 (
id number,
"date" text,
"time" text,
"opponent" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games did the bulldogs win ?
| SELECT COUNT(*) FROM table_203_598 WHERE "result" = 'w' | squall |
CREATE TABLE table_name_78 (
lost INTEGER,
team VARCHAR,
drawn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average Lost entry for Newton, for games with a drawn less than 5?
| SELECT AVG(lost) FROM table_name_78 WHERE team = "newton" AND drawn < 5 | sql_create_context |
CREATE TABLE table_name_16 (
builder VARCHAR,
pennant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the building for the r90 pennant?
| SELECT builder FROM table_name_16 WHERE pennant = "r90" | sql_create_context |
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREAT... | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid | nvbench |
CREATE TABLE table_21291 (
"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.
-- Name t... | SELECT "High assists" FROM table_21291 WHERE "Score" = 'L 98–118 (OT)' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId ... | SELECT Id AS "comment_link", Text, UserId AS "user_link", CreationDate FROM Comments WHERE Text LIKE '%##Word?possible ##%' ORDER BY CreationDate DESC LIMIT 100 | sede |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ethanol')) | mimic_iii |
CREATE TABLE table_203_314 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many gold medals did italy , belgium and ireland have altoget... | SELECT SUM("gold") FROM table_203_314 WHERE "nation" IN ('italy', 'belgium', 'ireland') | squall |
CREATE TABLE table_name_55 (
country VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country had a winner in 1907?
| SELECT country FROM table_name_55 WHERE year = 1907 | sql_create_context |
CREATE TABLE table_21683 (
"School" text,
"Years of Participation" text,
"OCC Championships" real,
"Last OCC Championship" text,
"Last Outright OCC Championship" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the years of participation for ... | SELECT "Years of Participation" FROM table_21683 WHERE "School" = 'Central Crossing' | wikisql |
CREATE TABLE table_58588 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time did Carroll Shelby have in Grid 14?
| SELECT "Time/Retired" FROM table_58588 WHERE "Grid" < '14' AND "Driver" = 'carroll shelby' | 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 OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '47306460' AND IN_HOSP_DATE BETWEEN '2016-09-22' AND '2019-02-24' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | nvbench |
CREATE TABLE table_1341897_42 (
first_elected INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year that a candidate was first elected?
| SELECT MIN(first_elected) FROM table_1341897_42 | sql_create_context |
CREATE TABLE table_name_9 (
streak VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Streak has a Record of 21 22?
| SELECT streak FROM table_name_9 WHERE record = "21–22" | sql_create_context |
CREATE TABLE table_name_55 (
round INTEGER,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest round for the pick from Finland?
| SELECT MAX(round) FROM table_name_55 WHERE nationality = "finland" | sql_create_context |
CREATE TABLE table_name_3 (
entrant VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the entrant in 1971?
| SELECT entrant FROM table_name_3 WHERE year = 1971 | sql_create_context |
CREATE TABLE table_63725 (
"Date" text,
"Show" text,
"Venue" text,
"City" text,
"Tickets sold / available" text,
"Gross revenue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has a venue of the Arco Arena?
| SELECT "City" FROM table_63725 WHERE "Venue" = 'arco arena' | wikisql |
CREATE TABLE table_38186 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what game was on may 29
| SELECT "Result" FROM table_38186 WHERE "Date" = 'may 29' | wikisql |
CREATE TABLE table_69614 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country of Craig Stadler?
| SELECT "Country" FROM table_69614 WHERE "Player" = 'craig stadler' | wikisql |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS... | SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "70" AND prescriptions.route = "INHALATION" | mimicsql_data |
CREATE TABLE table_65869 (
"Campus" text,
"Executive Director" text,
"Founded" real,
"Type" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the Balayan, Batangas campus founded?
| SELECT "Founded" FROM table_65869 WHERE "Location" = 'balayan, batangas' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREA... | 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 = '017-20711')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | 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 = 'nasogastric tube - insertion' AND DATETIME(treatment.treatmenttime, 'star... | eicu |
CREATE TABLE table_204_337 (
id number,
"festival" text,
"year" number,
"award" text,
"nominee" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times have they won an award ?
| SELECT COUNT(*) FROM table_204_337 WHERE "result" = 'won' | squall |
CREATE TABLE table_name_30 (
game INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the average game when record was 16-63?
| SELECT AVG(game) FROM table_name_30 WHERE record = "16-63" | sql_create_context |
CREATE TABLE table_name_64 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score on April 5?
| SELECT score FROM table_name_64 WHERE date = "april 5" | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "8857" | mimicsql_data |
CREATE TABLE table_22643 (
"HR no." text,
"HR name" text,
"CR no." real,
"LMS no." real,
"Built" text,
"Works" text,
"Withdrawn" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When (river garry) is the hr name how many builts are there?
| SELECT COUNT("Built") FROM table_22643 WHERE "HR name" = '(River Garry)' | wikisql |
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | SELECT COUNT(DISTINCT bedtype) FROM rooms | spider |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT Id AS "comment_link", Text, Score FROM Comments WHERE UserId = @UserId AND Score >= @Score ORDER BY Score DESC | sede |
CREATE TABLE table_name_68 (
manufacturer VARCHAR,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the manufacturer for Henk Vd Lagemaat?
| SELECT manufacturer FROM table_name_68 WHERE rider = "henk vd lagemaat" | sql_create_context |
CREATE TABLE table_21245 (
"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.
-- Who ha... | SELECT "High rebounds" FROM table_21245 WHERE "High points" = 'Kevin Love (20)' | wikisql |
CREATE TABLE table_name_77 (
height_m__ft_ VARCHAR,
rank VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the height for rank greater than 10 in Tameer Tower?
| SELECT height_m__ft_ FROM table_name_77 WHERE rank > 10 AND name = "tameer tower" | sql_create_context |
CREATE TABLE school (
School_name VARCHAR,
school_id VARCHAR
)
CREATE TABLE endowment (
school_id VARCHAR,
amount INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of schools that have more than one donator with donation amount above 8.5... | SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING COUNT(*) > 1 | sql_create_context |
CREATE TABLE table_79433 (
"Rank" real,
"Attendance" real,
"Opponent" text,
"Result" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the rank for February 11, 2012 with less than 18,735 in attendance?
| SELECT AVG("Rank") FROM table_79433 WHERE "Date" = 'february 11, 2012' AND "Attendance" < '18,735' | wikisql |
CREATE TABLE table_27075510_1 (
original_artist VARCHAR,
week__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is the week # is audition?
| SELECT COUNT(original_artist) FROM table_27075510_1 WHERE week__number = "Audition" | sql_create_context |
CREATE TABLE table_52514 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the opponent when the week was 9?
| SELECT "Opponent" FROM table_52514 WHERE "Week" = '9' | wikisql |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Acetaminophen" | mimicsql_data |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
-- Using valid SQLite, answer the following questions ... | SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY COUNT(Country) DESC | nvbench |
CREATE TABLE table_18602462_21 (
final__bronze_medal_match VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When mixed quad singles is the event what is the final/bronze medal match?
| SELECT final__bronze_medal_match FROM table_18602462_21 WHERE event = "Mixed Quad Singles" | sql_create_context |
CREATE TABLE table_39537 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" real,
"2nd (m)" real,
"Points" real,
"Overall WC points (Rank)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points is the highest one that has a Nati... | SELECT MAX("Points") FROM table_39537 WHERE "Nationality" = 'aut' AND "Name" = 'thomas morgenstern' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 94316 AND STRFTIME('%y', admissions.admittime) = '2103' | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.