context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_204_481 (
id number,
"poll source" text,
"date(s)\nadministered" text,
"sample\nsize" number,
"margin of\nerror" text,
"andrew\ncuomo (d)" text,
"rob\nastorino (r)" text,
"other" text,
"undecided" text
) | what was the difference in percentage between cuomo and astorino from february 28 march 3 , 2014 ? | SELECT ABS("andrew\ncuomo (d)" - "rob\nastorino (r)") FROM table_204_481 WHERE "date(s)\nadministered" = 'february 28-march 3, 2014' | squall |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 查找58163756741在哪个门诊就诊开出了几份检验报告单 | SELECT COUNT(*) FROM jybgb WHERE JZLSH = '58163756741' | css |
CREATE TABLE table_name_22 (
result VARCHAR,
year VARCHAR,
venue VARCHAR
) | What was the result of events held at Nor Elverum, prior to 2010? | SELECT result FROM table_name_22 WHERE year < 2010 AND venue = "nor elverum" | sql_create_context |
CREATE TABLE table_25954 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | What was the record in the November 7 game? | SELECT "Record" FROM table_25954 WHERE "Date" = 'November 7' | wikisql |
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
) | For those records from the products and each product's manufacturer, show me about the distribution of headquarter and the amount of headquarter , and group by attribute headquarter in a bar chart, and sort in asc by the X-axis. | SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter | nvbench |
CREATE TABLE table_64834 (
"Japanese Title" text,
"English Title" text,
"Year" real,
"First publisher" text,
"ISBN" text
) | What is the ISBN in 1999? | SELECT "ISBN" FROM table_64834 WHERE "Year" = '1999' | wikisql |
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transact... | A line chart for what are the number of the dates of transactions with at least 100 share count or amount bigger than 100?, and display by the date_of_transaction in asc. | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 ORDER BY date_of_transaction | nvbench |
CREATE TABLE CLASS (
crs_code VARCHAR
)
CREATE TABLE course (
dept_code VARCHAR,
crs_credit INTEGER,
crs_code VARCHAR
) | Find the total credits of all classes offered by each department. | SELECT SUM(T1.crs_credit), T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code GROUP BY T1.dept_code | sql_create_context |
CREATE TABLE table_7937 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text
) | What is the result of the match with clyde as the opponent in the h venue? | SELECT "Result" FROM table_7937 WHERE "Opponent" = 'clyde' AND "Venue" = 'h' | wikisql |
CREATE TABLE table_61859 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | WHICH Date has a Venue of lancaster park , christchurch? | SELECT "Date" FROM table_61859 WHERE "Venue" = 'lancaster park , christchurch' | 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... | what is the number of patients whose diagnoses long title is other and unspecified agents primarily affecting the cardiovascular system causing adverse effects in therapeutic use? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other and unspecified agents primarily affecting the cardiovascular system causing adverse effects in therapeutic use" | mimicsql_data |
CREATE TABLE table_204_787 (
id number,
"year" number,
"category" text,
"nominee(s)" text,
"episode" text,
"result" text
) | how many wins were after 1987 ? | SELECT COUNT(*) FROM table_204_787 WHERE "result" = 'won' AND "year" > 1987 | squall |
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... | count the number of patients whose year of death is less than or equal to 2126 and item id is 51363? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2126.0" AND lab.itemid = "51363" | mimicsql_data |
CREATE TABLE table_name_89 (
model VARCHAR,
released VARCHAR
) | What model was released in 2005? | SELECT model FROM table_name_89 WHERE released = 2005 | sql_create_context |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE station (
id INTEG... | Show maximal lat from each city, show total number in descending order please. | SELECT city, MAX(lat) FROM station GROUP BY city ORDER BY MAX(lat) DESC | nvbench |
CREATE TABLE table_71442 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | Who is the 1st member in the 1884 by-election? | SELECT "1st Member" FROM table_71442 WHERE "Election" = '1884 by-election' | wikisql |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE STUDENT ... | Show the number of courses for each instructor in a bar chart, and display bar in descending order please. | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME ORDER BY EMP_FNAME DESC | nvbench |
CREATE TABLE table_name_57 (
event_type VARCHAR,
sport VARCHAR,
body VARCHAR,
year VARCHAR
) | What event type had BODY CMAS in 1980 and underwater hockey? | SELECT event_type FROM table_name_57 WHERE body = "cmas" AND year = "1980" AND sport = "underwater hockey" | sql_create_context |
CREATE TABLE table_name_75 (
attendance INTEGER,
opponent VARCHAR,
loss VARCHAR
) | What is the largest attendance that has tigers as the opponent and a loss of leiter (0-1)? | SELECT MAX(attendance) FROM table_name_75 WHERE opponent = "tigers" AND loss = "leiter (0-1)" | sql_create_context |
CREATE TABLE table_name_50 (
bushi VARCHAR,
kaz_hayashi VARCHAR
) | Name the BUSHI that has kaz hayashi of kai (14:01) | SELECT bushi FROM table_name_50 WHERE kaz_hayashi = "kai (14:01)" | sql_create_context |
CREATE TABLE table_2781227_7 (
nhl_team VARCHAR,
player VARCHAR
) | What NHL team picked Tom White? | SELECT nhl_team FROM table_2781227_7 WHERE player = "Tom White" | sql_create_context |
CREATE TABLE table_32740 (
"Particulars and Characteristics" text,
"Shivalik Zone" text,
"Mid-Hill Zone" text,
"High hill zone" text,
"Trance- n Himalaya Zone" text
) | Which mid-hill zone has a slightly warm temperature? | SELECT "High hill zone" FROM table_32740 WHERE "Mid-Hill Zone" = 'slightly warm temperature' | wikisql |
CREATE TABLE table_28495 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | Who was the original artist of the group performance theme? | SELECT "Original artist" FROM table_28495 WHERE "Theme" = 'Group Performance' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE T... | when did patient 31880 had the first intake on 01/08/last year? | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31880)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), '... | mimic_iii |
CREATE TABLE table_train_71 (
"id" int,
"gender" string,
"language" string,
"intention_to_arterial_catheter" bool,
"renal_disease" bool,
"sepsis" bool,
"allergy_to_hydroxyethyl_starch" bool,
"age" float,
"NOUSE" float
) | allergy against hydroxyethyl starch | SELECT * FROM table_train_71 WHERE allergy_to_hydroxyethyl_starch = 1 | criteria2sql |
CREATE TABLE table_32114 (
"Name" text,
"Martyred" real,
"Place" text,
"Beatified" real,
"Canonised" real
) | When was the person(s) who were canonised before 1988 beatified? | SELECT "Beatified" FROM table_32114 WHERE "Canonised" < '1988' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many people have had microbiological tests in their wound, decubitus in 2104? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'wound, decubitus' AND STRFTIME('%y', microlab.culturetakentime) = '2104') | eicu |
CREATE TABLE table_65483 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) | What's the against when the draw was more than 0 and had 13 losses? | SELECT COUNT("Against") FROM table_65483 WHERE "Losses" = '13' AND "Draws" > '0' | 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 with abnormal lab test status who have been diagnosed with subendocardial infarction, initial episode of care. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Subendo infarct, initial" AND lab.flag = "abnormal" | mimicsql_data |
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 intakeoutput (
in... | has patient 030-44598 received a medication in this month? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-44598')) AND DATETIME(medication.drugstarttime, 'start of month') = DA... | eicu |
CREATE TABLE table_name_80 (
tournament VARCHAR,
date VARCHAR
) | What tournament was held on 21 May 2006? | SELECT tournament FROM table_name_80 WHERE date = "21 may 2006" | sql_create_context |
CREATE TABLE table_name_67 (
anand VARCHAR,
game VARCHAR
) | What was Anand's score in game 8? | SELECT anand FROM table_name_67 WHERE game = "8" | sql_create_context |
CREATE TABLE table_56744 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What's the highest turnout when carlton was playing as the away team? | SELECT MAX("Crowd") FROM table_56744 WHERE "Away team" = 'carlton' | wikisql |
CREATE TABLE table_38467 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." text,
"Record" text
) | What was the date of the game in which Holt (4-4) took the loss? | SELECT "Date" FROM table_38467 WHERE "Loss" = 'holt (4-4)' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | when did patient 002-41391 get his or her last prescription? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41391')) ORDER BY medication.drugstarttime DESC LIMIT 1 | eicu |
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... | 患者84544410的直接胆红素二代指标在06年11月10日-13年2月14日期间是怎样的 | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE table_name_58 (
front_side_bus VARCHAR,
voltage VARCHAR,
frequency VARCHAR
) | Which Front Side Bus has a Voltage of 1.4 v, and a Frequency of 1333 mhz? | SELECT front_side_bus FROM table_name_58 WHERE voltage = "1.4 v" AND frequency = "1333 mhz" | sql_create_context |
CREATE TABLE table_11728 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | When was the record 3-14-6? | SELECT "Date" FROM table_11728 WHERE "Record" = '3-14-6' | wikisql |
CREATE TABLE table_19215259_1 (
frequency VARCHAR,
branding VARCHAR
) | What is the frequency of 101.5 News FM? | SELECT frequency FROM table_19215259_1 WHERE branding = "101.5 News FM" | sql_create_context |
CREATE TABLE table_38099 (
"Hindi" text,
"Romani" text,
"Domari" text,
"Lomavren" text,
"Persian" text
) | What is the Domari associated with a Persian of yak, yek? | SELECT "Domari" FROM table_38099 WHERE "Persian" = 'yak, yek' | wikisql |
CREATE TABLE takes (
id text,
course_id text,
sec_id text,
semester text,
year number,
grade text
)
CREATE TABLE student (
id text,
name text,
dept_name text,
tot_cred number
)
CREATE TABLE prereq (
course_id text,
prereq_id text
)
CREATE TABLE classroom (
building... | What are the ids of instructors who didnt' teach? | SELECT id FROM instructor EXCEPT SELECT id FROM teaches | spider |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE CO... | Return a bar chart on how many hours do the students spend studying in each department?, and I want to sort by the y axis in ascending. | SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE ORDER BY SUM(STU_HRS) | nvbench |
CREATE TABLE table_8395 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" real,
"Year named" real
) | WHAT IS THE LOWEST DIAMETER FOR A LATITIDE OF 52.0S? | SELECT MIN("Diameter (km)") FROM table_8395 WHERE "Latitude" = '52.0s' | wikisql |
CREATE TABLE table_name_62 (
lowest_elevation VARCHAR,
highest_point VARCHAR
) | What is the lowest elevation value whose highest point is Mont Raimeux? | SELECT lowest_elevation FROM table_name_62 WHERE highest_point = "mont raimeux" | sql_create_context |
CREATE TABLE table_name_70 (
team VARCHAR,
qual_1 VARCHAR
) | What is Team, when Qual 1 is 1:16.417? | SELECT team FROM table_name_70 WHERE qual_1 = "1:16.417" | sql_create_context |
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
)
... | Count the number of patients whose admission type is elective and have stayed in the hospital for more than 9 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay > "9" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | provide the number of patients whose religion is catholic and age is less than 47? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "CATHOLIC" AND demographic.age < "47" | mimicsql_data |
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... | 在医疗机构2027203里,有多少患者做了项目1591的检查 | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '2027203' AND t_kc22.SOC_SRT_DIRE_CD = '1591' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '2027203' AND t_kc22.SOC_SRT_DIRE_CD = '1591' UNION ... | css |
CREATE TABLE table_14984103_1 (
week VARCHAR,
opponent VARCHAR
) | Name the number of weeks for san francisco 49ers | SELECT COUNT(week) FROM table_14984103_1 WHERE opponent = "San Francisco 49ers" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | what is days of hospital stay and primary disease of subject name james cepeda? | SELECT demographic.days_stay, demographic.diagnosis FROM demographic WHERE demographic.name = "James Cepeda" | mimicsql_data |
CREATE TABLE table_59837 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
) | What Money ( ) has a Country of ireland? | SELECT "Money ( \u00a3 )" FROM table_59837 WHERE "Country" = 'ireland' | wikisql |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE train (
id int,
train... | Find the number of trains for each station, as well as the station network name Show the result with a bar graph, order in ascending by the network_name. | SELECT network_name, COUNT(*) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id ORDER BY network_name | nvbench |
CREATE TABLE table_37337 (
"Track" text,
"City" text,
"State" text,
"Opened" text,
"Major Series" text,
"Turns" text
) | What is the State with the trans-am Major Series in Grand Rapids? | SELECT "State" FROM table_37337 WHERE "Major Series" = 'trans-am' AND "City" = 'grand rapids' | wikisql |
CREATE TABLE table_name_32 (
round INTEGER,
name VARCHAR
) | What is the round for marcus howard? | SELECT SUM(round) FROM table_name_32 WHERE name = "marcus howard" | sql_create_context |
CREATE TABLE table_22879323_8 (
record VARCHAR,
team VARCHAR
) | What was the record in the game against Memphis? | SELECT record FROM table_22879323_8 WHERE team = "Memphis" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | calculate the total number of patients who had fus/refus 4-8 vertebrae | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Fus/refus 4-8 vertebrae" | mimicsql_data |
CREATE TABLE table_train_12 (
"id" int,
"sequential_organ_failure_assessment_sofa" int,
"active_infection" bool,
"taking_pioglitazone" bool,
"taking_rosiglitazone" bool,
"body_weight" float,
"diabetic" string,
"organ_failure" bool,
"age" float,
"NOUSE" float
) | are already on or have a history of taking pioglitazone or rosiglitazone | SELECT * FROM table_train_12 WHERE taking_pioglitazone = 1 OR taking_rosiglitazone = 1 | criteria2sql |
CREATE TABLE table_20015 (
"Region" text,
"Start datum" text,
"Target datum" text,
"c_x ( Metre )" text,
"c_y (Metre)" text,
"c_z (Metre)" text,
"s ( ppm )" text,
"r x ( Arcsecond )" text,
"r y ( Arcsecond )" text,
"r z ( Arcsecond )" text
) | How many values of r z (arcsecond) correspond with a r y (arcsecond) value of 0.247? | SELECT "r z ( Arcsecond )" FROM table_20015 WHERE "r y ( Arcsecond )" = '−0.247' | wikisql |
CREATE TABLE table_3930 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who performed the most rebounds on games against the Minnesota Timberwolves? | SELECT "High rebounds" FROM table_3930 WHERE "Team" = 'Minnesota Timberwolves' | wikisql |
CREATE TABLE table_59212 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | What is the highest total of the player with a 7 to par? | SELECT MAX("Total") FROM table_59212 WHERE "To par" = '7' | wikisql |
CREATE TABLE table_name_15 (
heat_rank INTEGER,
time VARCHAR,
lane VARCHAR
) | Tell me the average heat rank for time less than 24.02 and lane of 1 | SELECT AVG(heat_rank) FROM table_name_15 WHERE time < 24.02 AND lane = 1 | sql_create_context |
CREATE TABLE table_name_14 (
round VARCHAR,
method VARCHAR,
opponent VARCHAR
) | Which Round has a Method of ko, and an Opponent of alfonse d'amore? | SELECT round FROM table_name_14 WHERE method = "ko" AND opponent = "alfonse d'amore" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
... | when did patient 14671 receive the last lab test, during this hospital visit? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_95 (
home_team VARCHAR,
venue VARCHAR
) | What was the Home team's score when the Venue was mcg? | SELECT home_team AS score FROM table_name_95 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE table_31656 (
"Year" real,
"Division" text,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
) | What was the Rampage's status in the Open Cup in the year that they made it to the 2nd round of the playoffs? | SELECT "Open Cup" FROM table_31656 WHERE "Playoffs" = '2nd round' | wikisql |
CREATE TABLE table_name_95 (
competition VARCHAR,
date VARCHAR
) | What competition was played on October 7, 2011? | SELECT competition FROM table_name_95 WHERE date = "october 7, 2011" | sql_create_context |
CREATE TABLE table_name_24 (
winning_constructor VARCHAR,
name VARCHAR
) | Who was the winning constructor of the Grand Prix Du Salon ? | SELECT winning_constructor FROM table_name_24 WHERE name = "grand prix du salon" | sql_create_context |
CREATE TABLE table_203_743 (
id number,
"version" text,
"date" text,
"development cycle" text,
"size (in kb)" number,
"download" text,
"notes" text
) | which versions of cello have the same development cycle as 0.1 ? | SELECT "version" FROM table_203_743 WHERE "version" <> '0.1' AND "development cycle" = (SELECT "development cycle" FROM table_203_743 WHERE "version" = '0.1') | squall |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Bar chart x axis acc road y axis the average of school id, rank from low to high by the y axis. | SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID) | nvbench |
CREATE TABLE table_name_50 (
october INTEGER,
record VARCHAR
) | WHich October has a Record of 1 0 0? | SELECT MIN(october) FROM table_name_50 WHERE record = "1–0–0" | sql_create_context |
CREATE TABLE table_50003 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is Record, when High Rebounds is 'Marcus Camby (15)', and when High Assists is 'Baron Davis (7)'? | SELECT "Record" FROM table_50003 WHERE "High rebounds" = 'marcus camby (15)' AND "High assists" = 'baron davis (7)' | wikisql |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | In the Spring or Summer term are there any 400 -level classes ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 400 AND 400 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = cou... | advising |
CREATE TABLE table_name_10 (
record VARCHAR,
week VARCHAR,
result VARCHAR
) | What was the record at the game with a result of W 13-12 after week 4? | SELECT record FROM table_name_10 WHERE week > 4 AND result = "w 13-12" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | A scatter chart shows the correlation between School_ID and ACC_Percent , and group by attribute All_Road. | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY All_Road | nvbench |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 医院9182083所有的记录里按科室名的差异列一下医保的统筹基金和总的医疗费用之比的平均比值 | SELECT gwyjzb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '9182083' GROUP BY gwyjzb.MED_ORG_DEPT_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINI... | css |
CREATE TABLE table_58314 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away team score at Corio Oval? | SELECT "Away team score" FROM table_58314 WHERE "Venue" = 'corio oval' | 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_... | ground SAN FRANCISCO | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN FRANCISCO' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
countr... | Fall and Winter terms offer how many 200 -level classes ? | SELECT COUNT(DISTINCT course.department, course.name, course.number, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_... | advising |
CREATE TABLE table_79065 (
"Elimination" text,
"Wrestler" text,
"Team" text,
"Eliminated by" text,
"Elimination Move" text,
"Time" text
) | What time was the Wrestler Henry eliminated by Batista? | SELECT "Time" FROM table_79065 WHERE "Eliminated by" = 'batista' AND "Wrestler" = 'henry' | wikisql |
CREATE TABLE table_6324 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text,
"Team" text
) | What is the name of the team with a finish of 19? | SELECT "Team" FROM table_6324 WHERE "Finish" = '19' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | query all Post mentioned webrtc. | SELECT Title, Tags FROM Posts WHERE Title LIKE 'WebRTC' | sede |
CREATE TABLE table_name_12 (
outcome VARCHAR,
championship VARCHAR
) | Tell me the outcome for premier league darts | SELECT outcome FROM table_name_12 WHERE championship = "premier league darts" | sql_create_context |
CREATE TABLE table_249512_2 (
population__2010_ INTEGER,
place_name VARCHAR
) | What is the minimum 2010 population of Edgewater? | SELECT MIN(population__2010_) FROM table_249512_2 WHERE place_name = "Edgewater" | sql_create_context |
CREATE TABLE table_50137 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Where was the Deep - 30 Impact event held? | SELECT "Location" FROM table_50137 WHERE "Event" = 'deep - 30 impact' | 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... | 在2008年10月2日到2019年11月28日内医生65472198有多少门诊病人? | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_in... | css |
CREATE TABLE table_16400024_1 (
socket VARCHAR,
sspec_number VARCHAR
) | What is the socket location for sSPEC number sl3f7(kc0)sl3fj(kc0)? | SELECT socket FROM table_16400024_1 WHERE sspec_number = "SL3F7(kC0)SL3FJ(kC0)" | sql_create_context |
CREATE TABLE table_11044765_1 (
league VARCHAR,
school VARCHAR
) | Which leagues is the Galena school in? | SELECT league FROM table_11044765_1 WHERE school = "Galena" | sql_create_context |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
... | Configuration management trends (# of Questions per Month). | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... | sede |
CREATE TABLE table_20872722_1 (
position VARCHAR,
weight VARCHAR
) | Which position has 225lb as weight? | SELECT position FROM table_20872722_1 WHERE weight = "225lb" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 te... | 在2010年5月30日到2014年3月23日内患者08033471有多少检测结果指标记录的检验人为88248924的检测指标流水号? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM A... | css |
CREATE TABLE table_19219 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
) | What are all the run times with 8.2 million viewers? | SELECT "Run time" FROM table_19219 WHERE "Viewers (in millions)" = '8.2' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | get me the number of patients born before 2058 who had csf lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2058" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_45596 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) | Which Laps have a Manufacturer of aprilia, and a Rider of sergio gadea? | SELECT "Laps" FROM table_45596 WHERE "Manufacturer" = 'aprilia' AND "Rider" = 'sergio gadea' | wikisql |
CREATE TABLE table_68508 (
"Date" text,
"Course" text,
"Distance" text,
"Winner" text,
"Race Leader" text
) | Name the winner for 5 june | SELECT "Winner" FROM table_68508 WHERE "Date" = '5 june' | wikisql |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | Who are the Winter MDE class teachers ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_3125 (
"Episode Number" real,
"Location" text,
"Original Airdate" text,
"Challenge Winner" text,
"Challenge" text
) | Who was the challenge winner in the episode that originally aired on January 28, 2009? | SELECT "Challenge Winner" FROM table_3125 WHERE "Original Airdate" = 'January 28, 2009' | wikisql |
CREATE TABLE table_2441 (
"Position" real,
"Driver" text,
"Points" real,
"Winnings" text,
"Series" text
) | In what series did the driver get 30 points? | SELECT "Series" FROM table_2441 WHERE "Points" = '30' | wikisql |
CREATE TABLE table_name_1 (
pick VARCHAR,
round VARCHAR,
player VARCHAR
) | What is the total number of Pick, when Round is greater than 1, and when Player is 'Jim Stack'? | SELECT COUNT(pick) FROM table_name_1 WHERE round > 1 AND player = "jim stack" | sql_create_context |
CREATE TABLE table_44058 (
"Year" real,
"$10 \u2013 1/10 oz." text,
"$25 \u2013 1/4 oz." real,
"$50 \u2013 1/2 oz." real,
"$100 \u2013 1 oz." text
) | WHAT IS THE LOWEST $25-1/4 OZ COIN WITH A $10-1/10 OZ OF $70,250? | SELECT MIN("$25 \u2013 1/4 oz.") FROM table_44058 WHERE "$10 \u2013 1/10 oz." = '70,250' | wikisql |
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number,
product_quantity text,
other_order_item_details text
)
CREATE TABLE accounts (
account_id number,
customer_id number,
date_account_opened time,
account_name text,
other_account_details text
)
C... | What are total transaction amounts for each transaction type? | SELECT transaction_type, SUM(transaction_amount) FROM financial_transactions GROUP BY transaction_type | spider |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.