context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_11965481_13 (
location_attendance VARCHAR,
date VARCHAR
) | Name the location on june 10 | SELECT location_attendance FROM table_11965481_13 WHERE date = "June 10" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 多糖铁复合物胶囊这种药都什么医院给名叫秦雅惠的患者开过? | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '秦雅惠' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '多糖铁复合物胶囊') | css |
CREATE TABLE table_74178 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What team did the Hornets play in game 4? | SELECT "Team" FROM table_74178 WHERE "Game" = '4' | wikisql |
CREATE TABLE table_name_37 (
pick INTEGER,
round VARCHAR,
name VARCHAR
) | What is the highest pick of scott turner, who has a round greater than 2? | SELECT MAX(pick) FROM table_name_37 WHERE round > 2 AND name = "scott turner" | sql_create_context |
CREATE TABLE table_name_14 (
wins INTEGER,
byes INTEGER
) | For the teams that had more than 2 Byes, what was the highest number of Wins? | SELECT MAX(wins) FROM table_name_14 WHERE byes > 2 | 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 jyjgzbb (
BGDH text,
BGRQ tim... | 检测指标名称与检测指标结果定量单位和检验指标记录65019471454相同,且满足检测指标结果定量大于其的检验指标记录有哪些 | SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '65019471454') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '65019471454') AND jyjgzbb.JCZBJGDL > (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '65019471454') | css |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_stop (
flight_id in... | give me the CO flights from CHICAGO to SEATTLE on saturday morning | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND date_day.day_number = 26 AND date_day.month_number = 7 AND... | atis |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is drug route of drug name indomethacin? | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Indomethacin" | mimicsql_data |
CREATE TABLE table_50196 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What is Top Par, when Country is Sweden? | SELECT "To par" FROM table_50196 WHERE "Country" = 'sweden' | wikisql |
CREATE TABLE table_25604014_5 (
no_in_season VARCHAR,
directed_by VARCHAR
) | How many episodes directed by david carson? | SELECT COUNT(no_in_season) FROM table_25604014_5 WHERE directed_by = "David Carson" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | provide the number of patients whose death status is 1 and primary disease is st elevated myocardial infarction\cardiac cath? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
CREATE TABLE table_26980 (
"Season" text,
"Premier Division" text,
"Division One" text,
"Division Two" text,
"Division Three" text,
"Division Four" text,
"Division Five" text
) | When racing epsom is in division two how many seasons are there? | SELECT COUNT("Season") FROM table_26980 WHERE "Division Two" = 'Racing Epsom' | wikisql |
CREATE TABLE table_12241 (
"Date" text,
"Ship" text,
"Nationality" text,
"Tonnage" real,
"Fate" text
) | What is the highest tonnage of the ship from norway? | SELECT MAX("Tonnage") FROM table_12241 WHERE "Nationality" = 'norway' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
... | Do I have any credits so far , if yes how many ? | SELECT DISTINCT total_credit FROM student WHERE student_id = 1 | advising |
CREATE TABLE table_name_43 (
to_par VARCHAR,
place VARCHAR,
player VARCHAR
) | What is Bob Gilder in Place T3's To par? | SELECT to_par FROM table_name_43 WHERE place = "t3" AND player = "bob gilder" | sql_create_context |
CREATE TABLE table_name_59 (
to_par VARCHAR,
player VARCHAR
) | Name the To par for leland gibson | SELECT to_par FROM table_name_59 WHERE player = "leland gibson" | sql_create_context |
CREATE TABLE table_11545282_18 (
position VARCHAR,
player VARCHAR
) | Which position does John Starks play? | SELECT position FROM table_11545282_18 WHERE player = "John Starks" | sql_create_context |
CREATE TABLE table_203_385 (
id number,
"material" text,
"formula" text,
"refractive\nindex(es)\n589.3 nm" text,
"dispersion\n431 - 687 nm" number,
"hardness\n(mohs'\nscale)" text,
"density\n(g/cm3)" text,
"thermal\ncond." text,
"state of\nthe art" text
) | what material has a dispersion of .018 nm ? | SELECT "material" FROM table_203_385 WHERE "dispersion\n431 - 687 nm" = '0.018' | squall |
CREATE TABLE table_name_18 (
tournament VARCHAR,
opponent VARCHAR
) | Which Tournament has an Opponent of susan sloane? | SELECT tournament FROM table_name_18 WHERE opponent = "susan sloane" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id... | what are the four most commonly given microbiological tests for patients who had previously received exc/dest hrt lesion open during the same month until 1 year ago? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... | mimic_iii |
CREATE TABLE table_224672_2 (
term_ended VARCHAR,
term_began VARCHAR
) | When did the term end that began December 4, 1978? | SELECT term_ended FROM table_224672_2 WHERE term_began = "December 4, 1978" | sql_create_context |
CREATE TABLE table_180802_3 (
thai_name VARCHAR,
transcription VARCHAR
) | What is the thai name of the transcription wan chan? | SELECT thai_name FROM table_180802_3 WHERE transcription = "wan chan" | sql_create_context |
CREATE TABLE table_29306 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | Who replaced the previous manager of Altay? | SELECT "Replaced by" FROM table_29306 WHERE "Team" = 'Altay' | wikisql |
CREATE TABLE table_15861776_1 (
no_in_series VARCHAR,
tv_broadcast VARCHAR
) | What episode in the series is TV broadcast s03e20? | SELECT no_in_series FROM table_15861776_1 WHERE tv_broadcast = "S03E20" | sql_create_context |
CREATE TABLE table_17323042_11 (
score VARCHAR,
high_points VARCHAR
) | What was the score and game outcome when High Points was andre miller (17)? | SELECT score FROM table_17323042_11 WHERE high_points = "Andre Miller (17)" | sql_create_context |
CREATE TABLE table_204_383 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which nation came in last place ? | SELECT "nation" FROM table_204_383 ORDER BY "rank" DESC LIMIT 1 | squall |
CREATE TABLE table_28387 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. Viewers (millions)" text
) | What are the original air date(s) for 'gunplay'? | SELECT "Original air date" FROM table_28387 WHERE "Title" = 'Gunplay' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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
)
CR... | had there been any organism found in the last mrsa screen microbiology test of patient 6374 in the last hospital encounter? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6374 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'mrsa screen' AND NOT microbiologyevents.... | mimic_iii |
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
)
... | how many patients whose discharge location is home and days of hospital stay is greater than 14? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "14" | mimicsql_data |
CREATE TABLE table_22815568_1 (
status VARCHAR,
poverty_rate VARCHAR
) | What is the status of the county that has a 14.7% poverty rate? | SELECT status FROM table_22815568_1 WHERE poverty_rate = "14.7%" | sql_create_context |
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... | when did patient 016-18575 last come to the hospital since 1 year ago through the direct admit? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '016-18575' AND patient.hospitaladmitsource = 'direct admit' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_200_44 (
id number,
"name" text,
"term start" text,
"term end" text
) | when did armando armani 's term end ? | SELECT "term end" FROM table_200_44 WHERE "name" = 'armando armani' | squall |
CREATE TABLE table_name_63 (
best VARCHAR,
name VARCHAR
) | What was Dan Selznick best time? | SELECT best FROM table_name_63 WHERE name = "dan selznick" | sql_create_context |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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,... | 参考值在检验结果指标记录14290376283上有什么范围、范围下限和上限是什么? | SELECT jyjgzbb.CKZFWDX, jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '14290376283' | css |
CREATE TABLE table_55191 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which team played against North Melbourne as the home team? | SELECT "Home team" FROM table_55191 WHERE "Away team" = 'north melbourne' | wikisql |
CREATE TABLE table_name_43 (
loss INTEGER,
gp_gs VARCHAR,
gain VARCHAR
) | What's the total loss for a GP-GS of 8-8 and a gain less than 416? | SELECT SUM(loss) FROM table_name_43 WHERE gp_gs = "8-8" AND gain < 416 | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 张承悦这位患者自04.12.30起,到08.2.28止,到医院就诊的次数是多少 | SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '张承悦' AND txmzjzjlb.JZKSRQ BETWEEN '2004-12-30' AND '2008-02-28' UNION SELECT COUNT(*) FROM p... | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | list the ids of patients who were diagnosed with dvt - related to vascular catheter in this year. | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'dvt - related to vascular catheter' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) | eicu |
CREATE TABLE table_2374338_2 (
germans VARCHAR,
slovaks VARCHAR
) | How many values for Germans occurs when value for Slovaks is 0.11%? | SELECT COUNT(germans) FROM table_2374338_2 WHERE slovaks = "0.11%" | sql_create_context |
CREATE TABLE table_name_91 (
competition VARCHAR,
venue VARCHAR,
score VARCHAR
) | What competition was at pusk s ferenc stadium , budapest , hungary, and a Score of 1 0? | SELECT competition FROM table_name_91 WHERE venue = "puskás ferenc stadium , budapest , hungary" AND score = "1–0" | sql_create_context |
CREATE TABLE table_29542147_2 (
l INTEGER
) | What is the highest L of the tournament? | SELECT MAX(l) FROM table_29542147_2 | sql_create_context |
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE instruments (
songid number,
bandmateid number,
instrument text
)
CREATE TABLE tracklists (
albumid number,
position number,
songid number
)
CREATE TABLE band (
id number,
firstnam... | Find the name of songs that does not have a back vocal. | SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE type = "back" | spider |
CREATE TABLE table_12217 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What player has 1 as the place? | SELECT "Player" FROM table_12217 WHERE "Place" = '1' | wikisql |
CREATE TABLE table_53380 (
"Rider" text,
"Horse" text,
"Time ( s )" text,
"Faults" text,
"Total time ( s )" text,
"Points" real
) | What is the total time (s) for the horse Pinot Grigio? | SELECT "Total time ( s )" FROM table_53380 WHERE "Horse" = 'pinot grigio' | 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... | 在13年3月19到13年9月25的这几个月,共有多少患者在医疗机构9085196的特需门诊就诊 | SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.ZSEBZ = '9085196' AND ftxmzjzjlb.JZKSRQ BETWEEN '2013-03-19' AND '2013-09-25' | css |
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 (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | give me the number of patients whose death status is 0 and procedure short title is int insert lead in vent? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Int insert lead in vent" | mimicsql_data |
CREATE TABLE table_7866 (
"Year" real,
"Country" text,
"Champion" text,
"Total score" text,
"To Par [a ]" text
) | When the champion was Gay Brewer Category:Articles with hCards what was the total score? | SELECT "Total score" FROM table_7866 WHERE "Champion" = 'gay brewer category:articles with hcards' | wikisql |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airport (
airport_code varchar,
airp... | can you show me the cheapest round trip flights between DENVER and PITTSBURGH | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... | atis |
CREATE TABLE table_18501 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | how many first elected with incumbent being william c. lantaff | SELECT COUNT("First elected") FROM table_18501 WHERE "Incumbent" = 'William C. Lantaff' | wikisql |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
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 ... | 编号为89963549的病患的检验报告单的报告日期在15年3月17日之前的是在哪些门诊就诊的?列出门诊就诊的流水号 | SELECT mzjzjlb.JZLSH 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_info_mzj... | css |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of last_name and department_id , and I want to show in asc by the LAST_NAME. | SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME | nvbench |
CREATE TABLE table_39367 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the December game that led to an 11-13-5 record? | SELECT MAX("December") FROM table_39367 WHERE "Record" = '11-13-5' | wikisql |
CREATE TABLE publication (
Publication_Date VARCHAR,
Price VARCHAR
) | List the publication dates of publications with 3 lowest prices. | SELECT Publication_Date FROM publication ORDER BY Price LIMIT 3 | sql_create_context |
CREATE TABLE table_name_86 (
grid VARCHAR,
driver VARCHAR,
laps VARCHAR
) | Tell me the total number of Grid for Bob Evans and Laps less than 68 | SELECT COUNT(grid) FROM table_name_86 WHERE driver = "bob evans" AND laps < 68 | sql_create_context |
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,
movie_id text
)
CREATE TABLE book_club (
book_club_id int,
Year int,
Author_or_Editor text,
Book_Title text,
Publisher text,
Category tex... | Show all book categories and the number of books in each category with a bar chart, and I want to sort by the X in asc. | SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY Category | nvbench |
CREATE TABLE technician (
Name VARCHAR,
technician_ID VARCHAR
)
CREATE TABLE repair_assignment (
technician_ID VARCHAR
) | Show names of technicians and the number of machines they are assigned to repair. | SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name | sql_create_context |
CREATE TABLE table_204_958 (
id number,
"episode" number,
"original broadcast date" text,
"average" number,
"rank" number,
"remarks" text
) | name the episode that ha the same average as number 5 . | SELECT "episode" FROM table_204_958 WHERE "episode" <> 5 AND "average" = (SELECT "average" FROM table_204_958 WHERE "episode" = 5) | 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, find name and the sum of price , and group by attribute name, and visualize them by a bar chart, and sort from high to low by the names. | SELECT T1.Name, T1.Price 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 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... | 在2010年12月7日到2019年8月7日期间内名叫韩文惠的参保人的门诊西药费是多些啊? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_SEX = '韩文惠' AND t_kc22.STA_DATE BETWEEN '2010-12-07' AND '2019-08-07' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_64631 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
) | What's the location of the team Peter Stuyvesant International Racing? | SELECT "City / State" FROM table_64631 WHERE "Team" = 'peter stuyvesant international racing' | wikisql |
CREATE TABLE table_name_64 (
finale INTEGER,
chinese_title VARCHAR
) | What is the Total Finale of ? | SELECT SUM(finale) FROM table_name_64 WHERE chinese_title = "女人唔易做" | sql_create_context |
CREATE TABLE table_71669 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" text
) | What Gender are the schools that have a Roll of 135? | SELECT "Gender" FROM table_71669 WHERE "Roll" = '135' | wikisql |
CREATE TABLE table_31460 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the record for december 3? | SELECT "Record" FROM table_31460 WHERE "Date" = 'December 3' | 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... | how many patients were admitted before the year 2179 with 99591 as the diagnosis icd9 code? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2179" AND diagnoses.icd9_code = "99591" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose admission type is emergency and lab test name is rbc, pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "RBC, Pleural" | mimicsql_data |
CREATE TABLE table_28211674_3 (
mixed_restricted VARCHAR,
mens_singles VARCHAR
) | When Matt Ware won the mens singles, who won the mixed restricted? | SELECT mixed_restricted FROM table_28211674_3 WHERE mens_singles = "Matt Ware" | sql_create_context |
CREATE TABLE table_name_72 (
iata VARCHAR,
country VARCHAR,
icao VARCHAR
) | What is the IATA when France was the country, and the ICAO was lfrn? | SELECT iata FROM table_name_72 WHERE country = "france" AND icao = "lfrn" | sql_create_context |
CREATE TABLE table_name_5 (
distance VARCHAR,
stage VARCHAR
) | Name the distance for stage of 2 | SELECT distance FROM table_name_5 WHERE stage = "2" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | when patient 002-17348 was first discharged from the hospital in 2100? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '002-17348' AND STRFTIME('%y', patient.hospitaldischargetime) = '2100' ORDER BY patient.hospitaldischargetime LIMIT 1 | eicu |
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... | what is the number of patients whose diagnoses long title is osteoarthrosis, unspecified whether generalized or localized, site unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Osteoarthrosis, unspecified whether generalized or localized, site unspecified" | mimicsql_data |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
... | what is the number of patients who received a antiemetic - serotonin antagonist procedure within 2 months after having received a neurosurgery consultation procedure until 4 years ago? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'neurosurgery consultation' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-4 year')) AS ... | eicu |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | what are the three most common diagnoses of patients in the age of 20s since 3 years ago? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 yea... | eicu |
CREATE TABLE table_51845 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | I want the total number of people in the crowd for essendon home team | SELECT COUNT("Crowd") FROM table_51845 WHERE "Home team" = 'essendon' | wikisql |
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... | 患有疾病L29.482的病患开出的药品的编号和名称分别都是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.IN_DIAG_DIS_CD = 'L29.482' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.IN_DIAG_DIS_CD = 'L29.482' UN... | css |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | Show different types of ships and the number of ships of each type. Show bar chart. | SELECT Type, COUNT(*) FROM ship GROUP BY Type | nvbench |
CREATE TABLE table_79948 (
"Date" text,
"City" text,
"Event" text,
"Winner" text,
"Prize" text
) | What city was the event in when Patrik Antonius won? | SELECT "City" FROM table_79948 WHERE "Winner" = 'patrik antonius' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Give me the comparison about meter_100 over the meter_500 by a bar chart. | SELECT meter_500, meter_100 FROM swimmer | nvbench |
CREATE TABLE table_203_374 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | if a man 's nationality was from belgium , how many medals total has his country won ? | SELECT "total" FROM table_203_374 WHERE "nation" = 'belgium' | squall |
CREATE TABLE table_name_50 (
platform_s_ VARCHAR,
game VARCHAR
) | Which platform was Red Dead Redemption for? | SELECT platform_s_ FROM table_name_50 WHERE game = "red dead redemption" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | when was patient 029-8147 until 2103 last diagnosed with acute respiratory failure - drug related? | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-8147')) AND diagnosis.diagnosisname = 'acute respiratory fail... | eicu |
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,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For all employees who have the letters D or S in their first name, show me about the change of employee_id over hire_date in a line chart, and list by the x-axis from low to high. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_name_23 (
opponent_in_the_final VARCHAR,
surface VARCHAR,
score VARCHAR
) | In the surface of clay who was the opponent in the game resulting in a score of 6 4, 6 4? | SELECT opponent_in_the_final FROM table_name_23 WHERE surface = "clay" AND score = "6–4, 6–4" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 患者82905019在2000年9月22日到2002年6月22日内有多少就诊医生? | SELECT COUNT(DISTINCT mzjzjlb.ZZYSGH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '82905019' AND mzjzjlb.JZKSRQ BETWEEN '2000-09-22' AND '2002-06-22' | css |
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 EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
E... | How many students taking a course who received an A or C? Group by students' last name with a bar chart, and sort in ascending by the x axis please. | SELECT STU_LNAME, COUNT(STU_LNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_LNAME ORDER BY STU_LNAME | nvbench |
CREATE TABLE table_name_78 (
country VARCHAR,
year_s__won VARCHAR
) | From which country is the player that won in 1998? | SELECT country FROM table_name_78 WHERE year_s__won = "1998" | sql_create_context |
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 ... | 列出患者水兴平入院科室名称不包含免疫的住院就诊记录在医院5237390中有什么? | 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 = '5237390' AND NOT zyjzjlb.JZKSMC LIKE '%免疫%' | css |
CREATE TABLE table_name_84 (
origin VARCHAR,
chart_no VARCHAR
) | What is origin country for a title that charted at 52? | SELECT origin FROM table_name_84 WHERE chart_no = 52 | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | what was the last time patient 54825 received a prescription for aspirin ec, in 12/last year? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND prescriptions.drug = 'aspirin ec' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIM... | mimic_iii |
CREATE TABLE CUSTOMER (
FirstName VARCHAR,
SupportRepId VARCHAR
)
CREATE TABLE EMPLOYEE (
EmployeeId VARCHAR
) | Please show the employee first names and ids of employees who serve at least 10 customers. | SELECT T1.FirstName, T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10 | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate tim... | Users with ongoing suspension (fast). | SELECT Id AS "user_link", * FROM Users WHERE DownVotes > 0 AND Reputation = 1 AND Id > 0 | sede |
CREATE TABLE table_13336122_5 (
original_air_date VARCHAR,
written_by VARCHAR
) | what is the original air date for the episoe written by vanessa reisen? | SELECT original_air_date FROM table_13336122_5 WHERE written_by = "Vanessa Reisen" | sql_create_context |
CREATE TABLE table_2930244_4 (
deaths VARCHAR,
number_of_hurricanes VARCHAR,
number_of_major_hurricanes VARCHAR
) | How many deaths did the year with 10 hurricanes and exactly 1 major hurricane have? | SELECT deaths FROM table_2930244_4 WHERE number_of_hurricanes = 10 AND number_of_major_hurricanes = 1 | sql_create_context |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPriv... | Questions I've answered and closed. Questions that a user has both answered and successfully voted to close. | SELECT DISTINCT Answer.ParentId AS "post_link" FROM Posts AS Answer JOIN Votes AS CloseVote ON CloseVote.PostId = Answer.ParentId WHERE Answer.PostTypeId = 2 AND CloseVote.VoteTypeId = 6 AND CloseVote.UserId = Answer.OwnerUserId | sede |
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... | 1031443这个医疗机构在04年1月3日到2021年7月10日期间它的患者平均住院时间是多久? | SELECT AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1031443' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-01-03' AND '2021-07-10' | css |
CREATE TABLE table_37790 (
"County" text,
"Irish name" text,
"County town" text,
"Most populous city/town" text,
"Province" text,
"Region" text
) | Irish name of an d n (contae an d in) has what county town? | SELECT "County town" FROM table_37790 WHERE "Irish name" = 'an dún (contae an dúin)' | wikisql |
CREATE TABLE table_name_91 (
torque VARCHAR,
model VARCHAR
) | Which Torque has a Model of s63 amg ('01)? | SELECT torque FROM table_name_91 WHERE model = "s63 amg ('01)" | sql_create_context |
CREATE TABLE table_name_12 (
first_elected INTEGER,
incumbent VARCHAR
) | What is the first elected for Jo Bonner? | SELECT MIN(first_elected) FROM table_name_12 WHERE incumbent = "jo bonner" | sql_create_context |
CREATE TABLE table_204_198 (
id number,
"club" text,
"nickname" text,
"no. of premierships" number,
"premiership years" text,
"moved to" text
) | four corners has 13 premierships listed , what was their nickname ? | SELECT "nickname" FROM table_204_198 WHERE "club" = 'four corners' | squall |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | Plot the average of age by grouped by home city as a bar graph, could you sort by the bar from high to low? | SELECT Home_city, AVG(Age) FROM driver GROUP BY Home_city ORDER BY Home_city DESC | nvbench |
CREATE TABLE table_name_95 (
races VARCHAR,
chassis VARCHAR,
engine VARCHAR
) | Which person drove a Reynard 2ki with a Honda Hrk engine? | SELECT races FROM table_name_95 WHERE chassis = "reynard 2ki" AND engine = "honda hrk" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.