context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_56149 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | What was the away team score, when the away team was Fitzroy? | SELECT "Away team score" FROM table_56149 WHERE "Away team" = 'fitzroy' | wikisql |
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... | 医院2313711从零二年的十一月一日开始一直到一五年四月三十号所有的就诊记载里账户是个人账户的支出比上医疗费总额度的平均比值 | SELECT AVG(t_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '2313711' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-11-01' AND '2015-04-30' UNION SELECT AVG(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHE... | css |
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... | 35087658病患在2013年3月20日起2020年5月17日之中的住院次数一共是多少次? | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '35087658' AND gwyjzb.IN_HOSP_DATE BETWEEN '2013-03-20' AND '2020-05-17' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '35087658' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2013-03-20' AND '2020-05-17' AND fgwyjzb.CLINIC_TYPE = '住院... | css |
CREATE TABLE table_20012 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"For" real,
"Against" real,
"Difference" text
) | Name the number of against for portuguesa santista | SELECT COUNT("Against") FROM table_20012 WHERE "Team" = 'Portuguesa Santista' | wikisql |
CREATE TABLE table_72759 (
"Appearances" real,
"School" text,
"Wins" real,
"Losses" real,
"Percent" text,
"Last Appearance" text
) | What's the largest amount of wins Texas has? | SELECT MAX("Wins") FROM table_72759 WHERE "School" = 'Texas' | wikisql |
CREATE TABLE table_name_4 (
visitor VARCHAR,
decision VARCHAR,
record VARCHAR
) | Who was the visitor when ward recorded the decision with a record of 22 21 4? | SELECT visitor FROM table_name_4 WHERE decision = "ward" AND record = "22–21–4" | sql_create_context |
CREATE TABLE table_name_77 (
game VARCHAR,
road_team VARCHAR,
result VARCHAR
) | What is Game, when Road Team is 'Syracuse', and when Result is '109-82'? | SELECT game FROM table_name_77 WHERE road_team = "syracuse" AND result = "109-82" | sql_create_context |
CREATE TABLE table_11409 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away team score at princes park with a Crowd larger than 27,455? | SELECT "Away team score" FROM table_11409 WHERE "Crowd" > '27,455' AND "Venue" = 'princes park' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | tell me the marital status for the patient john gartman. | SELECT demographic.marital_status FROM demographic WHERE demographic.name = "John Gartman" | mimicsql_data |
CREATE TABLE table_27892955_1 (
written_by VARCHAR,
us_viewers__million_ VARCHAR
) | Who wrote episode that had 1.97 million u.s. viewers? | SELECT written_by FROM table_27892955_1 WHERE us_viewers__million_ = "1.97" | sql_create_context |
CREATE TABLE table_36393 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Series" text
) | who is the Visitor that has a Series of series tied 2 2? | SELECT "Visitor" FROM table_36393 WHERE "Series" = 'series tied 2–2' | wikisql |
CREATE TABLE table_name_94 (
district VARCHAR,
reserved_for___sc___st__none_ VARCHAR
) | Name the District which has a Reserved for ( SC / ST /None) of sc? | SELECT district FROM table_name_94 WHERE reserved_for___sc___st__none_ = "sc" | sql_create_context |
CREATE TABLE table_67100 (
"Pure Tamil" text,
"How Ashtagrama Iyers say it" text,
"How other Iyers say it" text,
"How other Tamils say it" text,
"English Meaning" text
) | Name how ashtagrama lyers say it for engal veetil, engal agathil | SELECT "How Ashtagrama Iyers say it" FROM table_67100 WHERE "Pure Tamil" = 'engal veetil, engal agathil' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is admission time and diagnoses short title of subject id 98220? | SELECT demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "98220" | mimicsql_data |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 从14年12月19日到16年5月24日,把所有在医院5285300就诊的姓任的病患的医疗就诊记录列出来 | SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '5285300' AND qtb.IN_HOSP_DATE BETWEEN '2014-12-19' AND '2016-05-24' AND qtb.PERSON_NM LIKE '任%' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '5285300' AND gyb.IN_HOSP_DATE BETWEEN '2014-12-19' AND '2016-05-24' AND gyb.PERSON_NM LIKE '任%' UNION SELECT * FROM zyb WHERE ... | css |
CREATE TABLE table_63289 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Opposition" text
) | What County has an Opposition of Antrim and the Player Bernie Forde? | SELECT "County" FROM table_63289 WHERE "Opposition" = 'antrim' AND "Player" = 'bernie forde' | wikisql |
CREATE TABLE table_62329 (
"Month" text,
"15th- 20th century" text,
"U.S. (1912)" text,
"U.S. (2013)" text,
"Britain (2013)" text,
"Hindu" text
) | What was the U.S birthstone in the 15th-20th century when in 2013 it was amethyst? | SELECT "15th- 20th century" FROM table_62329 WHERE "U.S. (2013)" = 'amethyst' | wikisql |
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... | tell me the monthly minimum amount of prismasate in patient 11362's body since 05/2104? | SELECT MIN(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11362)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
CREATE TABLE table_68661 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term in office" text
) | Which state has a Term in office of 1984 1996, a Party of labor, and a Member of robert tickner? | SELECT "State" FROM table_68661 WHERE "Term in office" = '1984–1996' AND "Party" = 'labor' AND "Member" = 'robert tickner' | wikisql |
CREATE TABLE table_8921 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which country had a score of 72-67=139? | SELECT "Country" FROM table_8921 WHERE "Score" = '72-67=139' | wikisql |
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,
... | 从11.1.6开始,截止到12.11.24,北沙参颗粒总共被医院开出给患者46237741多少次 | SELECT COUNT(*) 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 = '46237741' AND t_kc22.STA_DATE BETWEEN '2011-01-06' AND '2012-11-24' AND t_kc22.SOC_SRT_DIRE_NM = '北沙参颗粒' | css |
CREATE TABLE table_39383 (
"Year" real,
"Championship" text,
"54 holes" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
) | Who are the Runner(s)-up with a Margin of 1 stroke? | SELECT "Runner(s)-up" FROM table_39383 WHERE "Margin" = '1 stroke' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | count the numbers of patients who died after having been diagnosed with stroke within the same hospital visit until 2 years ago. | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ... | eicu |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight 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 TA... | list airfares for FIRST class round trip from DETROIT to ST. PETERSBURG | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DETROIT' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AN... | atis |
CREATE TABLE table_name_55 (
player VARCHAR,
to_par VARCHAR
) | Which player had a To par of +11? | SELECT player FROM table_name_55 WHERE to_par = "+11" | 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... | how many patients of black/african american ethnicity are admitted before the year 2178? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.admityear < "2178" | mimicsql_data |
CREATE TABLE table_name_78 (
nationality VARCHAR,
heat VARCHAR,
lane VARCHAR
) | What nation started in lane 3 of heat 2? | SELECT nationality FROM table_name_78 WHERE heat = 2 AND lane = 3 | sql_create_context |
CREATE TABLE table_name_22 (
total__kg_ INTEGER,
bodyweight VARCHAR,
snatch VARCHAR
) | What is the total for the person with 73.28 bodyweight and fewer snatches than 75? | SELECT AVG(total__kg_) FROM table_name_22 WHERE bodyweight = 73.28 AND snatch < 75 | sql_create_context |
CREATE TABLE table_51806 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | Name the nationality for d | SELECT "Nationality" FROM table_51806 WHERE "Position" = 'd' | wikisql |
CREATE TABLE table_69046 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the highest Pick # for the College of Maryland-Eastern Shore? | SELECT MAX("Pick #") FROM table_69046 WHERE "College" = 'maryland-eastern shore' | wikisql |
CREATE TABLE table_23050383_1 (
ict VARCHAR,
education VARCHAR,
ki VARCHAR
) | What is the ICT when education is 1.73 and KI is ag 1.99? | SELECT ict FROM table_23050383_1 WHERE education = "1.73" AND ki = "1.99" | sql_create_context |
CREATE TABLE table_69275 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | What was the final score of the game at the astrodome? | SELECT "Final Score" FROM table_69275 WHERE "Stadium" = 'astrodome' | wikisql |
CREATE TABLE table_1801 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | Who were all the candidates in elections in which Steve Chabot was a candidate? | SELECT "Candidates" FROM table_1801 WHERE "Incumbent" = 'Steve Chabot' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | did patient 021-32860 undergo any procedures in the last year? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-32860')) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETI... | eicu |
CREATE TABLE Organisations (
organisation_id INTEGER,
organisation_type VARCHAR(10),
organisation_details VARCHAR(255)
)
CREATE TABLE Projects (
project_id INTEGER,
organisation_id INTEGER,
project_details VARCHAR(255)
)
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
... | For all organizations that have grants of more than 6000 dollars, compare the number of details of the organizations with a bar chart, display in asc by the bars. | SELECT organisation_details, COUNT(organisation_details) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY organisation_details ORDER BY organisation_details | nvbench |
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... | 显示出1623012这家医院就诊的患者任阳舒的出院科室名字没有中医的住院就诊记录 | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '任阳舒' AND hz_info.YLJGDM = '1623012' AND NOT zyjzjlb.CYKSMC LIKE '%中医%' | css |
CREATE TABLE table_16401 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | How many fb players were drafted? | SELECT COUNT("Pick #") FROM table_16401 WHERE "Position" = 'FB' | wikisql |
CREATE TABLE table_17195 (
"Unit" text,
"Commander" text,
"Complement" text,
"Killed" text,
"Wounded" text,
"Missing" text
) | What were the wounded for complement of 46 off 656 men? | SELECT "Wounded" FROM table_17195 WHERE "Complement" = '46 off 656 men' | wikisql |
CREATE TABLE table_43415 (
"Date" text,
"Result" text,
"Score" text,
"Brazil scorers" text,
"Competition" text
) | Who were the Brazil scorers who scored 3-3? | SELECT "Brazil scorers" FROM table_43415 WHERE "Score" = '3-3' | wikisql |
CREATE TABLE table_8897 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text
) | What is the average heat that has 52.83 sb mark and lane less than 4? | SELECT AVG("Heat") FROM table_8897 WHERE "Mark" = '52.83 sb' AND "Lane" < '4' | wikisql |
CREATE TABLE table_204_93 (
id number,
"round" number,
"pick" number,
"player" text,
"position" text,
"nationality" text,
"team" text,
"college" text
) | number of picks the st. louis hawks made in the draft | SELECT COUNT("player") FROM table_204_93 WHERE "team" = 'st. louis hawks' | squall |
CREATE TABLE table_name_15 (
first_elected VARCHAR,
incumbent VARCHAR
) | Which First elected has a Incumbent of none (new seat)? | SELECT first_elected FROM table_name_15 WHERE incumbent = "none (new seat)" | sql_create_context |
CREATE TABLE table_25507 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the score for madison square garden 18,828 | SELECT "Score" FROM table_25507 WHERE "Location Attendance" = 'Madison Square Garden 18,828' | wikisql |
CREATE TABLE table_17002 (
"Season" real,
"Position" real,
"Win/Loss" text,
"Coach" text,
"Captain" text,
"Dudley Tuckey Medal" text,
"Leading goalkicker" text
) | who is the captain where coach is geoff miles | SELECT "Captain" FROM table_17002 WHERE "Coach" = 'Geoff Miles' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | what is the glucose - d50 cost for? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'glucose - d50') | eicu |
CREATE TABLE table_name_92 (
year_s__of_manufacture VARCHAR,
axle_arrangement VARCHAR
) | Which Year(s) of manufacture has an Axle arrangement of 2 b n2? | SELECT year_s__of_manufacture FROM table_name_92 WHERE axle_arrangement = "2′b n2" | sql_create_context |
CREATE TABLE table_16592 (
"Finishing position" text,
"Points awarded (Platinum)" real,
"Points awarded (Gold)" real,
"Points awarded (Silver)" real,
"Points awarded (Satellite)" real
) | How many platinum points were awarded for 5th place? | SELECT MAX("Points awarded (Platinum)") FROM table_16592 WHERE "Finishing position" = '5th' | wikisql |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) | What is the average age for a male in each job Visualize by bar chart, and show x-axis in desc order. | SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job DESC | nvbench |
CREATE TABLE table_name_88 (
enrollment INTEGER,
ihsaa_class VARCHAR,
mascot VARCHAR
) | What's the most enrolled having the dragons for a mascot and an AAA for the IHSAA Class? | SELECT MAX(enrollment) FROM table_name_88 WHERE ihsaa_class = "aaa" AND mascot = "dragons" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | during the last hospital encounter, when was the last time patient 26195 was prescribed amikacin? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26195 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'amikacin' ORDER BY prescriptions.startdate DESC LIMIT... | mimic_iii |
CREATE TABLE table_54522 (
"Species" text,
"Strain" text,
"Type" text,
"Base Pairs" real,
"Genes" real
) | What is the lowest number of genes with less than 927,303 base pairs in Acidobacteria Bacterium? | SELECT MIN("Genes") FROM table_54522 WHERE "Base Pairs" < '927,303' AND "Species" = 'acidobacteria bacterium' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees who did not have any job in the past, give me the trend about salary over hire_date . | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
derived_product_cost DECIMAL(19,4),
derived_vat_payable DECIMAL(19,4),
derived_total_cost DECIMAL... | How many order items correspond to each order id. Plot them as scatter chart. | SELECT order_id, COUNT(*) FROM Order_Items GROUP BY order_id | nvbench |
CREATE TABLE table_3409 (
"No." real,
"#" real,
"Episode" text,
"Writer" text,
"Director" text,
"Original air date" text,
"Viewing figure" real
) | What episode number of the season did Tony Basgallop write? | SELECT MIN("#") FROM table_3409 WHERE "Writer" = 'Tony Basgallop' | wikisql |
CREATE TABLE table_48710 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the total attendance in a week less than 5 when the result was l 24-20? | SELECT COUNT("Attendance") FROM table_48710 WHERE "Result" = 'l 24-20' AND "Week" < '5' | wikisql |
CREATE TABLE table_30654 (
"#" real,
"Stadium" text,
"Capacity" real,
"Opened" text,
"City / Town" text,
"Home team" text
) | What stadium does FK Rudar play in? | SELECT "Stadium" FROM table_30654 WHERE "Home team" = 'FK Rudar' | wikisql |
CREATE TABLE table_204_902 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
) | who was from the same country as stowers ? | SELECT "name" FROM table_204_902 WHERE "name" <> 'julia stowers' AND "nationality" = (SELECT "nationality" FROM table_204_902 WHERE "name" = 'julia stowers') | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | give me the number of patients whose diagnoses short title is dmi neuro nt st uncntrld and drug type is main? | 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 = "DMI neuro nt st uncntrld" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_1184344_1 (
cr_no VARCHAR,
l INTEGER,
name VARCHAR
) | What was the maximum l&cr number for archimedes? | SELECT MAX(l) & cr_no FROM table_1184344_1 WHERE name = "Archimedes" | sql_create_context |
CREATE TABLE table_79610 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the most bronze can be when silver is larger than 2, and the nation is germany, and gold is more than 8? | SELECT MAX("Bronze") FROM table_79610 WHERE "Silver" > '2' AND "Nation" = 'germany' AND "Gold" > '8' | wikisql |
CREATE TABLE table_name_63 (
date VARCHAR,
week VARCHAR
) | What's the date for HOF week? | SELECT date FROM table_name_63 WHERE week = "hof" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId ... | Top 35 users from Ahmedabad. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%kochi%' OR UPPER(Location) LIKE '%KOCHI%' OR Location LIKE '%kochi%' ORDER BY Reputation DESC LIMIT 35 | sede |
CREATE TABLE table_name_13 (
location VARCHAR,
year VARCHAR,
runner_up VARCHAR
) | Where in 1985 was tim mayotte runner up? | SELECT location FROM table_name_13 WHERE year > 1985 AND runner_up = "tim mayotte" | sql_create_context |
CREATE TABLE table_37883 (
"States" text,
"Fall 05" real,
"Fall 06" real,
"Fall 07" real,
"Fall 08" real,
"Fall 09" real
) | What number is Fall 06 from the state with 79 or less in Fall 08, 36 or greater in Fall 07 and greater than 74 in Fall 05? | SELECT AVG("Fall 06") FROM table_37883 WHERE "Fall 08" < '79' AND "Fall 07" > '36' AND "Fall 05" > '74' | wikisql |
CREATE TABLE table_50745 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What is the Catalog of the RCA release? | SELECT "Catalog" FROM table_50745 WHERE "Label" = 'rca' | wikisql |
CREATE TABLE table_7059 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | What is the home of the team with Carlos Boozer (27) as the leading scorer? | SELECT "Home" FROM table_7059 WHERE "Leading scorer" = 'carlos boozer (27)' | wikisql |
CREATE TABLE table_69390 (
"Year" text,
"Champion" text,
"Runner-Up" text,
"3rd Place" text,
"Location" text
) | Name the champion for 3rd place tbc and runner-up tbc | SELECT "Champion" FROM table_69390 WHERE "3rd Place" = 'tbc' AND "Runner-Up" = 'tbc' | wikisql |
CREATE TABLE table_name_25 (
to_par VARCHAR,
score VARCHAR,
player VARCHAR
) | What is To Par, when Score is '66', and when Player is 'Brad Faxon'? | SELECT to_par FROM table_name_25 WHERE score = 66 AND player = "brad faxon" | sql_create_context |
CREATE TABLE table_name_70 (
chassis VARCHAR,
year VARCHAR
) | What is shown for Chassis for the year of 2007? | SELECT chassis FROM table_name_70 WHERE year = 2007 | sql_create_context |
CREATE TABLE table_19639 (
"Position" real,
"Race number" text,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed time d:hh:mm:ss" text
) | What are all elapsed time amounts for yacht type Reichel Pugh 55? | SELECT "Elapsed time d:hh:mm:ss" FROM table_19639 WHERE "Yacht type" = 'Reichel Pugh 55' | wikisql |
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)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE aircraft (
ai... | Draw a bar chart of destination versus the total number, I want to display in desc by the names. | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY destination DESC | nvbench |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | Draw a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, and order x-axis in ascending order. | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE table_name_11 (
venue VARCHAR,
score VARCHAR
) | What is the Venue of the Competition with a Score of 4-1? | SELECT venue FROM table_name_11 WHERE score = "4-1" | sql_create_context |
CREATE TABLE table_name_13 (
date VARCHAR,
game_site VARCHAR,
week VARCHAR
) | Which date has rich stadium as the game site for week 1? | SELECT date FROM table_name_13 WHERE game_site = "rich stadium" AND week = 1 | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 之前患者韩依然在哪儿看过病? | (SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '韩依然') UNION (SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = h... | css |
CREATE TABLE table_43216 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What was the finish with a total larger than 286, a to par of +4 and Bob Tway played? | SELECT "Finish" FROM table_43216 WHERE "Total" > '286' AND "To par" = '+4' AND "Player" = 'bob tway' | wikisql |
CREATE TABLE table_name_54 (
pick VARCHAR,
position VARCHAR,
team VARCHAR
) | What's the pick for the New York jets with a defensive end? | SELECT pick FROM table_name_54 WHERE position = "defensive end" AND team = "new york jets" | sql_create_context |
CREATE TABLE member (
member_id number,
name text,
country text,
college_id number
)
CREATE TABLE college (
college_id number,
name text,
leader_name text,
college_location text
)
CREATE TABLE round (
round_id number,
member_id number,
decoration_theme text,
rank_in_rou... | Show the names of members whose country is 'United States' or 'Canada'. | SELECT name FROM member WHERE country = "United States" OR country = "Canada" | spider |
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... | what is date of birth and procedure short title of subject name jerry deberry? | SELECT demographic.dob, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
per... | What are the completion dates of all the tests that have result 'Fail', and count them by a bar chart, and show in desc by the y axis. | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) DESC | nvbench |
CREATE TABLE table_75530 (
"Date" text,
"Home" text,
"Score" text,
"Visitor" text,
"Record" text
) | What was the score on April 25? | SELECT "Score" FROM table_75530 WHERE "Date" = 'april 25' | wikisql |
CREATE TABLE table_name_66 (
score VARCHAR,
record VARCHAR
) | Which score has a Record of 48-55? | SELECT score FROM table_name_66 WHERE record = "48-55" | sql_create_context |
CREATE TABLE table_18416 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | To which party does Frank T. Bow belong? | SELECT "Party" FROM table_18416 WHERE "Incumbent" = 'Frank T. Bow' | wikisql |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE journal (
journalid int,
journalname... | How many papers did Noah Smith publish in 2010 ? | SELECT DISTINCT COUNT(writes.paperid) FROM author, paper, writes WHERE author.authorname = 'Noah Smith' AND paper.year = 2010 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_26198709_1 (
written_by VARCHAR,
us_viewers__million_ VARCHAR
) | Who wrote the episode with 18.07 million viewers? | SELECT written_by FROM table_26198709_1 WHERE us_viewers__million_ = "18.07" | sql_create_context |
CREATE TABLE player (
player_id number,
player text,
team text,
age number,
position text,
school_id number
)
CREATE TABLE school_performance (
school_id number,
school_year text,
class_a text,
class_aa text
)
CREATE TABLE school_details (
school_id number,
nickname tex... | List the locations of schools that do not have any player. | SELECT location FROM school WHERE NOT school_id IN (SELECT school_id FROM player) | spider |
CREATE TABLE table_58199 (
"Character" text,
"Portrayed by" text,
"Crime" text,
"First appearance" text,
"Last appearance" text
) | Which character is portrayed by Elias Koteas? | SELECT "Character" FROM table_58199 WHERE "Portrayed by" = 'elias koteas' | wikisql |
CREATE TABLE table_58003 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Which team was played against on the game where Earl Watson (6) had the highest assists on January 19? | SELECT "Team" FROM table_58003 WHERE "High assists" = 'earl watson (6)' AND "Date" = 'january 19' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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,
lan... | when was the first time patient 30296 has been diagnosed with liver transplant status since 2105? | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'liver transplant status') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30296) AND STRFTIM... | mimic_iii |
CREATE TABLE table_name_69 (
to_par VARCHAR,
country VARCHAR
) | What is South Korea's to par value? | SELECT to_par FROM table_name_69 WHERE country = "south korea" | sql_create_context |
CREATE TABLE table_75383 (
"Polling Firm" text,
"Date" text,
"PSD - PC" text,
"UDMR" text,
"Elena B\u0103sescu" text,
"Others" text,
"Undecided" text
) | What date has the others of 2%? | SELECT "Date" FROM table_75383 WHERE "Others" = '2%' | wikisql |
CREATE TABLE table_204_373 (
id number,
"wager" text,
"winner" text,
"loser" text,
"location" text,
"date" text
) | how many times did mocho cota lose to chamaco valaguez ? | SELECT COUNT(*) FROM table_204_373 WHERE "loser" = 'mocho cota' AND "winner" = 'chamaco valaguez' | squall |
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
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, list in descending by the bars. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | nvbench |
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... | Specify the code of the drug Doxazosin | SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Doxazosin" | mimicsql_data |
CREATE TABLE table_10798928_1 (
director VARCHAR,
film_title_used_in_nomination VARCHAR
) | How many directors were there for the film Course Completed? | SELECT COUNT(director) FROM table_10798928_1 WHERE film_title_used_in_nomination = "Course Completed" | sql_create_context |
CREATE TABLE table_1996 (
"Rank" real,
"London Borough" text,
"Black African Population" real,
"Black Caribbean Population" real,
"Other Black Population" real,
"Total Black Population" real
) | What is the black caribbean population when the other black population is 2243? | SELECT MAX("Black Caribbean Population") FROM table_1996 WHERE "Other Black Population" = '2243' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
Rejectio... | Challenges Answered by Shaggy & ETHProductions. | SELECT Id FROM Posts AS a WHERE EXISTS(SELECT 1 FROM Posts WHERE ParentId = a.Id AND OwnerUserId = 58974) AND EXISTS(SELECT 1 FROM Posts WHERE ParentId = a.Id AND OwnerUserId = 42545) | sede |
CREATE TABLE table_1590652_4 (
date VARCHAR,
winning_score VARCHAR
) | Name the date of winning score being 67-67-63=197 | SELECT date FROM table_1590652_4 WHERE winning_score = 67 - 67 - 63 = 197 | sql_create_context |
CREATE TABLE table_name_20 (
player VARCHAR,
hometown VARCHAR
) | Who's from Bay City, TX? | SELECT player FROM table_name_20 WHERE hometown = "bay city, tx" | sql_create_context |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | Can I enroll in 500 -level classes for the Spring or Summer term ? | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURS... | advising |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.