context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_19585 (
"Number of episode" real,
"Number of season" real,
"Title (original)" text,
"Title (English)" text,
"Original air date" text
) | What is the English title when the original title is Die Qual Der Wahl? | SELECT "Title (English)" FROM table_19585 WHERE "Title (original)" = 'Die Qual der Wahl' | wikisql |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title... | data sets for textual entailment | SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'textual entailment' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid | scholar |
CREATE TABLE table_name_38 (
pick INTEGER,
player VARCHAR,
nationality VARCHAR,
year VARCHAR
) | What was the pic for Canada for player Yvon Bouillon earlier than 1974? | SELECT AVG(pick) FROM table_name_38 WHERE nationality = "canada" AND year < 1974 AND player = "yvon bouillon" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
chart... | has any microbiology test been performed on patient 76637 until 02/2102? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76637) AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2102-02' | mimic_iii |
CREATE TABLE table_29927 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the team when the high assists was stephen curry (7) and the high points was monta ellis (27)? | SELECT "Team" FROM table_29927 WHERE "High assists" = 'Stephen Curry (7)' AND "High points" = 'Monta Ellis (27)' | wikisql |
CREATE TABLE procedures (
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
)
... | provide the number of patients whose death status is 0 and procedure icd9 code is 3897? | 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.icd9_code = "3897" | mimicsql_data |
CREATE TABLE table_29329 (
"Greek national account" text,
"1970" text,
"1980" text,
"1990" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001 1" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
... | What is 2002 when 2009 is 54.0? | SELECT "2002" FROM table_29329 WHERE "2009" = '54.0' | wikisql |
CREATE TABLE Staff (
staff_id VARCHAR,
first_name VARCHAR
)
CREATE TABLE Lessons (
staff_id VARCHAR
) | How many lessons taught by staff whose first name has letter 'a' in it? | SELECT COUNT(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%" | sql_create_context |
CREATE TABLE list (
firstname VARCHAR,
classroom VARCHAR
) | Find the first names of students studying in room 108. | SELECT firstname FROM list WHERE classroom = 108 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | provide the number of patients whose diagnoses short title is routine circumcision and drug route is ng. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Routine circumcision" AND prescriptions.route = "NG" | mimicsql_data |
CREATE TABLE table_name_78 (
international INTEGER,
domestic VARCHAR,
year VARCHAR
) | What is the number for the international with 669 domestic earlier than 2005? | SELECT AVG(international) FROM table_name_78 WHERE domestic = 669 AND year < 2005 | sql_create_context |
CREATE TABLE table_name_65 (
score VARCHAR,
date VARCHAR
) | What was the score of the match on April 23, 2007? | SELECT score FROM table_name_65 WHERE date = "april 23, 2007" | sql_create_context |
CREATE TABLE table_66749 (
"Season" text,
"Champion" text,
"Runner Up" text,
"Israel Bowl" text,
"Venue" text,
"Date" text,
"Finals MVP" text
) | Name the venue for march 28, 2008 | SELECT "Venue" FROM table_66749 WHERE "Date" = 'march 28, 2008' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is the number of patients whose language is span and year of birth is less than 2052? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.dob_year < "2052" | mimicsql_data |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
H... | 从04年9月12日至2008年2月3日之内患者55507351被开出的所有药品的编码、名称、数量、单价、金额分别是多些啊? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 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 = '55507351' AND t_kc21.IN_HOSP_DATE BETWEEN... | css |
CREATE TABLE table_36423 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text,
"Record" text
) | What was the record the day David Weathers (15) had a save? | SELECT "Record" FROM table_36423 WHERE "Save" = 'david weathers (15)' | wikisql |
CREATE TABLE table_name_51 (
bronze INTEGER,
gold VARCHAR,
total VARCHAR,
rank VARCHAR
) | What is the fewest number of bronze medals won among the nations ranked 12 that won no gold medals and 1 medal overall? | SELECT MIN(bronze) FROM table_name_51 WHERE total = 1 AND rank = "12" AND gold < 1 | sql_create_context |
CREATE TABLE table_41314 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What is the sum of Week when there were 67,968 people in attendance? | SELECT SUM("Week") FROM table_41314 WHERE "Attendance" = '67,968' | wikisql |
CREATE TABLE table_24574438_1 (
area__km_2__ INTEGER
) | Name the least area | SELECT MIN(area__km_2__) FROM table_24574438_1 | sql_create_context |
CREATE TABLE table_34661 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What are the highest laps Kazuki Nakajima did with a Grid larger than 19? | SELECT MAX("Laps") FROM table_34661 WHERE "Driver" = 'kazuki nakajima' AND "Grid" > '19' | wikisql |
CREATE TABLE table_name_66 (
laps INTEGER,
driver VARCHAR,
grid VARCHAR
) | What is the high lap total for mika salo with a grid greater than 17? | SELECT MAX(laps) FROM table_name_66 WHERE driver = "mika salo" AND grid > 17 | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
Acc... | Users in Valencia sorted by reputation. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%valencia%' OR UPPER(Location) LIKE '%VLC' ORDER BY Reputation DESC | sede |
CREATE TABLE table_50344 (
"Callsign" text,
"Area served" text,
"Band" text,
"Freq currently" text,
"Purpose" text
) | What is the Community Band with a 4BCB Callsign? | SELECT "Band" FROM table_50344 WHERE "Purpose" = 'community' AND "Callsign" = '4bcb' | wikisql |
CREATE TABLE table_1341690_20 (
party VARCHAR,
incumbent VARCHAR
) | How many instances are there of party in the situation where Robert Bauman is the incumbent politician? | SELECT COUNT(party) FROM table_1341690_20 WHERE incumbent = "Robert Bauman" | sql_create_context |
CREATE TABLE table_11717 (
"Version" text,
"Year" text,
"Bore x stroke" text,
"Displacement" text,
"Power" text
) | Tell me the displacement for 1935-45 | SELECT "Displacement" FROM table_11717 WHERE "Year" = '1935-45' | wikisql |
CREATE TABLE table_name_16 (
overall VARCHAR,
pick__number INTEGER
) | What is the Overall of the pick less than 20? | SELECT overall FROM table_name_16 WHERE pick__number < 20 | sql_create_context |
CREATE TABLE table_dev_56 (
"id" int,
"anemia" bool,
"gender" string,
"white_blood_cell_count_wbc" int,
"hemoglobinopathy" bool,
"major_hematological_conditions" bool,
"laboratory_abnormality" bool,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"hematocrit_hct" float,
"... | patients of either sex 18 _ 85 years of age | SELECT * FROM table_dev_56 WHERE age >= 18 AND age <= 85 | criteria2sql |
CREATE TABLE table_35622 (
"Season" real,
"Team" text,
"Wins" real,
"Losses" real,
"Draws" real
) | What is the average number of wins before the season in 1906 where there were 0 draws? | SELECT AVG("Wins") FROM table_35622 WHERE "Season" < '1906' AND "Draws" < '0' | wikisql |
CREATE TABLE table_dev_7 (
"id" int,
"active_infection" bool,
"macroalbuminuria" bool,
"hemoglobin_a1c_hba1c" float,
"hepatitis_b" bool,
"fasting_blood_glucose_fbg" float,
"creatinine_clearance_cl" float,
"triglyceride_tg" float,
"NOUSE" float
) | presence or history of active infection including hepatitis b | SELECT * FROM table_dev_7 WHERE active_infection = 1 OR hepatitis_b = 1 | criteria2sql |
CREATE TABLE table_train_124 (
"id" int,
"loss_of_consciousness" bool,
"serum_glucose" bool,
"myelosuppression" bool,
"retinoids_hepatotoxic" bool,
"pulmonary_disease" bool,
"etiology" bool,
"abnormal_thyroid_function" bool,
"laboratory_abnormality" bool,
"chest_pain" bool,
"... | patients with vitamin b12 deficiency, abnormal thyroid function, or personal history of either any clinically defined medical disorder or any clinically defined neurological / psychiatric disorder ( other than ad ) , including ( but not limited to ) :, stroke, brain lesions, , cerebrovascular condition, other neurodege... | SELECT * FROM table_train_124 WHERE vitamin_b12_deficiency = 1 OR abnormal_thyroid_function = 1 OR medical_disorder = 1 OR neurological_disease = 1 OR psychiatric_disease = 1 AND ad = 0 OR (stroke = 1 OR brain_lesions = 1 OR cerebrovascular_disease = 1 OR neurodegenerative_disease = 1 OR (head_injury = 1 OR loss_of_con... | criteria2sql |
CREATE TABLE table_71684 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What is the to par for the player who had a score of 70-72-70-69=281? | SELECT "To par" FROM table_71684 WHERE "Score" = '70-72-70-69=281' | wikisql |
CREATE TABLE table_15848 (
"Order Year" text,
"Manufacturer" text,
"Model" text,
"Fleet Series (Quantity)" text,
"Powertrain (Engine/Transmission)" text,
"Fuel Propulsion" text
) | how many times is the model ge40lfr? | SELECT COUNT("Manufacturer") FROM table_15848 WHERE "Model" = 'GE40LFR' | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_... | list the flights from PHILADELPHIA to SAN FRANCISCO via DALLAS | 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 = 'SAN FRANCISCO' AND CIT... | atis |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TAB... | find a flight from LONG BEACH to ST. LOUIS stopping in DALLAS | 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_44406 (
"Date" text,
"Opponent#" text,
"Site" text,
"Result" text,
"Attendance" text
) | What result did Indiana have when they were an opponent? | SELECT "Result" FROM table_44406 WHERE "Opponent#" = 'indiana' | wikisql |
CREATE TABLE table_name_28 (
year INTEGER,
rank INTEGER
) | What is the lowest Year, when Rank is greater than 85? | SELECT MIN(year) FROM table_name_28 WHERE rank > 85 | sql_create_context |
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_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)... | when did patient 6215 during their last hospital encounter have the maximum asparate aminotransferase (ast) for the last time? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6215 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = '... | mimic_iii |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many patients whose death status is 1 and diagnoses icd9 code is 5733? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "5733" | mimicsql_data |
CREATE TABLE table_name_41 (
song VARCHAR,
place INTEGER
) | What song placed higher than#4? | SELECT song FROM table_name_41 WHERE place > 4 | sql_create_context |
CREATE TABLE table_name_95 (
game VARCHAR,
location VARCHAR,
time VARCHAR
) | how many games have a location of memorial stadium and a time of 2:27? | SELECT COUNT(game) FROM table_name_95 WHERE location = "memorial stadium" AND time = "2:27" | sql_create_context |
CREATE TABLE table_65848 (
"Date Released" text,
"Institute" text,
"Social Democratic" text,
"Socialist" text,
"Green-Communist" text,
"Democratic Renewal" text,
"Democratic and Social Centre" text,
"Lead" text
) | What Social Democratic has a Democratic and Social Centre of 10.0% 22 seats? | SELECT "Social Democratic" FROM table_65848 WHERE "Democratic and Social Centre" = '10.0% 22 seats' | wikisql |
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... | give me the number of patients whose admission type is emergency and drug name is abacavir sulfate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Abacavir Sulfate" | mimicsql_data |
CREATE TABLE table_75088 (
"Rank" text,
"Stadium" text,
"Capacity" real,
"City" text,
"Country" text,
"Tournament hosted" text
) | What is the average capacity that has rod laver arena as the stadium? | SELECT AVG("Capacity") FROM table_75088 WHERE "Stadium" = 'rod laver arena' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAno... | Questions with [tag] closed as duplicate. | SELECT YEAR(ClosedDate) AS "year", COUNT(*) AS "questions" FROM Posts LEFT JOIN PostHistory AS PH ON PH.PostId = Posts.Id WHERE STR_POSITION(Tags, @tag) > 0 AND PostTypeId = 1 AND NOT ClosedDate IS NULL AND Comment = '101' GROUP BY YEAR(ClosedDate) | sede |
CREATE TABLE table_42273 (
"Position" text,
"Jersey #" real,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"1999\u20132000 Team" text,
"NHL Rights" text
) | What is the lightest Weight (kg), when the Jersey # is greater than 22, when the Position is F, and when the Birthdate is March 19, 1980? | SELECT MIN("Weight (kg)") FROM table_42273 WHERE "Jersey #" > '22' AND "Position" = 'f' AND "Birthdate" = 'march 19, 1980' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | Users with more than 3k characters in About Me. | SELECT Id AS "user_link", LENGTH(AboutMe) AS "Length of About Me", AboutMe FROM Users WHERE LENGTH(AboutMe) > 3000 ORDER BY LENGTH(AboutMe) DESC | sede |
CREATE TABLE table_12302 (
"Year" real,
"Award Ceremony" text,
"Category" text,
"Nominee" text,
"Result" text
) | What are the years that had someone nominated for best supporting actress? | SELECT COUNT("Year") FROM table_12302 WHERE "Result" = 'nominated' AND "Category" = 'best supporting actress' | wikisql |
CREATE TABLE table_54165 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | Tell me the number for height in ft of 6-7 | SELECT "No.(s)" FROM table_54165 WHERE "Height in Ft." = '6-7' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year 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,
... | Show me about the distribution of meter_200 and the sum of meter_100 , and group by attribute meter_200 in a bar chart. | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 | nvbench |
CREATE TABLE table_23281862_9 (
high_rebounds VARCHAR,
game VARCHAR
) | Who is the high rebounds for game 64? | SELECT high_rebounds FROM table_23281862_9 WHERE game = 64 | sql_create_context |
CREATE TABLE table_52861 (
"Rank" text,
"Name" text,
"Height ft (m)" text,
"Floors" real,
"Year" real
) | After 1971, what is the Rank with a Height ft (m) of 19.0 477 (145) and less than 35 Floors? | SELECT "Rank" FROM table_52861 WHERE "Year" > '1971' AND "Floors" < '35' AND "Height ft (m)" = '19.0 477 (145)' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | has patient 72198 received any lab test until 06/2105. | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72198) AND STRFTIME('%y-%m', labevents.charttime) <= '2105-06' | mimic_iii |
CREATE TABLE table_name_49 (
silver INTEGER,
total VARCHAR,
rank VARCHAR
) | How many silver medals were won with a total medal of 3 and a rank above 9? | SELECT AVG(silver) FROM table_name_49 WHERE total < 3 AND rank > 9 | sql_create_context |
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 cost (
costid number,
... | on 12/26/this year, what was first value of sao2 for patient 006-47576? | SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47576')) AND NOT vitalperiodic.sao2 IS NULL AND DATETIME(v... | eicu |
CREATE TABLE table_train_124 (
"id" int,
"loss_of_consciousness" bool,
"serum_glucose" bool,
"myelosuppression" bool,
"retinoids_hepatotoxic" bool,
"pulmonary_disease" bool,
"etiology" bool,
"abnormal_thyroid_function" bool,
"laboratory_abnormality" bool,
"chest_pain" bool,
"... | presence of any unstable cardiovascular disease, uncontrolled diabetes, chronic inflammatory or infectious conditions. retinoids have been associated with chest pain of unclear etiology, increased serum glucose, myelosuppression and increased risk of infection. | SELECT * FROM table_train_124 WHERE cardiovascular_disease = 1 OR diabetes = 1 OR chronic_inflammatory = 1 OR active_infection = 1 OR (retinoids = 1 AND chest_pain = 1 AND etiology = 1 OR serum_glucose = 1 OR myelosuppression = 1 OR active_infection = 1) | criteria2sql |
CREATE TABLE table_name_61 (
status VARCHAR,
name VARCHAR
) | What shows as the status for the name of de la red? | SELECT status FROM table_name_61 WHERE name = "de la red" | sql_create_context |
CREATE TABLE table_48691 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | In what place did the player with a score of 66-67=133 come in? | SELECT "Place" FROM table_48691 WHERE "Score" = '66-67=133' | wikisql |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_... | what are the AA flights from NEWARK to NASHVILLE | 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 = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW... | atis |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptroller text,
attorney_general text,
us_senate text
)
CREATE TABLE el... | Sort the names of all counties in descending alphabetical order. | SELECT county_name FROM county ORDER BY county_name DESC | spider |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is gender and lab test category of subject id 2560? | SELECT demographic.gender, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_56634 (
"Series" real,
"Year" text,
"Winner" text,
"Runner-up" text,
"Third place" text,
"Fourth place" text,
"Fifth place" text,
"Sixth place" text,
"Host" text
) | Who was sixth place when Hugo Salazar was fifth place? | SELECT "Sixth place" FROM table_56634 WHERE "Fifth place" = 'hugo salazar' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
... | when patient 97733 was prescribed for the last time polyethylene glycol in this hospital visit? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97733 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'polyethylene glycol' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_53580 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On what date did the game at Windy Hill take place? | SELECT "Date" FROM table_53580 WHERE "Venue" = 'windy hill' | wikisql |
CREATE TABLE table_name_72 (
completions VARCHAR,
team VARCHAR,
yards VARCHAR
) | What were the number of completions for James Vanderberg on Iowa when his yards were 45? | SELECT completions FROM table_name_72 WHERE team = "iowa" AND yards = "45" | sql_create_context |
CREATE TABLE table_76512 (
"Finished" text,
"Horse" text,
"Jockey" text,
"Trainer" text,
"Odds" text
) | Who is the Jockey for guadalcanal? | SELECT "Jockey" FROM table_76512 WHERE "Horse" = 'guadalcanal' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | provide the number of patients whose days of hospital stay is greater than 16 and drug name is prismasate (b32 k2)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "16" AND prescriptions.drug = "Prismasate (B32 K2)" | mimicsql_data |
CREATE TABLE table_203_521 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
) | how many times did this team lose in the conference finals ? | SELECT COUNT(*) FROM table_203_521 WHERE "playoffs" = 'conference finals' | squall |
CREATE TABLE table_12095519_1 (
train_name VARCHAR,
train_no VARCHAR
) | What's the name of train number 15647/48? | SELECT train_name FROM table_12095519_1 WHERE train_no = "15647/48" | sql_create_context |
CREATE TABLE table_13564637_5 (
tries_against VARCHAR,
points_against VARCHAR
) | What are the tries against when points against 287? | SELECT tries_against FROM table_13564637_5 WHERE points_against = "287" | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId nu... | TOP 100 - Brazilian Users. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%brazil%' OR UPPER(Location) LIKE '%BRA' ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_name_88 (
team VARCHAR,
round VARCHAR,
pick VARCHAR
) | Which team has Pick 13 in Round 2? | SELECT team FROM table_name_88 WHERE round = "2" AND pick = "13" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid nu... | what is the minimum total cost for the hospital involving a procedure called insulin this year? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'insulin')) AND DATETIME(cost.chargetime, 'st... | eicu |
CREATE TABLE table_42585 (
"Ship size" text,
"Cargo" text,
"2004" text,
"2005" text,
"2006" text
) | What was the cargo value in 2005 for all product carriers? | SELECT "2005" FROM table_42585 WHERE "Cargo" = 'all product carriers' | wikisql |
CREATE TABLE table_name_62 (
programming VARCHAR,
video VARCHAR
) | Which Programming has a Video of audio only? | SELECT programming FROM table_name_62 WHERE video = "audio only" | sql_create_context |
CREATE TABLE fzzmzjzjlb (
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,
MZZYZD... | 在2006年3月27日到2016年9月4日期间,医院4607031的科室在门诊就诊中开出不小于19张检验报告单的有多少 | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '4607031' AND jybgb.BGRQ BETWEEN '2006-03-27' AND '2016-09-04' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 19 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb... | css |
CREATE TABLE table_62112 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Score, when Country is 'United States', when Place is 'T3', and when Player is 'Phil Blackmar'? | SELECT "Score" FROM table_62112 WHERE "Country" = 'united states' AND "Place" = 't3' AND "Player" = 'phil blackmar' | wikisql |
CREATE TABLE table_47282 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Where was the tournament where the score was 1 6, 6 3, 3 6? | SELECT "Tournament" FROM table_47282 WHERE "Score" = '1–6, 6–3, 3–6' | wikisql |
CREATE TABLE table_name_41 (
qual VARCHAR,
rank VARCHAR
) | What's the Qual listed with a Rank of 27? | SELECT qual FROM table_name_41 WHERE rank = "27" | sql_create_context |
CREATE TABLE table_7671 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Silver has a Total smaller than 2 and a Rank larger than 8 | SELECT MIN("Silver") FROM table_7671 WHERE "Total" < '2' AND "Rank" > '8' | wikisql |
CREATE TABLE table_42313 (
"Country" text,
"Automobile Name" text,
"Manufacturer" text,
"Engine Make/Capacity" text,
"Year" text
) | In what country was the car with the z 171cc engine? | SELECT "Country" FROM table_42313 WHERE "Engine Make/Capacity" = 'čz 171cc' | wikisql |
CREATE TABLE table_62613 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"Home" text,
"Away" text,
"Aggregate" text
) | What is the home record for the Auxerre club? | SELECT "Home" FROM table_62613 WHERE "Club" = 'auxerre' | wikisql |
CREATE TABLE table_76120 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Which Tie no has a Score of 0 1, and a Date of 9 march 1953? | SELECT "Tie no" FROM table_76120 WHERE "Score" = '0–1' AND "Date" = '9 march 1953' | wikisql |
CREATE TABLE table_58654 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | What is the set 3 when the total is 78 92? | SELECT "Set 3" FROM table_58654 WHERE "Total" = '78–92' | wikisql |
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_T... | Return the ids and details corresponding to projects for which there are more than two documents in a bar chart, and could you show from high to low by the X-axis? | SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_Details DESC | nvbench |
CREATE TABLE table_70435 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What is the earliest year when the points were more than 0? | SELECT MIN("Year") FROM table_70435 WHERE "Points" > '0' | wikisql |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE compartmen... | i would like to fly from DALLAS to SAN FRANCISCO on saturday and arrive in SAN FRANCISCO before 1600 | 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, date_day, days, flight WHERE ((date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <... | atis |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | Average current reputation of users on site. | SELECT AVG(u1.Reputation) FROM Users AS u1 WHERE u1.Id IN (SELECT DISTINCT u.Id FROM Posts AS p LEFT JOIN Users AS u ON (p.OwnerUserId = u.Id) WHERE p.PostTypeId = 1) | sede |
CREATE TABLE actor (
actor_id number,
name text,
musical_id number,
character text,
duration text,
age number
)
CREATE TABLE musical (
musical_id number,
name text,
year number,
award text,
category text,
nominee text,
result text
) | List the nominees that have been nominated more than two musicals. | SELECT nominee FROM musical GROUP BY nominee HAVING COUNT(*) > 2 | spider |
CREATE TABLE table_name_37 (
part_4 VARCHAR,
class VARCHAR
) | what is part 4 when the class is 5? | SELECT part_4 FROM table_name_37 WHERE class = "5" | sql_create_context |
CREATE TABLE table_55099 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | what is the position of pick #53? | SELECT "Position" FROM table_55099 WHERE "Pick #" = '53' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is the number of patients who have office admissions? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" | mimicsql_data |
CREATE TABLE table_name_86 (
stations INTEGER,
line VARCHAR
) | What is the total number of stations with a line that is u 6? | SELECT SUM(stations) FROM table_name_86 WHERE line = "u 6" | sql_create_context |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | Return a histogram on how many students live in each city?, and I want to display from low to high by the X. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code | nvbench |
CREATE TABLE table_name_72 (
constructor VARCHAR,
fastest_lap VARCHAR
) | What was the constructor for the fastest nelson piquet? | SELECT constructor FROM table_name_72 WHERE fastest_lap = "nelson piquet" | sql_create_context |
CREATE TABLE table_name_63 (
film_name VARCHAR,
year VARCHAR
) | Which film was released in the year 2002? | SELECT film_name FROM table_name_63 WHERE year = 2002 | sql_create_context |
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... | Count the number of people of each sex who have a weight higher than 85 by a bar chart. | SELECT Sex, COUNT(*) FROM people WHERE Weight > 85 GROUP BY Sex | nvbench |
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,
... | 在这个编号为09463847362住院就诊中,住院中医诊断的名称是什么?对应的编号是什么 | SELECT zyjzjlb.ZYZYZDZZBM, zyjzjlb.ZYZYZDZZMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '09463847362' | css |
CREATE TABLE table_41285 (
"Season" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | What is the Third when the Lead was don bartlett, the Second was carter rycroft, and a Season of 2003 04? | SELECT "Third" FROM table_41285 WHERE "Lead" = 'don bartlett' AND "Second" = 'carter rycroft' AND "Season" = '2003–04' | wikisql |
CREATE TABLE table_5568 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"# / County" text
) | How many people enrolled a the school with an IHSAA Class of a, and the trojans as their mascot? | SELECT MIN("Enrollment") FROM table_5568 WHERE "IHSAA Class" = 'a' AND "Mascot" = 'trojans' | wikisql |
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_last_name text,
customer_address text,
customer_phone text,
customer_email text,
other_customer_details text
)
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
ot... | How many customers have an account? | SELECT COUNT(DISTINCT customer_id) FROM accounts | spider |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.