context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_26419467_1 (
hometown VARCHAR,
fresh_meat_partner VARCHAR
) | How many cast members had sydney walker as their fresh meat partner? | SELECT COUNT(hometown) FROM table_26419467_1 WHERE fresh_meat_partner = "Sydney Walker" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 过去患者郎曼吟得过哪些疾病? | SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '郎曼吟' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '郎曼吟' | css |
CREATE TABLE table_77218 (
"Rank" text,
"Name" text,
"Location" text,
"Length ( m )" text,
"Length ( ft )" text
) | Where is the longest arch with a length in meters of 63? | SELECT "Location" FROM table_77218 WHERE "Length ( m )" = '63' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is drug type and drug code of drug name simethicone? | SELECT prescriptions.drug_type, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Simethicone" | mimicsql_data |
CREATE TABLE table_204_473 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | how long did it take jo bonnier to finish all 75 laps ? | SELECT "time/retired" FROM table_204_473 WHERE "driver" = 'jo bonnier' | squall |
CREATE TABLE table_name_90 (
school VARCHAR,
name VARCHAR
) | what is the school for Ivey armstrong? | SELECT school FROM table_name_90 WHERE name = "ivey armstrong" | sql_create_context |
CREATE TABLE table_30761 (
"Player" text,
"County" text,
"Balls" real,
"Wickets" real,
"Average" text,
"Economy" text,
"BBI" text,
"4wi" real,
"5wi" real
) | When the number of wickets is 29, what was the economy? | SELECT "Economy" FROM table_30761 WHERE "Wickets" = '29' | wikisql |
CREATE TABLE table_42577 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the Venue with a Result that is win, and a Score that is 5-0? | SELECT "Venue" FROM table_42577 WHERE "Result" = 'win' AND "Score" = '5-0' | wikisql |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | Please return me a bar chart show what are the total smallest rating of different movie title?, show in descending by the Y-axis please. | SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY SUM(MIN(T1.stars)) DESC | nvbench |
CREATE TABLE table_16634 (
"School" text,
"Location" text,
"Enrolment" real,
"Founded" real,
"Denomination" text,
"Day/Boarding" text,
"School Colours" text,
"Abbreviation" text,
"In competition since" real
) | What is the enrollment of STM which has been in competition since 1990? | SELECT COUNT("Enrolment") FROM table_16634 WHERE "In competition since" = '1990' AND "Abbreviation" = 'STM' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | how many female patients had the diagnosis short title aortic valve disorder? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Aortic valve disorder" | mimicsql_data |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 自二零零四年九月二十日开始,截止到二零二一年三月十八日,患者19598745的病历最主要是哪家医院的 | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '19598745' AND IN_HOSP_DATE BETWEEN '2004-09-20' AND '2021-03-18' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_name_97 (
replaced_by VARCHAR,
team VARCHAR
) | who is the replacement when the team is port vale? | SELECT replaced_by FROM table_name_97 WHERE team = "port vale" | sql_create_context |
CREATE TABLE table_5031 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which Time has a Round larger than 1, and an Event of total fighting alliance 2? | SELECT "Time" FROM table_5031 WHERE "Round" > '1' AND "Event" = 'total fighting alliance 2' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | Draw a bar chart about the distribution of meter_300 and ID . | SELECT meter_300, ID FROM swimmer | nvbench |
CREATE TABLE table_79209 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the names of the rowers that the time was 6:24.61? | SELECT "Rowers" FROM table_79209 WHERE "Time" = '6:24.61' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Cou... | Thank-you comment by OP without upvote. | SELECT p.CreationDate, p.Id AS "post_link", c.Text FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id INNER JOIN Posts AS q ON c.UserId = q.OwnerUserId AND p.ParentId = q.Id WHERE c.Text LIKE '%Thank%' AND p.Score = 0 ORDER BY CreationDate DESC | sede |
CREATE TABLE table_47561 (
"Malayalam" text,
"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02" text,
"English" text,
"Kannada" text,
"Tamil" text,
"Hindi" text
) | WHAT IS THE MALAYAM WITH of ? | SELECT "Malayalam" FROM table_47561 WHERE "\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02" = 'വെള്ളി' | wikisql |
CREATE TABLE instructor (
name VARCHAR,
id VARCHAR,
semester VARCHAR
)
CREATE TABLE teaches (
name VARCHAR,
id VARCHAR,
semester VARCHAR
) | Find the names of instructors who didn't each any courses in any Spring semester. | SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches WHERE semester = 'Spring') | sql_create_context |
CREATE TABLE table_name_62 (
entrant VARCHAR,
constructor VARCHAR
) | Which entrant had a constructor of benetton - playlife? | SELECT entrant FROM table_name_62 WHERE constructor = "benetton - playlife" | sql_create_context |
CREATE TABLE table_76753 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | Which Points is the highest one that has a Drawn smaller than 2, and a Name of esc holzkirchen, and Played smaller than 14? | SELECT MAX("Points") FROM table_76753 WHERE "Drawn" < '2' AND "Name" = 'esc holzkirchen' AND "Played" < '14' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | Up vs Down votes by day of week of Accepted Answer. | SELECT TIME_TO_STR(p.CreationDate, 'WEEKDA%Y') AS Day, COUNT(*) AS Amount, SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes, (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS F... | sede |
CREATE TABLE table_dev_37 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"diabetes_mellitus" bool,
"dysglycemia" bool,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"fasting_plasma_glucose" int,
"serum_creatinine" float,
"fasting_gl... | diabetes mellitus, or fasting glucose > 125 mg / dl; | SELECT * FROM table_dev_37 WHERE diabetes_mellitus = 1 OR fasting_glucose > 125 | criteria2sql |
CREATE TABLE table_name_23 (
date VARCHAR,
opponent_in_the_final VARCHAR
) | What date was the opponent in the final Barbara Paulus? | SELECT date FROM table_name_23 WHERE opponent_in_the_final = "barbara paulus" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | give me the number of patients whose days of hospital stay is greater than 26 and lab test name is lymphocytes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "26" AND lab.label = "Lymphocytes" | mimicsql_data |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | what were the top three most frequently ordered microbiology tests for patients within 2 months after receiving percu endosc gastrostomy until 2100? | 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_26871 (
"Rank" real,
"Country" text,
"Disposable USD 2011" real,
"Disposable USD growth" real,
"Compulsory deduction" text,
"Gross USD 2011" real
) | If the rank is 26, what is the disposable USD growth? | SELECT "Disposable USD growth" FROM table_26871 WHERE "Rank" = '26' | wikisql |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | Find dates and attendance for exhibitions that happened in 2004, show me the comparison of attendance by date. | SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004 | 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... | 患者姜承运在08年3月30日到2021年2月1日内被开出药品4940的次数一共有几次? | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '姜承运' AND t_kc22.STA_DATE BETWEEN '2008-03-30' AND '2021-02-01' AND t_kc22.SOC_SRT_DIRE_CD = '4940' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '姜承运' AN... | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is discharge location of subject name annette harris? | SELECT demographic.discharge_location FROM demographic WHERE demographic.name = "Annette Harris" | mimicsql_data |
CREATE TABLE table_8819 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What Country scored 70-68-70=208? | SELECT "Country" FROM table_8819 WHERE "Score" = '70-68-70=208' | 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... | provide the number of patients with lab test item id 50803 having abnormal lab test status. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50803" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_name_51 (
city_of_license VARCHAR,
frequency VARCHAR
) | What is the City of license with a 88.7 fm frequency | SELECT city_of_license FROM table_name_51 WHERE frequency = "88.7 fm" | sql_create_context |
CREATE TABLE table_54426 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the total amount of grid when the laps amount was smaller than 68 and the time/retired was injection? | SELECT SUM("Grid") FROM table_54426 WHERE "Laps" < '68' AND "Time/Retired" = 'injection' | wikisql |
CREATE TABLE discipline_enrollments (
undergraduate INTEGER,
campus VARCHAR,
year VARCHAR
)
CREATE TABLE campuses (
id VARCHAR,
campus VARCHAR
) | How many undergraduates are there in 'San Jose State University' in year 2004? | SELECT SUM(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Jose State University" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients with diagnosis icd9 code 28860 had lab test for other body fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "28860" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_2562572_2 (
city___municipality VARCHAR,
urban_settlement VARCHAR
) | What is the number of cities/municipalities having an urban settlement of Srbobran? | SELECT COUNT(city___municipality) FROM table_2562572_2 WHERE urban_settlement = "Srbobran" | sql_create_context |
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,... | 在2008年12月3日到2009年2月15日期间参保人号码为25470826的在门诊西药费花了多少? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '25470826' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2008-12-03' AND '2009-02-15' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_5038 (
"Make" text,
"Model" text,
"Production Run" text,
"Engine" text,
"Power" text,
"Wheelbase" text,
"Body Styles" text
) | What wheelbase has sport coupe (4p.) as the body style? | SELECT "Wheelbase" FROM table_5038 WHERE "Body Styles" = 'sport coupe (4p.)' | wikisql |
CREATE TABLE table_name_74 (
date INTEGER,
other_details VARCHAR
) | What's the date for Details of 1000 copies? | SELECT MIN(date) FROM table_name_74 WHERE other_details = "1000 copies" | sql_create_context |
CREATE TABLE table_203_345 (
id number,
"name" text,
"party" text,
"took office" number,
"left office" number
) | list each representative from conservative party | SELECT "name" FROM table_203_345 WHERE "party" = 'conservative' | squall |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,... | what was the four most frequent drugs that were prescribed to patients with age 20s in the same hospital encounter after they had been diagnosed with hyposmolality until 2103? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE table_36585 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | What was the Women's doubles that has a Men's singles of fernando silva, and in the year 1996? | SELECT "Women's doubles" FROM table_36585 WHERE "Men's singles" = 'fernando silva' AND "Year" < '1996' | wikisql |
CREATE TABLE table_74926 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the score for the team with a record of 2-1? | SELECT "Score" FROM table_74926 WHERE "Record" = '2-1' | wikisql |
CREATE TABLE table_61619 (
"Order" real,
"Nation" text,
"Chinese name" text,
"Pinyin" text,
"Sport" text
) | What nation has a sport of weightlifting and a pinyin of k k q nd o? | SELECT "Nation" FROM table_61619 WHERE "Sport" = 'weightlifting' AND "Pinyin" = 'kùkè qúndǎo' | wikisql |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Since teaching what are all the classes Jason Duvall has taught , will teach or is teaching ? ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Jason Duvall%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = ... | advising |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | Visualize a bar chart about the distribution of meter_400 and meter_100 , and display by the meter_100 in asc. | SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_100 | nvbench |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,... | What courses are the prerequisites needed for PHARMACY 995 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE table_58135 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the low lap total that has a Time or Retired of accident? | SELECT MIN("Laps") FROM table_58135 WHERE "Time/Retired" = 'accident' | wikisql |
CREATE TABLE table_203_340 (
id number,
"rank" number,
"airport" text,
"passengers handled" number,
"% change 2011 / 12" number
) | how many airports are listed ? | SELECT COUNT("airport") FROM table_203_340 | squall |
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 编号为72960308的这位患者被门诊诊断为疾病I69.303,查一下他在874346这个检测指标的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE table_64934 (
"Country" text,
"1960" real,
"1961" real,
"1962" real,
"1963" real,
"1964" real,
"1965" real,
"1966" real,
"1967" real,
"1968" real,
"1969" real
) | How much 1969 has a 1967 smaller than 0.73, and a 1964 larger than 0.07? | SELECT COUNT("1969") FROM table_64934 WHERE "1967" < '0.73' AND "1964" > '0.07' | wikisql |
CREATE TABLE table_203_393 (
id number,
"year" number,
"film" text,
"director" text,
"cast" text,
"details" text
) | who directed the film rajanna ? | SELECT "director" FROM table_203_393 WHERE "film" = 'rajanna' | squall |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NA... | Show the average salary by each hire date of employees, and please bin the hire date into the day of week interval for showing a bar chart, could you display Y from low to high order please? | SELECT HIRE_DATE, AVG(SALARY) FROM employees ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE T... | list the flights on sunday afternoon from OAKLAND to DALLAS | 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 (((flight.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_... | atis |
CREATE TABLE table_name_36 (
title VARCHAR,
number VARCHAR
) | What is number 4's title? | SELECT title FROM table_name_36 WHERE number = 4 | sql_create_context |
CREATE TABLE table_24909 (
"College" text,
"2007 Headcount" real,
"2007-2008 credit hours" real,
"County population 18 yrs+" real,
"Penetration in terms of Enrollment per 1000 adults" real,
"In-county tuition per credit hour (fall 2009)" text
) | How much was the cost of in-county tuition per credit hour at the Gloucester College by the fall of 2009? | SELECT "In-county tuition per credit hour (fall 2009)" FROM table_24909 WHERE "College" = 'Gloucester' | wikisql |
CREATE TABLE table_34896 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
) | Who was the incumbent who was first elected in 1876? | SELECT "Incumbent" FROM table_34896 WHERE "First elected" = '1876' | wikisql |
CREATE TABLE table_60248 (
"Season" text,
"Premier Division" text,
"Division One" text,
"Division Two" text,
"Division Three" text
) | Which Season was the Division Two Fownhope Reserves champions? | SELECT "Season" FROM table_60248 WHERE "Division Two" = 'fownhope reserves' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | provide the number of patients whose language is cape and admission location is transfer from hosp/extram? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" | mimicsql_data |
CREATE TABLE table_name_19 (
attendance VARCHAR,
week VARCHAR,
opponent VARCHAR
) | Which Attendance has a Week smaller than 8, and an Opponent of philadelphia eagles? | SELECT attendance FROM table_name_19 WHERE week < 8 AND opponent = "philadelphia eagles" | sql_create_context |
CREATE TABLE table_74365 (
"Sl. No." real,
"Train number" real,
"Train name" text,
"Origin" text,
"Destination" text,
"Time" text,
"Service" text,
"Route/Via." text
) | What is the origin when the destination is Mumbai? | SELECT "Origin" FROM table_74365 WHERE "Destination" = 'Mumbai' | wikisql |
CREATE TABLE table_5745 (
"Name" text,
"Street Address" text,
"Height feet / meters" text,
"Floors" real,
"Year" real
) | Street Address of 980 n. michigan avenue is what name? | SELECT "Name" FROM table_5745 WHERE "Street Address" = '980 n. michigan avenue' | wikisql |
CREATE TABLE table_67192 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the position for round 5 from alabama state? | SELECT "Position" FROM table_67192 WHERE "Round" = '5' AND "College" = 'alabama state' | 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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses... | among the patients of age 60 or above in 2104, what were the top five most frequent diagnoses? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) ... | mimic_iii |
CREATE TABLE table_2835 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many teams played against the Mavericks in a game where the score was w 99 91 (ot)? | SELECT COUNT("Team") FROM table_2835 WHERE "Score" = 'W 99–91 (OT)' | wikisql |
CREATE TABLE table_name_55 (
total VARCHAR,
set_3 VARCHAR
) | What was the total with a score in set 3 of 13 25? | SELECT total FROM table_name_55 WHERE set_3 = "13–25" | sql_create_context |
CREATE TABLE table_5289 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
) | Add up all the events whose earnings is less than $530,808, have less than 2 wins and is ranked lower than 5. | SELECT SUM("Events") FROM table_5289 WHERE "Earnings ( $ )" < '530,808' AND "Wins" < '2' AND "Rank" < '5' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients speak spanish language and tested under hematology in lab? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "SPAN" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_40536 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text
) | When has a Centerfold model of krista kelly? | SELECT "Date" FROM table_40536 WHERE "Centerfold model" = 'krista kelly' | wikisql |
CREATE TABLE table_name_54 (
award VARCHAR,
actor VARCHAR,
year VARCHAR
) | What award did Forest Whitaker win in 1989? | SELECT award FROM table_name_54 WHERE actor = "forest whitaker" AND year = 1989 | sql_create_context |
CREATE TABLE table_65896 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What's the 2008 of the US Open when 2010 was 2R and 2011 was 1R? | SELECT "2008" FROM table_65896 WHERE "2011" = '1r' AND "2010" = '2r' AND "Tournament" = 'us open' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TAB... | flight from NASHVILLE back to MILWAUKEE | 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 = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILW... | atis |
CREATE TABLE table_204_923 (
id number,
"club" text,
"entered\nadministration" text,
"exited\nadministration" text,
"league(s)" text,
"deduction(s)" text
) | how many clubs exited administration in 2003 ? | SELECT COUNT("club") FROM table_204_923 WHERE "exited\nadministration" = 2003 | squall |
CREATE TABLE table_name_96 (
fa_cup_goals INTEGER,
league_goals VARCHAR,
league_cup_apps VARCHAR,
fa_cup_apps VARCHAR
) | what is the average ga cup goals when the league cup apps is 2, the fa cup apps is 3 and the league goals is 3? | SELECT AVG(fa_cup_goals) FROM table_name_96 WHERE league_cup_apps = "2" AND fa_cup_apps = "3" AND league_goals = 3 | 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 ... | specify icd9 code of patient id 42963 | SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "42963" | mimicsql_data |
CREATE TABLE table_203_327 (
id number,
"player" text,
"country" text,
"year(s) won" text,
"r1" number,
"r2" number,
"total" number,
"to par" number
) | who has the most years won of players who missed the cut ? | SELECT "player" FROM table_203_327 ORDER BY "year(s) won" DESC LIMIT 1 | squall |
CREATE TABLE route (
train_id number,
station_id number
)
CREATE TABLE station (
id number,
network_name text,
services text,
local_authority text
)
CREATE TABLE weekly_weather (
station_id number,
day_of_week text,
high_temperature number,
low_temperature number,
precipita... | Find the number of trains for each station, as well as the station network name and services. | SELECT COUNT(*), t1.network_name, t1.services FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id | spider |
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE volume (
Volume_ID int,
V... | A bar chart for returning the number of the categories of music festivals that have the result 'Awarded', sort from low to high by the x-axis. | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY Category | nvbench |
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,
... | how many patients whose discharge location is dead/expired and diagnoses long title is chronic obstructive asthma, unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND diagnoses.long_title = "Chronic obstructive asthma, unspecified" | mimicsql_data |
CREATE TABLE table_17602 (
"#" real,
"Nation" text,
"Winners" real,
"Runners-up" real,
"3rd Place" real,
"4th Place" real
) | how many runners-up with nation being india | SELECT COUNT("Runners-up") FROM table_17602 WHERE "Nation" = 'India' | wikisql |
CREATE TABLE table_25461946_8 (
date VARCHAR,
team VARCHAR
) | When did they play Dayton? | SELECT date FROM table_25461946_8 WHERE team = "Dayton" | sql_create_context |
CREATE TABLE table_38420 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What team did the Chicago Black Hawks visit on April 20? | SELECT "Home" FROM table_38420 WHERE "Visitor" = 'chicago black hawks' AND "Date" = 'april 20' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | are the heartrate of patient 006-203526 measured at 2103-07-14 23:13:00 greater than measured at 2103-07-14 23:08:00? | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-203526')) AND NOT vitalperiodic.heartrate IS ... | eicu |
CREATE TABLE table_18600760_10 (
latitude VARCHAR,
water__sqmi_ VARCHAR
) | What was the lattitude for the area with 4.243 square miles of water? | SELECT latitude FROM table_18600760_10 WHERE water__sqmi_ = "4.243" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is marital status and insurance of subject id 3284? | SELECT demographic.marital_status, demographic.insurance FROM demographic WHERE demographic.subject_id = "3284" | mimicsql_data |
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 ... | 在医院6215327负责出院的科室名字和心血管无关的住院记录里,找出属于14234507这名患者的记录 | SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '14234507' AND hz_info.YLJGDM = '6215327' AND NOT wdmzjzjlb.CYKSMC LIKE '%心血管%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND... | css |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE state (
state_code text,
state... | list all the landings at MKE | SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'MKE' AND city.city_code = airport_service.city_code AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code | atis |
CREATE TABLE table_1835 (
"P" real,
"Player" text,
"Position" text,
"SPL" real,
"League Cup" real,
"Scottish Cup" real,
"UEFA Champions League" real,
"Total" real
) | What is the highest amount of uefa champion leagues? | SELECT MAX("UEFA Champions League") FROM table_1835 | wikisql |
CREATE TABLE table_64776 (
"Year" real,
"Category" text,
"Recipients and nominees" text,
"Role/Episode" text,
"Result" text
) | What's the category in 1998 with the role/episode of David Duchovny? | SELECT "Category" FROM table_64776 WHERE "Year" = '1998' AND "Role/Episode" = 'david duchovny' | wikisql |
CREATE TABLE table_name_70 (
place VARCHAR,
player VARCHAR
) | What is Gil Morgan's Place? | SELECT place FROM table_name_70 WHERE player = "gil morgan" | sql_create_context |
CREATE TABLE table_24597 (
"Season no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. Viewers (millions)" text
) | What was the season number for production code E2110? | SELECT "Season no." FROM table_24597 WHERE "Production code" = 'E2110' | wikisql |
CREATE TABLE table_16825 (
"Model name" text,
"Power (ps)" real,
"Torque (Nm@rpm)" text,
"Displacement (cm\u00b3)" real,
"Engine code" text,
"Comment" text
) | Name the torque of the engine is d5244 t5 | SELECT "Torque (Nm@rpm)" FROM table_16825 WHERE "Engine code" = 'D5244 T5' | wikisql |
CREATE TABLE table_19730 (
"Name" text,
"Years" text,
"League" text,
"FA Cup" text,
"League Cup" text,
"Europe" text,
"Other a" text,
"Total" text
) | which years had other a of 8 (1)? | SELECT "Years" FROM table_19730 WHERE "Other a" = '8 (1)' | wikisql |
CREATE TABLE table_18827 (
"Club" text,
"Played" text,
"Won" 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
) | Name the try bonus for kenfig hill rfc | SELECT "Try bonus" FROM table_18827 WHERE "Club" = 'Kenfig Hill RFC' | wikisql |
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 regions (
REGION_ID decimal(5,0),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the trend of commission_pct over hire_date , and show x-axis in asc order. | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE | nvbench |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
pat... | how many hours have passed since patient 027-136480 was given his first pulmonary embolism diagnosis during the current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '027-13648... | eicu |
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... | 医院6248314全部诊疗记录里参照科室编码的不同算算看统筹基金的花费比上医疗总费用的平均比值 | SELECT t_kc21.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '6248314' GROUP BY t_kc21.MED_ORG_DEPT_CD | css |
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 ethnicity is american indian/alaska native and procedure icd9 code is 5101? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.icd9_code = "5101" | mimicsql_data |
CREATE TABLE table_60035 (
"Letter" text,
"American" text,
"British" text,
"Australian" text,
"Examples" text
) | What is the British for the Australian ? | SELECT "British" FROM table_60035 WHERE "Australian" = 'ɔ' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.