context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | give the number of newborns who were born before the year 2121. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.dob_year < "2121" | mimicsql_data |
CREATE TABLE table_203_774 (
id number,
"name" text,
"dates" text,
"grt" number,
"propulsion" text,
"port" text,
"notes" text
) | which is the only ship used as a work boat ? | SELECT "name" FROM table_203_774 WHERE "notes" = 'work boat' | squall |
CREATE TABLE table_23976 (
"Model Type" text,
"Model Designation" text,
"Engine" text,
"Wheelbase (mm/inch)" text,
"GVW (kg/ton)" text,
"Axle Ratio" text
) | What's the wheelbase (in mm/inch) of the model with model designation 97G00? | SELECT "Wheelbase (mm/inch)" FROM table_23976 WHERE "Model Designation" = '97G00' | wikisql |
CREATE TABLE table_name_36 (
wins INTEGER,
played VARCHAR,
points VARCHAR,
position VARCHAR
) | How many wins when there are more than 19 points, place smaller than 12, and fewer than 30 played? | SELECT SUM(wins) FROM table_name_36 WHERE points > 19 AND position < 12 AND played < 30 | sql_create_context |
CREATE TABLE table_1803 (
"Year" text,
"Governor" text,
"Lieutenant Governor" text,
"Secretary of State" text,
"Attorney General" text,
"Treasurer" text,
"State Senate" text,
"State Assembly" text,
"U.S. Senator (Class I)" text,
"U.S. Senator (Class III)" text,
"U.S. House" t... | What was the composition of the state assembly in 2008? | SELECT "State Assembly" FROM table_1803 WHERE "Year" = '2008' | wikisql |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHA... | Visualize a bar chart for how many students are older than average for each gender?, could you order Sex in ascending order please? | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_name_63 (
width_feet__m_ VARCHAR,
source__year_ VARCHAR
) | What is the width feet in meeters for the truss with a source of nbi (2009)? | SELECT width_feet__m_ FROM table_name_63 WHERE source__year_ = "nbi (2009)" | sql_create_context |
CREATE TABLE table_13564637_5 (
points_against VARCHAR,
tries_for VARCHAR
) | How many numbers were recorded points against when the tries were for 43? | SELECT COUNT(points_against) FROM table_13564637_5 WHERE tries_for = "43" | sql_create_context |
CREATE TABLE table_name_63 (
season VARCHAR,
year VARCHAR
) | Which Season has a Year of 2005 06? | SELECT season FROM table_name_63 WHERE year = "2005–06" | sql_create_context |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city... | Show all the ranks and the number of male and female faculty for each rank in a bar chart, list by the bar in desc. | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank ORDER BY Rank DESC | nvbench |
CREATE TABLE table_name_60 (
horizontal_bar VARCHAR,
pommel_horse VARCHAR
) | What horizontal bar score also has a pommel horse score of 15.250? | SELECT horizontal_bar FROM table_name_60 WHERE pommel_horse = "15.250" | sql_create_context |
CREATE TABLE table_56155 (
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Diff" real
) | What is the sum of the difference for 9 draws and over 18 played? | SELECT SUM("Diff") FROM table_56155 WHERE "Drawn" = '9' AND "Played" > '18' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 找出患者施天罡住在0004524这家医院的所有出院记录里,患者出院的时候科室名字带心这个字的就诊记录 | 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 = '0004524' AND zyjzjlb.CYKSMC LIKE '%心%' | css |
CREATE TABLE table_name_2 (
ihsaa_class VARCHAR,
mascot VARCHAR
) | Which IHSAA Class has a Mascot of wildcats? | SELECT ihsaa_class FROM table_name_2 WHERE mascot = "wildcats" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute headquarter, and rank from low to high by the Code. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Code | nvbench |
CREATE TABLE table_name_82 (
place VARCHAR,
player VARCHAR
) | Where is the player Davis Love III? | SELECT place FROM table_name_82 WHERE player = "davis love iii" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | what is primary disease and admission time of subject id 29767? | SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "29767" | mimicsql_data |
CREATE TABLE advisor (
s_id text,
i_id text
)
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE department (
dept_name text,
buil... | Find the names of students who have taken any course in the fall semester of year 2003. | SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND year = 2003) | spider |
CREATE TABLE table_66608 (
"Year" real,
"Championship" text,
"Event" text,
"Nation" text,
"Result" text
) | What year did Canada get a silver in the olympics in the Men's Coxless Pair event? | SELECT MIN("Year") FROM table_66608 WHERE "Nation" = 'canada' AND "Result" = 'silver' AND "Championship" = 'olympics' AND "Event" = 'men''s coxless pair' | wikisql |
CREATE TABLE table_51681 (
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | Tell me the constructor for zolder | SELECT "Constructor" FROM table_51681 WHERE "Location" = 'zolder' | wikisql |
CREATE TABLE table_name_45 (
town_city VARCHAR,
name VARCHAR
) | In what Town/City is Nana Museum of The Arctic located? | SELECT town_city FROM table_name_45 WHERE name = "nana museum of the arctic" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | 醋酸泼尼松片在医疗就诊44639227091中所属的三大目录类别都是啥? | SELECT t_kc22.DIRE_TYPE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '44639227091' AND t_kc22.SOC_SRT_DIRE_NM = '醋酸泼尼松片' | css |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 列出病人53441764医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额不低于4790.44元的 | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '53441764' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 4790.44) | css |
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
)
... | Let me know the number of patients with guillain barre syndrome who died in or before 2111. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.dod_year <= "2111.0" | mimicsql_data |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 在编号为56729345369的医疗就诊中,名称里有神内的科室开出了哪些医疗费用明细的项目 | SELECT * FROM t_kc22 WHERE MED_CLINIC_ID = '56729345369' AND MED_ORG_DEPT_NM LIKE '%神内%' | css |
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEG... | How many students are older than 20 in each dorm Visualize by bar chart, and could you display by the y axis in descending please? | SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_203_374 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what was the total number of medals won by portugal ? | SELECT "total" FROM table_203_374 WHERE "nation" = 'portugal' | squall |
CREATE TABLE table_45358 (
"Team" text,
"Tries for" text,
"Tries against" text,
"Try diff" text,
"Points for" text,
"Points against" text,
"Points diff" text
) | What is Tries Against, when Points For is 98? | SELECT "Tries against" FROM table_45358 WHERE "Points for" = '98' | wikisql |
CREATE TABLE table_67687 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What is the Losing bonus, when the value for Points is 43? | SELECT "Losing bonus" FROM table_67687 WHERE "Points" = '43' | wikisql |
CREATE TABLE table_name_6 (
tournament VARCHAR
) | What is the tournament in 2012 results that has a 2003 results of 2r and played at Wimbledon? | SELECT 2012 FROM table_name_6 WHERE 2003 = "2r" AND tournament = "wimbledon" | sql_create_context |
CREATE TABLE table_20667854_1 (
free_float VARCHAR,
bse_code VARCHAR
) | How many values of free float for the BSE code of 4EH? | SELECT COUNT(free_float) FROM table_20667854_1 WHERE bse_code = "4EH" | sql_create_context |
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, give me the comparison about the sum of manufacturer over the headquarter , and group by attribute headquarter by a bar chart, and could you order x axis in desc order? | SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC | nvbench |
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... | 在04年9月13日到2019年10月2日期间叫做褚永昌的病患医保的统筹基金有多少支出? | SELECT SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '褚永昌' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-09-13' AND '2019-10-02' UNION SELECT SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '褚永昌' AND t_kc2... | css |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | What is the number of hispanic or latino - puerto rican patients who were given the drug named latanoprost 0.005% ophth.soln.? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Latanoprost 0.005% Ophth. Soln." | mimicsql_data |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 查看一下86323983的患者以前的治疗方案 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '86323983' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_name_53 (
tournament VARCHAR
) | Which 2007 has a 2008 of 1r, and a Tournament of wimbledon? | SELECT 2007 FROM table_name_53 WHERE 2008 = "1r" AND tournament = "wimbledon" | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For those employees who was hired before 2002-06-21, visualize a line chart about the change of salary over hire_date . | SELECT HIRE_DATE, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_8727 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
) | What is the method when the opponent is Andre Roberts? | SELECT "Method" FROM table_8727 WHERE "Opponent" = 'andre roberts' | wikisql |
CREATE TABLE table_name_75 (
capital VARCHAR,
voivodeship_or_city VARCHAR
) | Voivodeship or city of nowogr dzkie has what capital? | SELECT capital FROM table_name_75 WHERE voivodeship_or_city = "nowogródzkie" | sql_create_context |
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, visualize a bar chart about the distribution of name and the average of price , and group by attribute name, and order Y from high to low order. | SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC | nvbench |
CREATE TABLE table_17340355_6 (
high_assists VARCHAR,
score VARCHAR
) | Who made high points on games of score w 106 104 (ot) | SELECT high_assists FROM table_17340355_6 WHERE score = "W 106–104 (OT)" | sql_create_context |
CREATE TABLE table_19753079_35 (
party VARCHAR,
candidates VARCHAR
) | Name the number of party for richard l. hanna (r) 53.1% mike arcuri (d) 46.9% | SELECT COUNT(party) FROM table_19753079_35 WHERE candidates = "Richard L. Hanna (R) 53.1% Mike Arcuri (D) 46.9%" | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | 患者谢天心的身高多少?体重多少? | SELECT mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND 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.YL... | css |
CREATE TABLE table_name_43 (
dismissals VARCHAR,
venue VARCHAR
) | What is the Dismissals with a Venue with source: cricinfo.com? | SELECT dismissals FROM table_name_43 WHERE venue = "source: cricinfo.com" | sql_create_context |
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, find name and manufacturer , and group by attribute name, and visualize them by a bar chart, and display y-axis in asc order. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Manufacturer | nvbench |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | what is the total dose of ns that patient 63781 was prescribed until 03/2103? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 63781) AND prescriptions.drug = 'ns' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2103-03' | mimic_iii |
CREATE TABLE table_19753079_13 (
incumbent VARCHAR,
party VARCHAR,
district VARCHAR
) | How many incumbents are there in the georgia 8 district when the party is democratic? | SELECT COUNT(incumbent) FROM table_19753079_13 WHERE party = "Democratic" AND district = "Georgia 8" | sql_create_context |
CREATE TABLE table_64713 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the sum of the rank of the rower with an r note from Australia? | SELECT SUM("Rank") FROM table_64713 WHERE "Notes" = 'r' AND "Country" = 'australia' | wikisql |
CREATE TABLE DEPARTMENT (
DName VARCHAR,
DNO VARCHAR
)
CREATE TABLE MINOR_IN (
DNO VARCHAR
) | Find the name of the department that has the biggest number of students minored in? | SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTask... | (fout) Average amount of answers per question. | SELECT Year = DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0), Average_answers_per_question = SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) / CAST(SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS FLOAT) FROM Posts GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) ORDER BY DATEADD(MONTH, DATEDIFF(MONT... | sede |
CREATE TABLE table_name_40 (
score VARCHAR,
record VARCHAR
) | What was the score of the game when the record was 32 19 7? | SELECT score FROM table_name_40 WHERE record = "32–19–7" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | provide the number of patients whose discharge location is dead/expired and days of hospital stay is greater than 1? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.days_stay > "1" | mimicsql_data |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_s... | i would like to see flights from DENVER to PHILADELPHIA | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE... | atis |
CREATE TABLE table_51973 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | What is the record of the game on February 21, 2008? | SELECT "Record" FROM table_51973 WHERE "Date" = 'february 21, 2008' | wikisql |
CREATE TABLE table_53867 (
"Player" text,
"Position" text,
"Tries" real,
"Goals" real,
"Points" real
) | Tell me the player with points larger than 36 and goals more than 0 with tries of 12 | SELECT "Player" FROM table_53867 WHERE "Points" > '36' AND "Goals" > '0' AND "Tries" = '12' | wikisql |
CREATE TABLE table_56761 (
"Date" text,
"Home Team" text,
"Score" text,
"Visiting Team" text,
"Stadium" text
) | Which Visiting Team has a Stadium of servus centre? | SELECT "Visiting Team" FROM table_56761 WHERE "Stadium" = 'servus centre' | wikisql |
CREATE TABLE table_name_51 (
Id VARCHAR
) | What is the value for 2012 when the value for 2009 is 1R and the vale for 2007 is 2R? | SELECT 2012 FROM table_name_51 WHERE 2009 = "1r" AND 2007 = "2r" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | Show the number of patients with procedure icd9 code 3612 who died in or before 2126. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2126.0" AND procedures.icd9_code = "3612" | mimicsql_data |
CREATE TABLE table_56262 (
"Player" text,
"No.(s)" real,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | What was the position of the player who played for the Rockets during 1981? | SELECT "Position" FROM table_56262 WHERE "Years for Rockets" = '1981' | wikisql |
CREATE TABLE table_38445 (
"Club" text,
"League" text,
"Venue" text,
"Established" real,
"Championships" real
) | What is the Established date of the Brian Timmis Stadium? | SELECT COUNT("Established") FROM table_38445 WHERE "Venue" = 'brian timmis stadium' | wikisql |
CREATE TABLE table_20007413_6 (
compression_ratio VARCHAR,
rpo VARCHAR,
applications VARCHAR
) | What's the compression ratio of the model with L35 RPO and 5 applications? | SELECT compression_ratio FROM table_20007413_6 WHERE rpo = "L35" AND applications = 5 | sql_create_context |
CREATE TABLE table_203_371 (
id number,
"round" number,
"opponent" text,
"result" text,
"bro." number,
"opp." number,
"date" text,
"venue" text,
"crowd" number,
"position" text
) | how many different teams did the broncos play against ? | SELECT COUNT(DISTINCT "opponent") FROM table_203_371 | squall |
CREATE TABLE table_25468520_1 (
theme VARCHAR,
printing_process VARCHAR
) | What is the theme when the printing process is litho in 3 cols and intaglio? | SELECT theme FROM table_25468520_1 WHERE printing_process = "Litho in 3 cols and intaglio" | sql_create_context |
CREATE TABLE table_79707 (
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
) | When 2011/ 12 is non-ranking, what is the 2009/ 10? | SELECT "2009/ 10" FROM table_79707 WHERE "2011/ 12" = 'non-ranking' | wikisql |
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,
... | what is the admission time and lab test name of patient with patient id 22377? | SELECT demographic.admittime, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "22377" | mimicsql_data |
CREATE TABLE table_27588 (
"June 10-11" text,
"March 27-29" text,
"January 15-16" text,
"November 3" text,
"August 21-22" text
) | what is march 27-29 when november 3 is 133? | SELECT "March 27-29" FROM table_27588 WHERE "November 3" = '133' | wikisql |
CREATE TABLE table_29732 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who got high assists for team @ Indiana? | SELECT "High assists" FROM table_29732 WHERE "Team" = '@ Indiana' | wikisql |
CREATE TABLE table_203_14 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | how many international goals did teeratep winothai make in 2009 ? | SELECT COUNT(*) FROM table_203_14 WHERE "date" = 2009 | squall |
CREATE TABLE table_5191 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team" text
) | What is the nationality of the player in round 4? | SELECT "Nationality" FROM table_5191 WHERE "Round" = '4' | 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 drug code is mago140 and lab test category is hematology. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "MAGO140" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_11677100_12 (
position VARCHAR,
hometown VARCHAR
) | Which position did the player from the hometown of Dallas, TX play? | SELECT position FROM table_11677100_12 WHERE hometown = "Dallas, TX" | sql_create_context |
CREATE TABLE table_name_79 (
date VARCHAR,
home_team VARCHAR
) | What day is collingwood the home side? | SELECT date FROM table_name_79 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE table_55727 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people were in the Crowd when the Home team scored 10.7 (67)? | SELECT COUNT("Crowd") FROM table_55727 WHERE "Home team score" = '10.7 (67)' | wikisql |
CREATE TABLE table_204_57 (
id number,
"year" number,
"film" text,
"role" text,
"language" text,
"notes" text
) | what is the number of films in tamil ? | SELECT COUNT("film") FROM table_204_57 WHERE "language" = 'tamil' | squall |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Number of up votes in past 30 days. | SELECT COUNT(*) FROM Votes WHERE Votes.VoteTypeId IN (2) AND Votes.CreationDate >= DATEADD(DAY, -30, GETDATE()) | sede |
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price... | Show different carriers of phones together with the number of phones with each carrier by a pie chart. | SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | what is the number of patients whose days of hospital stay is greater than 4 and lab test category is hematology? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "4" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
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
)
... | Give me the number of patients born before 2043 who had a urine lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2043" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_18415 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What district is incumbent elmer j. holland from? | SELECT "District" FROM table_18415 WHERE "Incumbent" = 'Elmer J. Holland' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | what is age of subject id 14755? | SELECT demographic.age FROM demographic WHERE demographic.subject_id = "14755" | mimicsql_data |
CREATE TABLE table_18373863_2 (
mlb_team VARCHAR,
fcsl_team VARCHAR
) | When winter pines is the fcsl team how many mlb teams are there? | SELECT COUNT(mlb_team) FROM table_18373863_2 WHERE fcsl_team = "Winter Pines" | sql_create_context |
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
) | What is the id of the reviewer named Daniel Lewis? | SELECT rid FROM reviewer WHERE name = "Daniel Lewis" | spider |
CREATE TABLE table_54938 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Who recorded the loss on august 7? | SELECT "Loss" FROM table_54938 WHERE "Date" = 'august 7' | wikisql |
CREATE TABLE financial_transactions (
transaction_id number,
account_id number,
invoice_number number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE products (
product_id number,
p... | Show the product ids and the number of unique orders containing each product. | SELECT product_id, COUNT(DISTINCT order_id) FROM order_items GROUP BY product_id | spider |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For those employees who was hired before 2002-06-21, draw a scatter chart about the correlation between salary and commission_pct . | SELECT SALARY, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_34616 (
"Region served" text,
"City" text,
"Channels ( Analog / Digital )" text,
"First air date" text,
"ERP (Analog/ Digital)" text,
"HAAT (Analog/ Digital) 1" text,
"Transmitter Location" text
) | Which City has 600kw 500kw ERP (Analog/ Digital)? | SELECT "City" FROM table_34616 WHERE "ERP (Analog/ Digital)" = '600kw 500kw' | wikisql |
CREATE TABLE table_71484 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | Which 2nd leg came after a 1st leg of 0-3? | SELECT "2nd leg" FROM table_71484 WHERE "1st leg" = '0-3' | 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... | how many patients whose lab test name is nonsquamous epithelial cell? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "NonSquamous Epithelial Cell" | mimicsql_data |
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season re... | Draw a bar chart for how many players played each position?, rank from high to low by the total number. | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*) DESC | nvbench |
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 whose discharge location is home health care and days of hospital stay is greater than 10? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.days_stay > "10" | mimicsql_data |
CREATE TABLE table_name_79 (
draw VARCHAR,
dance_styles VARCHAR
) | How many draws have rumba/tango dance styles? | SELECT COUNT(draw) FROM table_name_79 WHERE dance_styles = "rumba/tango" | sql_create_context |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by time, and I want to order y-axis in asc order. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(EMPLOYEE_ID) | nvbench |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
... | Which classes are offered in the next 6 semesters ? | SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se... | advising |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Tags that are more popular than the Solaris tag. | WITH cnt AS (SELECT Count FROM Tags WHERE TagName = 'solaris') SELECT COUNT(*) FROM Tags WHERE Count > (SELECT Count FROM cnt) | sede |
CREATE TABLE table_71833 (
"Park" text,
"Tower height" text,
"Drop height*" text,
"Speed" text,
"Model" text,
"Opened" text,
"Height requirement" text
) | What opened with a drop height of 272feet? | SELECT "Opened" FROM table_71833 WHERE "Drop height*" = '272feet' | wikisql |
CREATE TABLE table_name_77 (
player VARCHAR,
points VARCHAR,
touchdowns VARCHAR,
extra_points VARCHAR
) | What Player has less than 10 Touchdowns and 0 Extra points and more than 5 Points? | SELECT player FROM table_name_77 WHERE touchdowns < 10 AND extra_points = 0 AND points > 5 | sql_create_context |
CREATE TABLE table_26328 (
"Sector" text,
"Establishments" real,
"Sales, receipts, or shipments ($1,000)" real,
"Annual payroll ($1,000)" real,
"Paid employees" real
) | If the establishment is 49319, what is the sales, receipts or shipments maximum amount? | SELECT MAX("Sales, receipts, or shipments ($1,000)") FROM table_26328 WHERE "Establishments" = '49319' | wikisql |
CREATE TABLE table_20580 (
"Platform" real,
"Frequency (per hour)" real,
"Destination" text,
"Service Pattern" text,
"Operator" text,
"Line" text
) | Who is the operator to Highbury & Islington? | SELECT "Operator" FROM table_20580 WHERE "Destination" = 'Highbury & Islington' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 从2006年10月22日到2014年7月12日期间里,号码是08644482的病人所有检验报告单的审核日期是什么时候吗? | SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '08644482' AND jybgb.BGRQ BETWEEN '2006-10-22' AND '2014-07-12' UNION... | css |
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
)
... | what number of patients were primarily admitted for sepsis before the year 2162? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SEPSIS" AND demographic.admityear < "2162" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.