context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | what is the number of patients whose lab test abnormal status is abnormal and lab test name is phenytoin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Phenytoin" | mimicsql_data |
CREATE TABLE table_45860 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | What surface was played on when Piet Norval was a partner? | SELECT "Surface" FROM table_45860 WHERE "Partner" = 'piet norval' | wikisql |
CREATE TABLE table_23125 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Name the least pick # for doug gibson | SELECT MIN("Pick #") FROM table_23125 WHERE "Player" = 'Doug Gibson' | wikisql |
CREATE TABLE table_name_46 (
sr VARCHAR,
average VARCHAR,
runs_scored VARCHAR
) | Which S.R. has a Average smaller than 23.63 Runs Scored of 49? | SELECT sr FROM table_name_46 WHERE average < 23.63 AND runs_scored = 49 | sql_create_context |
CREATE TABLE table_25316812_1 (
rate_limit__p_ VARCHAR,
desired_rate__p_ VARCHAR
) | What is the rate limit when the desired rate (p) is 162? | SELECT rate_limit__p_ FROM table_25316812_1 WHERE desired_rate__p_ = "162" | sql_create_context |
CREATE TABLE table_48774 (
"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 location and attendance after game 2, and the team New Orleans? | SELECT "Location Attendance" FROM table_48774 WHERE "Game" > '2' AND "Team" = 'new orleans' | wikisql |
CREATE TABLE table_20872 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
) | What position(s) do players from bowling green play? | SELECT "Position" FROM table_20872 WHERE "School/Club Team" = 'Bowling Green' | wikisql |
CREATE TABLE table_1342292_2 (
district VARCHAR,
candidates VARCHAR
) | how many dbeingtrict with candidates being william b. bankhead (d) 71.3% e. m. reed (r) 28.7% | SELECT COUNT(district) FROM table_1342292_2 WHERE candidates = "William B. Bankhead (D) 71.3% E. M. Reed (R) 28.7%" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | among patients that were prescribed with 1000 ml flex cont: dextrose-nacl 5-0.45 % iv soln, what were the three most frequently prescribed drugs at the same time, since 2103. | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '1000 ml flex cont: dextrose-nacl 5-0.45 % iv soln' ... | eicu |
CREATE TABLE table_52085 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What team is based at junction oval? | SELECT "Home team" FROM table_52085 WHERE "Venue" = 'junction oval' | wikisql |
CREATE TABLE table_27399 (
"Season" text,
"Games" real,
"Won" real,
"Lost" real,
"Tied" real,
"Points" real,
"Goals for" real,
"Goals against" real,
"Standing" text
) | Name the number of won for goals for being 274 | SELECT COUNT("Won") FROM table_27399 WHERE "Goals for" = '274' | wikisql |
CREATE TABLE table_17328 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the attendance on March 17? | SELECT "Location Attendance" FROM table_17328 WHERE "Date" = 'March 17' | 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,
... | 06549947患者在医疗就诊47830031147里,所有开具医疗项目的医师的编号是什么?叫什么姓名? | SELECT t_kc22.HOSP_DOC_CD, t_kc22.HOSP_DOC_NM 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 = '47830031147' | css |
CREATE TABLE table_3902 (
"Standard" text,
"Date" text,
"CO (g/kWh)" text,
"NO x (g/kWh)" text,
"HC (g/kWh)" text,
"PM (g/kWh)" text
) | What's the HC for the Euro I standard? | SELECT "HC (g/kWh)" FROM table_3902 WHERE "Standard" = 'Euro I' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,... | what is the unabbreviated version of the tb esophagus-histo dx? | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'tb esophagus-histo dx' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'tb esophagus-histo dx' | mimic_iii |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE ground_service (
... | PHOENIX to MILWAUKEE on wednesday | 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 = 'MILWAUKEE' AND date_day.day_number = 23 AND date_day.month_number = 4 AND... | atis |
CREATE TABLE table_3959 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What episode number of the season was written by Tom Garrigus and had 2.31 million u.s. viewers? | SELECT MAX("Season #") FROM table_3959 WHERE "U.S. viewers (million)" = '2.31' AND "Written by" = 'Tom Garrigus' | wikisql |
CREATE TABLE table_65634 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | What was the platform of Red Dead Redemption? | SELECT "Platform(s)" FROM table_65634 WHERE "Game" = 'red dead redemption' | wikisql |
CREATE TABLE table_name_66 (
young_rider_classification VARCHAR,
mountains_classification VARCHAR,
stage VARCHAR
) | What is the young rider classification for jesper worre and stage 3 | SELECT young_rider_classification FROM table_name_66 WHERE mountains_classification = "jesper worre" AND stage = "3" | sql_create_context |
CREATE TABLE table_name_3 (
call_sign VARCHAR,
erp_w VARCHAR,
frequency_mhz VARCHAR
) | Which call sign has ERP Wlarger than 250, and Frequency MHZ smaller than 99.3? | SELECT call_sign FROM table_name_3 WHERE erp_w > 250 AND frequency_mhz < 99.3 | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid num... | when was the first time that during this year patient 005-77687 was diagnosed with acute copd exacerbation. | 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 = '005-77687')) AND diagnosis.diagnosisname = 'acute copd exacerbati... | eicu |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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... | For those employees who was hired before 2002-06-21, visualize a scatter chart about the correlation between salary and manager_id . | SELECT SALARY, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE Drama_Workshop_Groups (
Workshop_Group_ID INTEGER,
Address_ID INTEGER,
Currency_Code CHAR(15),
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Customers (
Cust... | Show all the planned delivery dates and bin by year in a line chart, could you rank by the x-axis in ascending please? | SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings ORDER BY Planned_Delivery_Date | nvbench |
CREATE TABLE table_name_41 (
total INTEGER,
games VARCHAR,
silver VARCHAR
) | What is the average medal total of the country who had 0 silver medals and participated in less than 15 games? | SELECT AVG(total) FROM table_name_41 WHERE games < 15 AND silver < 0 | sql_create_context |
CREATE TABLE table_28590 (
"Engine Family" text,
"Cylinder Layout" text,
"Displacement(s)" text,
"Injection type" text,
"Years produced" text
) | The years produced for the cylinder layout v8 are what? | SELECT "Years produced" FROM table_28590 WHERE "Cylinder Layout" = 'V8' | wikisql |
CREATE TABLE table_29394 (
"Model Number" text,
"Frequency" text,
"L2 Cache" text,
"HT" text,
"Mult. 1" text,
"Voltage" text,
"TDP" text,
"Socket" text,
"Release date" text,
"Order Part Number" text
) | What is the oder part number for the model with 10x mult. 1? | SELECT "Order Part Number" FROM table_29394 WHERE "Mult. 1" = '10x' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | what are the four most frequent diagnoses that patients received in the same hospital encounter after receiving a anticonvulsants - midazolam since 2103? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antic... | eicu |
CREATE TABLE table_name_54 (
player VARCHAR,
position VARCHAR
) | Who plays halfback? | SELECT player FROM table_name_54 WHERE position = "halfback" | sql_create_context |
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 demographic ... | get the short title as well as the icd9 code of diagnoses for patient with patient id 55094. | SELECT diagnoses.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "55094" | mimicsql_data |
CREATE TABLE table_16295 (
"Season" text,
"Series" text,
"Team Name" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | how much did the british formula three called 'fortec motorsport' score? | SELECT "Points" FROM table_16295 WHERE "Series" = 'British Formula Three' AND "Team Name" = 'Fortec Motorsport' | wikisql |
CREATE TABLE table_27343 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. Viewers (in millions)" text
) | if the 2.09 million US viewers watched this episode, who was it written by | SELECT "Written by" FROM table_27343 WHERE "U.S. Viewers (in millions)" = '2.09' | wikisql |
CREATE TABLE table_17369472_2 (
won VARCHAR,
points VARCHAR
) | How many were won when the points were 12? | SELECT COUNT(won) FROM table_17369472_2 WHERE points = "12" | 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... | what was the daily maximum value of weight for patient 017-88691 on their current hospital encounter? | SELECT MAX(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL GROUP BY STRFTIME('%y-%m-%d', patient.unitadmittime) | eicu |
CREATE TABLE table_7017 (
"Year" text,
"Team" text,
"SckY" text,
"Int%" text,
"Rate" text,
"RAtt" text,
"RYds" text,
"RAvg" text,
"RLng" text,
"R1st" text
) | What team had a Ravg of 3.4? | SELECT "Team" FROM table_7017 WHERE "RAvg" = '3.4' | wikisql |
CREATE TABLE table_64178 (
"Position" real,
"Gymnast" text,
"A Score" real,
"B Score" real,
"Total" real
) | What is the total for Chen Yibing ( chn ), when his B Score was smaller than 9.225? | SELECT COUNT("Total") FROM table_64178 WHERE "Gymnast" = 'chen yibing ( chn )' AND "B Score" < '9.225' | wikisql |
CREATE TABLE table_22104 (
"Rank" real,
"Airport Name" text,
"Location" text,
"IATA Code" text,
"Tonnes" text,
"% Chg. 2010/11" text
) | Which airport has an IATA Code of ORD? | SELECT "Airport Name" FROM table_22104 WHERE "IATA Code" = 'ORD' | wikisql |
CREATE TABLE table_24012 (
"Stations" text,
"Connections" text,
"City/ Neighborhood" text,
"Parking" text,
"Date Opened" text
) | What are the stations in Tarzana? | SELECT "Stations" FROM table_24012 WHERE "City/ Neighborhood" = 'Tarzana' | wikisql |
CREATE TABLE table_39155 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Game has a Record of 8 2 0, and Points larger than 16? | SELECT SUM("Game") FROM table_39155 WHERE "Record" = '8–2–0' AND "Points" > '16' | wikisql |
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... | 病患号码是47642343的那个人在其医疗记录里被开出的药品均超出748.1元有多少次?以及具体的编号是多少? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '47642343' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 748.1) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '47642343' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc... | css |
CREATE TABLE table_52796 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Tell me the total number of Grid for Time/Retired of +2 Laps and Laps less than 70 | SELECT COUNT("Grid") FROM table_52796 WHERE "Time/Retired" = '+2 laps' AND "Laps" < '70' | wikisql |
CREATE TABLE table_10891 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many silver medals are there with 3 gold medals at a rank above 1? | SELECT COUNT("Silver") FROM table_10891 WHERE "Gold" = '3' AND "Rank" > '1' | wikisql |
CREATE TABLE table_name_85 (
stadium VARCHAR,
visiting_team VARCHAR
) | At which stadium did the Los Angeles Raiders play as the visiting team? | SELECT stadium FROM table_name_85 WHERE visiting_team = "los angeles raiders" | sql_create_context |
CREATE TABLE table_28621502_1 (
title VARCHAR,
publisher VARCHAR
) | Which titles have been published by Gamehouse Live? | SELECT title FROM table_28621502_1 WHERE publisher = "GameHouse Live" | sql_create_context |
CREATE TABLE table_30998 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | Lis the series for game 5. | SELECT "Series" FROM table_30998 WHERE "Game" = '5' | wikisql |
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... | 患者尤永年被门诊诊断为疾病I64.781,他的检测指标661673的结果定量及单位是怎么样的 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb 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 AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ... | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | how many patients with medicare insurance are diagnosed with icd9 code 2851? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.icd9_code = "2851" | mimicsql_data |
CREATE TABLE table_name_77 (
head_s__of_government VARCHAR,
name VARCHAR
) | What is the head of government for Don Stephen Senanayake? | SELECT head_s__of_government FROM table_name_77 WHERE name = "don stephen senanayake" | sql_create_context |
CREATE TABLE table_name_41 (
district VARCHAR,
name VARCHAR
) | What district has abhayapuri south as the name? | SELECT district FROM table_name_41 WHERE name = "abhayapuri south" | sql_create_context |
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... | what was the name of the allergy that was patient 021-111547 had in this month? | SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547')) AND DATETIME(allergy.allergytime, 'start of month') = DATET... | eicu |
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 of the patients tested for ascites were born before 2184? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2184" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE diagnoses_i... | how many times has patient 1784 produced an urine . output today? | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1784)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine .' AND d_item... | mimic_iii |
CREATE TABLE table_name_59 (
round INTEGER,
nationality VARCHAR,
position VARCHAR
) | What is the highest round of a player from Sweden who plays right wing? | SELECT MAX(round) FROM table_name_59 WHERE nationality = "sweden" AND position = "right wing" | sql_create_context |
CREATE TABLE table_203_40 (
id number,
"p.s. #" number,
"school name" text,
"neighborhood" text,
"low grade" text,
"high grade" number,
"year closed" text,
"building status" text
) | which school was in the columbus neighborhood and was demolished ? | SELECT "school name" FROM table_203_40 WHERE "neighborhood" = 'columbus' AND "building status" = 'demolished' | squall |
CREATE TABLE table_42795 (
"Name" text,
"Position" text,
"Number" real,
"Season" text,
"Acquisition via" text
) | What is the Acquisition that has less than 22, in the 2002 season? | SELECT "Acquisition via" FROM table_42795 WHERE "Number" < '22' AND "Season" = '2002' | wikisql |
CREATE TABLE table_name_81 (
qaxmuğal VARCHAR,
fıstıqlı VARCHAR
) | What is the Qaxmu al village with a Fistiqli village ke qutan? | SELECT qaxmuğal FROM table_name_81 WHERE fıstıqlı = "keşqutan" | sql_create_context |
CREATE TABLE table_name_13 (
losses VARCHAR,
team VARCHAR
) | What losses consist of the team of japan? | SELECT losses FROM table_name_13 WHERE team = "japan" | sql_create_context |
CREATE TABLE Products (
product_id INTEGER,
product_category VARCHAR(15),
product_name VARCHAR(80)
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_method VARCHAR(15),
customer_name VARCHAR(80),
customer_phone VARCHAR(80),
customer_email VARCHAR(80),
customer_address VARCHAR(... | Show all distinct product categories along with the number of mailshots in each category Visualize by bar chart, rank x-axis from high to low order please. | SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category ORDER BY product_category DESC | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid ... | calculate the three year survival rate of those who were diagnosed with peptic ulcer disease - duodenal. | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE EMPLOYEE... | How many professors whose office is located in DRE 102 are hired in each month? Return a bar chart, list by the how many emp hiredate in asc. | SELECT EMP_HIREDATE, COUNT(EMP_HIREDATE) FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM WHERE T2.PROF_OFFICE = 'DRE 102' ORDER BY COUNT(EMP_HIREDATE) | nvbench |
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge... | Show different nationalities along with the number of hosts of each nationality Visualize by bar chart, and show from high to low by the X. | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality DESC | nvbench |
CREATE TABLE table_54112 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the Time/Retired for laps higher than 52 on a grid larger than 21? | SELECT "Time/Retired" FROM table_54112 WHERE "Laps" > '52' AND "Grid" > '21' | wikisql |
CREATE TABLE Procedures (
Code INTEGER,
Name VARCHAR(30),
Cost REAL
)
CREATE TABLE Physician (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
SSN INTEGER
)
CREATE TABLE Department (
DepartmentID INTEGER,
Name VARCHAR(30),
Head INTEGER
)
CREATE TABLE On_Call (
... | List the number of the names of patients who have made appointments, list by the bars in asc. | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE table_38619 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the average drawn of the team with a difference of 4 and more than 13 losses? | SELECT AVG("Drawn") FROM table_38619 WHERE "Difference" = '4' AND "Lost" > '13' | wikisql |
CREATE TABLE table_19790 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | How many mixed doubles were won in 1996? | SELECT COUNT("Mixed doubles") FROM table_19790 WHERE "Year" = '1996' | wikisql |
CREATE TABLE table_204_145 (
id number,
"representative" text,
"state" text,
"district(s)" text,
"served" text,
"party" text,
"date of birth" text,
"date of death" text,
"age" text
) | what was the average age of the first three on the list ? | SELECT AVG("age") FROM table_204_145 WHERE id <= 3 | squall |
CREATE TABLE table_60253 (
"Name" text,
"Volume" text,
"Engine" text,
"Fuel" text,
"Output" text,
"Torque" text,
"Engine ID code(s)" text,
"0\u2013100km/h,s" real,
"Top speed" text,
"Years" text
) | What is the 0 100km/h,s for the output of ps (kw; hp) @4000 rpm? | SELECT COUNT("0\u2013100km/h,s") FROM table_60253 WHERE "Output" = 'ps (kw; hp) @4000 rpm' | wikisql |
CREATE TABLE table_33729 (
"Date" text,
"Venue" text,
"Result" text,
"Goals" real,
"Competition" text
) | What is the result from March 14, 2007? | SELECT "Result" FROM table_33729 WHERE "Date" = 'march 14, 2007' | wikisql |
CREATE TABLE table_name_10 (
director_s_ VARCHAR,
award VARCHAR
) | Who directed the film that received an award of 6,245? | SELECT director_s_ FROM table_name_10 WHERE award = "£6,245" | sql_create_context |
CREATE TABLE hotels (
hotel_id number,
star_rating_code text,
pets_allowed_yn text,
price_range number,
other_hotel_details text
)
CREATE TABLE visitors (
tourist_id number,
tourist_details text
)
CREATE TABLE tourist_attractions (
tourist_attraction_id number,
attraction_type_code... | Find the the names of the tourist attractions that the tourist named Alison visited but Rosalind did not visit. | SELECT T1.name FROM tourist_attractions AS T1 JOIN visitors AS T2 JOIN visits AS T3 ON T1.tourist_attraction_id = T3.tourist_attraction_id AND T2.tourist_id = T3.tourist_id WHERE T2.tourist_details = "Alison" EXCEPT SELECT T1.name FROM tourist_attractions AS T1 JOIN visitors AS T2 JOIN visits AS T3 ON T1.tourist_attrac... | spider |
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, a scatter chart shows the correlation between price and revenue . | SELECT Price, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE table_55591 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | When Team 1 is Aalborg BK, what is the 1st Leg? | SELECT "1st leg" FROM table_55591 WHERE "Team 1" = 'aalborg bk' | wikisql |
CREATE TABLE customers (
customer_id number,
customer_address_id number,
customer_status_code text,
date_became_customer time,
date_of_birth time,
first_name text,
last_name text,
amount_outstanding number,
email_address text,
phone_number text,
cell_mobile_phone_number text
... | When did the staff member Janessa Sawayn leave the company? | SELECT date_left_staff FROM staff WHERE first_name = "Janessa" AND last_name = "Sawayn" | spider |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | what is the total volume of output patient 002-58565 had? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-58565')) AND intakeoutput.cellpath LIKE '%ou... | eicu |
CREATE TABLE table_name_61 (
team_2 VARCHAR,
team_1 VARCHAR
) | What is team 2 if Team 1 is Numancia? | SELECT team_2 FROM table_name_61 WHERE team_1 = "numancia" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | show me the four year survival rate of patients who were prescribed buminate after they were diagnosed with dementia? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | For all employees who have the letters D or S in their first name, give me the comparison about the average of department_id over the hire_date bin hire_date by weekday by a bar chart, sort from high to low by the y-axis. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_name_75 (
score VARCHAR,
team_2 VARCHAR
) | When Team 2 was USL Dunkerque (D2), what was the score | SELECT score FROM table_name_75 WHERE team_2 = "usl dunkerque (d2)" | sql_create_context |
CREATE TABLE table_name_33 (
game VARCHAR,
home_team VARCHAR,
result VARCHAR
) | Home Team of chicago bulls, and a Result of 81-83 (3-2) involved what game? | SELECT game FROM table_name_33 WHERE home_team = "chicago bulls" AND result = "81-83 (3-2)" | sql_create_context |
CREATE TABLE table_name_20 (
bronze VARCHAR,
silver VARCHAR,
nation VARCHAR
) | What is Bronze, when Silver is 2, and when Nation is Italy? | SELECT bronze FROM table_name_20 WHERE silver = "2" AND nation = "italy" | sql_create_context |
CREATE TABLE table_70928 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What the air dates for the episodes are episode 3 in the series? | SELECT "Original air date" FROM table_70928 WHERE "No. in series" > '3' | wikisql |
CREATE TABLE table_204_130 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | what is the first score listed ? | SELECT "score" FROM table_204_130 WHERE id = 1 | squall |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id num... | Total number of downvoted posts. | SELECT COUNT(*) FROM Posts JOIN Votes ON Votes.PostId = Posts.Id WHERE VoteTypeId = 3 | sede |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTas... | Top Sri Lankans in Stackoverflow. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Sri%' ORDER BY Reputation DESC LIMIT 300 | sede |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 2005年2月16日到2008年10月12日期间患者水嘉瑞所有检验报告单中的标本采集部位可以告诉我都在哪里吗? | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '水嘉瑞' AND jy... | css |
CREATE TABLE table_name_20 (
category VARCHAR,
year VARCHAR,
for_the_show VARCHAR
) | What category was Kasautii Zindagii Kay nominated for after 2005? | SELECT category FROM table_name_20 WHERE year > 2005 AND for_the_show = "kasautii zindagii kay" | sql_create_context |
CREATE TABLE table_203_184 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"attendance" text
) | how many points did leicester city score ? | SELECT (SELECT "score" FROM table_203_184 WHERE "home team" = 'leicester city') + (SELECT "score" FROM table_203_184 WHERE "away team" = 'leicester city') | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | how many patients whose days of hospital stay is greater than 3 and procedure icd9 code is 5451? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "3" AND procedures.icd9_code = "5451" | mimicsql_data |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Cu... | Show the number of accounts for all accounts by the customer with first name 'Meaghan' opened in each day. Bin the account open day by year interval in a bar chart. | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' | nvbench |
CREATE TABLE Problem_Status_Codes (
problem_status_code VARCHAR(20),
problem_status_description VARCHAR(80)
)
CREATE TABLE Product (
product_id INTEGER,
product_name VARCHAR(80),
product_details VARCHAR(255)
)
CREATE TABLE Problem_Log (
problem_log_id INTEGER,
assigned_to_staff_id INTEGER,... | Find all the ids and dates of the logs for the problem whose id is 10 Plot them as bar chart, display from low to high by the total number. | SELECT log_entry_date, problem_log_id FROM Problem_Log WHERE problem_id = 10 ORDER BY problem_log_id | nvbench |
CREATE TABLE table_57481 (
"Name" text,
"Block" text,
"Launch date/time (UTC)" text,
"COSPAR ID" text,
"Rocket" text
) | What COSPAR ID has a Launch date/time (UTC) of 1995-11-06, 05:15:01? | SELECT "COSPAR ID" FROM table_57481 WHERE "Launch date/time (UTC)" = '1995-11-06, 05:15:01' | wikisql |
CREATE TABLE table_name_99 (
player VARCHAR,
to_club VARCHAR
) | Which player was transferred to Reggina? | SELECT player FROM table_name_99 WHERE to_club = "reggina" | sql_create_context |
CREATE TABLE table_name_68 (
to_par VARCHAR,
place VARCHAR,
player VARCHAR
) | WHAT IS THE TO PAR WITH T5 PLACE, AND PLAYER MARK MCCUMBER? | SELECT to_par FROM table_name_68 WHERE place = "t5" AND player = "mark mccumber" | sql_create_context |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | Return a histogram on how old is the average person for each job?, rank x axis in descending order. | SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job DESC | nvbench |
CREATE TABLE table_1506950_4 (
date VARCHAR,
rounds VARCHAR
) | What days were the rounds of 66-67-70-67 recorded? | SELECT date FROM table_1506950_4 WHERE rounds = "66-67-70-67" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | what was the first dose of aspirin given to patient 75762? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 75762) AND prescriptions.drug = 'aspirin' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | how many patients whose ethnicity is white - russian and diagnoses short title is chr tot occlus cor artry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND diagnoses.short_title = "Chr tot occlus cor artry" | mimicsql_data |
CREATE TABLE table_33002 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the crowd when the home team had a score of 16.21 (117)? | SELECT "Crowd" FROM table_33002 WHERE "Home team score" = '16.21 (117)' | wikisql |
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 those employees who did not have any job in the past, a scatter chart shows the correlation between salary and department_id . | SELECT SALARY, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_1171 (
"Nationality" text,
"Player" text,
"Year" real,
"Wins" real,
"Masters" text,
"U.S. Open" text,
"Open Ch." text,
"PGA Ch." text
) | What is the result at the Masters for the player who finished R16 at the PGA Ch.? | SELECT "Masters" FROM table_1171 WHERE "PGA Ch." = 'R16' | wikisql |
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,
... | 请提供检验报告单19869602899的检验技师工号以及姓名的详细信息 | SELECT jybgb.JYJSGH, jybgb.JYJSQM FROM jybgb WHERE jybgb.BGDH = '19869602899' | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.