context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_35 (
category VARCHAR
) | What car was awarded sub 1 litre in 2000 (won by toyota 1sz-fe 1.0l yaris in 1999)? | SELECT 2000 FROM table_name_35 WHERE 1999 = "toyota 1sz-fe 1.0l yaris" AND category = "sub 1 litre" | sql_create_context |
CREATE TABLE table_33676 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Attendance" real
) | What was the result on October 29, 1989? | SELECT "Result" FROM table_33676 WHERE "Date" = 'october 29, 1989' | wikisql |
CREATE TABLE table_28948937_3 (
partner VARCHAR,
outcome VARCHAR,
surface VARCHAR
) | What is the name of the partner that has a winner outcome and a hard surface? | SELECT partner FROM table_28948937_3 WHERE outcome = "Winner" AND surface = "Hard" | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TAB... | Is Nuclear Waste Management taught only by Prof. Toman ? | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Nuclear Waste Management%' AND NOT instructor.name LIKE '%Toman%' AND offering_instructor.instructor_id =... | advising |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, order in asc by the X. | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
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, draw a bar chart about the distribution of headquarter and the average of code , and group by attribute headquarter, and order from low to high by the bar. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter | nvbench |
CREATE TABLE table_train_29 (
"id" int,
"organ_transplantation" bool,
"white_blood_cell_count_wbc" int,
"leukopenia" int,
"immune_suppression" bool,
"active_infection" bool,
"treatment_with_immunoglobulins" bool,
"temperature" float,
"heart_rate" int,
"aisa" bool,
"paco2" flo... | immunosuppression ( solid organ transplantation, aisa, leukopenia ) | SELECT * FROM table_train_29 WHERE immune_suppression = 1 OR organ_transplantation = 1 OR aisa = 1 OR leukopenia = 1 | criteria2sql |
CREATE TABLE table_name_77 (
score VARCHAR,
result VARCHAR
) | Which item resulted in a score of 4-1? | SELECT score FROM table_name_77 WHERE result = "4-1" | sql_create_context |
CREATE TABLE table_name_74 (
city VARCHAR,
winner VARCHAR,
year VARCHAR
) | What was the city where Hallescher FC won in 2008? | SELECT city FROM table_name_74 WHERE winner = "hallescher fc" AND year = 2008 | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
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_gradu... | What are the advisory prerequisites for taking Dante , Petrarca , Boccaccio ? | SELECT DISTINCT advisory_requirement FROM course WHERE name LIKE '%Dante , Petrarca , Boccaccio%' | advising |
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... | 在编号为6439728的医院的入院诊断为颅脑外伤所致的精神障碍的医疗记录中,最少和最多的医疗费总额分别是多少 | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '6439728' AND t_kc24.t_kc21_IN_DIAG_DIS_NM = '颅脑外伤所致的精神障碍') | css |
CREATE TABLE table_name_39 (
valley_vista VARCHAR,
dysart VARCHAR
) | What Valley Vista has a Dysart of 1668? | SELECT valley_vista FROM table_name_39 WHERE dysart = "1668" | sql_create_context |
CREATE TABLE table_78689 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
) | What is Pos., when Height is 'm (ft 10in)', and when Date of Birth is '1983-05-29'? | SELECT "Pos." FROM table_78689 WHERE "Height" = 'm (ft 10in)' AND "Date of Birth" = '1983-05-29' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE p... | what is the one year survival rate of a person with congenital heart disease? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 1 * 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 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,... | 医疗机构8198670在零二年六月八日到零二年九月二十日内的总金额和统筹总金额分别如何 | SELECT SUM(t_kc24.MED_AMOUT), SUM(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 = '8198670' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-06-08' AND '2002-09-20' | css |
CREATE TABLE table_26448 (
"Song title" text,
"Artist" text,
"Year" real,
"Genre" text,
"Single / Pack name" text,
"Release date" text,
"Family Friendly" text,
"Additional Rock Band 3 Features" text
) | How many single / pack names are there for the song title of ' rockaway beach '? | SELECT COUNT("Single / Pack name") FROM table_26448 WHERE "Song title" = ' Rockaway Beach ' | wikisql |
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... | 在08年5月15日到2018年1月29日内患者49084699的检测指标968550是什么样的? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG... | css |
CREATE TABLE table_1342370_5 (
candidates VARCHAR,
incumbent VARCHAR
) | What candidates ran in the election that featured harry lane englebright? | SELECT candidates FROM table_1342370_5 WHERE incumbent = "Harry Lane Englebright" | sql_create_context |
CREATE TABLE table_2112260_1 (
specialization VARCHAR,
website VARCHAR
) | What is every specialization with the website Jstu.edu.bd | SELECT specialization FROM table_2112260_1 WHERE website = "jstu.edu.bd" | sql_create_context |
CREATE TABLE table_37577 (
"Name" text,
"Style" text,
"Opened" real,
"Manufacturer" text,
"Themed Area" text
) | Which Opened is the highest one that has a Themed Area of aerial park, and a Manufacturer of zamperla? | SELECT MAX("Opened") FROM table_37577 WHERE "Themed Area" = 'aerial park' AND "Manufacturer" = 'zamperla' | wikisql |
CREATE TABLE table_32903 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Young rider classification" text,
"Team classification" text
) | What is the classification with a Team classification of la vie claire and a Stage of 12? | SELECT "General classification" FROM table_32903 WHERE "Team classification" = 'la vie claire' AND "Stage" = '12' | wikisql |
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 prescriptions (
subject_id text,
hadm_id... | what is admission time and diagnoses long title of subject name francis baseler? | SELECT demographic.admittime, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Francis Baseler" | mimicsql_data |
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 hz_info (
KH text,
KLX number... | 患者32152549开出的所有检验报告单在2015年3月23日至2021年1月14日内的科室是什么编码还有名称是啥? | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '32152549' AND jybgb.BGRQ BETWEEN '2015-03-23... | css |
CREATE TABLE table_169766_13 (
retitled_as_same VARCHAR,
last_aired VARCHAR
) | Did the name change for the program last aired in 1958? | SELECT retitled_as_same FROM table_169766_13 WHERE last_aired = 1958 | 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 ... | 哪些工号及姓名的医务人员在患者沈云梦就诊过程中为他检测地高辛的,时间是从0二年二月六日到0四年五月十二日 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 mzjzj... | css |
CREATE TABLE table_60335 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | What is the lowest number of loses of the club with more than 42 goals scored, more than 20 goals conceded, and less than 3 draws? | SELECT MIN("Loses") FROM table_60335 WHERE "Goals scored" > '42' AND "Goals conceded" > '20' AND "Draws" < '3' | wikisql |
CREATE TABLE table_40252 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | How much Played has an Against larger than 37, and a Lost of 15, and Points smaller than 11? | SELECT SUM("Played") FROM table_40252 WHERE "Against" > '37' AND "Lost" = '15' AND "Points" < '11' | wikisql |
CREATE TABLE settlements (
settlement_id number,
claim_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number,
customer_policy_id number
)
CREATE TABLE payments (
payment_id number,
settlement_id number,
payment_method_code text,
... | Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim amount. | SELECT amount_settled, amount_claimed FROM claims ORDER BY amount_settled LIMIT 1 | spider |
CREATE TABLE table_name_95 (
team VARCHAR,
rank VARCHAR,
year VARCHAR,
machine VARCHAR
) | Which team had a year over 1995, machine of RS125R, and ranked 1st? | SELECT team FROM table_name_95 WHERE year > 1995 AND machine = "rs125r" AND rank = "1st" | sql_create_context |
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
)
... | count the number of patients whose age is less than 70 and diagnoses long title is acute myocardial infarction of inferolateral wall, initial episode of care? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "70" AND diagnoses.long_title = "Acute myocardial infarction of inferolateral wall, initial episode of care" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many patients whose diagnoses long title is primary pulmonary hypertension and drug route is ng? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Primary pulmonary hypertension" AND prescriptions.route = "NG" | mimicsql_data |
CREATE TABLE table_name_94 (
loss VARCHAR,
name VARCHAR
) | What was the loss for Boris Picano-Nacci? | SELECT loss FROM table_name_94 WHERE name = "boris picano-nacci" | sql_create_context |
CREATE TABLE table_40740 (
"City/State" text,
"Members" text,
"Team" text,
"First round" text,
"Final round" text
) | What was the first round time for member Kenny Smith? | SELECT "First round" FROM table_40740 WHERE "Members" = 'kenny smith' | wikisql |
CREATE TABLE table_2342078_6 (
directed_by VARCHAR,
written_by VARCHAR
) | Name who drected the episode written by george tibbles | SELECT directed_by FROM table_2342078_6 WHERE written_by = "George Tibbles" | sql_create_context |
CREATE TABLE table_204_211 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the number of silver medals awarded to argentina ? | SELECT "silver" FROM table_204_211 WHERE "nation" = 'argentina' | squall |
CREATE TABLE table_name_14 (
place INTEGER,
song VARCHAR
) | What is the average Place, when Song is 'Dis Oui'? | SELECT AVG(place) FROM table_name_14 WHERE song = "dis oui" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 过去83460162患者有过什么门诊诊断? | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_inf... | css |
CREATE TABLE table_name_46 (
opponent_in_the_final VARCHAR,
date VARCHAR
) | Who was the opponent in the final on 5 July 1992? | SELECT opponent_in_the_final FROM table_name_46 WHERE date = "5 july 1992" | sql_create_context |
CREATE TABLE table_name_19 (
frequency_mhz VARCHAR,
call_sign VARCHAR,
erp_w VARCHAR
) | What is the total frequency mhz of the kgrj call sign, which has an erp w greater than 21,500? | SELECT COUNT(frequency_mhz) FROM table_name_19 WHERE call_sign = "kgrj" AND erp_w > 21 OFFSET 500 | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 奚冰蓝这位病患从一0年一月二十六日到一三年十二月十八日,有多少位医生给他看过病 | SELECT COUNT(mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '奚冰蓝' AND mzjzjlb.JZKSRQ BETWEEN '2010-01-26' AND '2013-12-18' | css |
CREATE TABLE table_64006 (
"Wimmera FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What are the draws when the losses are less than 1? | SELECT SUM("Draws") FROM table_64006 WHERE "Losses" < '1' | wikisql |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
... | i'd like to see all the one way flights from DENVER to 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND fare.round_trip_required = 'NO' AND flight_fare.fare_i... | atis |
CREATE TABLE table_54332 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | what is the lowest grid when the time retired is clutch, the driver is peter collins and the laps is smaller than 26? | SELECT MIN("Grid") FROM table_54332 WHERE "Time/Retired" = 'clutch' AND "Driver" = 'peter collins' AND "Laps" < '26' | wikisql |
CREATE TABLE table_14369 (
"Title" text,
"Year" real,
"Platform" text,
"Developer" text,
"Publisher" text
) | Name the title for 2005 | SELECT "Title" FROM table_14369 WHERE "Year" = '2005' | wikisql |
CREATE TABLE table_60161 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location Attendance" text,
"Record" text
) | What Location Attendance has an Opponent of at denver nuggets? | SELECT "Location Attendance" FROM table_60161 WHERE "Opponent" = 'at denver nuggets' | wikisql |
CREATE TABLE table_name_99 (
points INTEGER,
year VARCHAR
) | What was the highest number of points in 1966? | SELECT MAX(points) FROM table_name_99 WHERE year = 1966 | sql_create_context |
CREATE TABLE table_name_7 (
year VARCHAR,
composer VARCHAR
) | What year was the composition by Mejo Joseph? | SELECT COUNT(year) FROM table_name_7 WHERE composer = "mejo joseph" | sql_create_context |
CREATE TABLE table_9547 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What team was the opponent for the game played on December 19, 1999? | SELECT "Opponent" FROM table_9547 WHERE "Date" = 'december 19, 1999' | wikisql |
CREATE TABLE table_3100 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | How many dates did 'Rebecca's one night stand' originally air on? | SELECT COUNT("Original air date") FROM table_3100 WHERE "Title" = 'Rebecca''s One Night Stand' | 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... | 在门诊检查的邹元良患者在查出疾病F78.797时的检测指标290838的结果定量及其单位各是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j... | css |
CREATE TABLE table_name_62 (
date VARCHAR,
time VARCHAR,
location VARCHAR
) | What was date when the time was 2:26 and the location was Riverfront Stadium? | SELECT date FROM table_name_62 WHERE time = "2:26" AND location = "riverfront stadium" | sql_create_context |
CREATE TABLE table_name_66 (
height__ft_ INTEGER,
city VARCHAR
) | How high was the highest building in feet in the city of cologne? | SELECT MAX(height__ft_) FROM table_name_66 WHERE city = "cologne" | sql_create_context |
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... | let me know the ethnic background and the name of patient with patient id 81923. | SELECT demographic.name, demographic.ethnicity FROM demographic WHERE demographic.subject_id = "81923" | mimicsql_data |
CREATE TABLE table_name_77 (
time VARCHAR,
geust VARCHAR
) | What is Time, when Geust is AC Bellinzona (CHL)? | SELECT time FROM table_name_77 WHERE geust = "ac bellinzona (chl)" | sql_create_context |
CREATE TABLE table_name_45 (
category VARCHAR,
country VARCHAR
) | Russia has films in which category? | SELECT category FROM table_name_45 WHERE country = "russia" | sql_create_context |
CREATE TABLE table_66725 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
) | a Year smaller than 2007, and a Result of 1st is in what venue? | SELECT "Venue" FROM table_66725 WHERE "Year" < '2007' AND "Result" = '1st' | wikisql |
CREATE TABLE table_204_301 (
id number,
"nationality" text,
"name" text,
"term as a deputy judge" text,
"reason for termination" text
) | who was the last deputy judge with finland nationality ? | SELECT "name" FROM table_204_301 WHERE "nationality" = 'finland' ORDER BY "term as a deputy judge" DESC LIMIT 1 | squall |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | 列出患者金嘉丽的医疗记录中每一次被开出的药品金额不低于4769.0元的医疗就诊编号 | SELECT t_kc21.MED_CLINIC_ID 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.AMOUNT >= 4769.0) | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients whose admission location is clinic referral/premature and drug name is hydralazine hcl? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.drug = "HydrALAZINE HCl" | mimicsql_data |
CREATE TABLE table_29018 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What is the nationality of Bob Essensa? | SELECT "Nationality" FROM table_29018 WHERE "Player" = 'Bob Essensa' | wikisql |
CREATE TABLE zyb (
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... | 从0三年四月八日到一三年一月六日,患者华悦欣接受检查的次数有多少 | 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 '2003-04-08' AND '2013-01-06' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '华悦欣' A... | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 从二0一三年二月二日到二0二一年十一月九日这段时间9922597的医疗机构病患的平均住院时长是多少 | SELECT AVG(qtb.IN_HOSP_DAYS) FROM qtb WHERE qtb.MED_SER_ORG_NO = '9922597' AND qtb.IN_HOSP_DATE BETWEEN '2013-02-02' AND '2021-11-09' UNION SELECT AVG(gyb.IN_HOSP_DAYS) FROM gyb WHERE gyb.MED_SER_ORG_NO = '9922597' AND gyb.IN_HOSP_DATE BETWEEN '2013-02-02' AND '2021-11-09' UNION SELECT AVG(zyb.IN_HOSP_DAYS) FROM zyb WH... | css |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE fare_basis (
fare_basis_code ... | is there ground transportation available in DENVER | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
pa... | have patient 031-23605 had any other meds intake during their last hospital encounter? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605' AND NOT patient.hospitaldischargetime IS NULL ORDER BY pati... | eicu |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 标本采集部位在检验报告单63570417818上都有什么? | SELECT jybgb.BBCJBW FROM jybgb WHERE jybgb.BGDH = '63570417818' | css |
CREATE TABLE table_14653 (
"City" text,
"Province/Region" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | What airport is in Vietnam? | SELECT "Airport" FROM table_14653 WHERE "Country" = 'vietnam' | wikisql |
CREATE TABLE table_204_668 (
id number,
"#" number,
"menteri besar" text,
"took office" text,
"left office" text,
"party" text
) | how many years was jaafar mohamed in office ? | SELECT "left office" - "took office" FROM table_204_668 WHERE "menteri besar" = 'jaafar mohamed' | squall |
CREATE TABLE table_name_92 (
nhl_team VARCHAR,
round VARCHAR
) | what is the nhl team for round 10? | SELECT nhl_team FROM table_name_92 WHERE round = 10 | sql_create_context |
CREATE TABLE table_name_17 (
evening_gown INTEGER,
swimsuit VARCHAR,
average VARCHAR,
interview VARCHAR
) | What is the lowest evening gown score a contestant with an average less than 8.23, an interview score of 8.11, and a swimsuit larger than 7.84 has? | SELECT MIN(evening_gown) FROM table_name_17 WHERE average < 8.23 AND interview = 8.11 AND swimsuit > 7.84 | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many hours has elapsed since patient 027-82318 first received a laboratory test of bicarbonate on the current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318' AND patient.hosp... | eicu |
CREATE TABLE customer_event_notes (
customer_event_note_id number,
customer_event_id number,
service_type_code text,
resident_id number,
property_id number,
date_moved_in time
)
CREATE TABLE services (
service_id number,
organization_id number,
service_type_code text,
service_de... | How many different status codes of things are there? | SELECT COUNT(DISTINCT status_of_thing_code) FROM timed_status_of_things | spider |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int... | For classes with labs , which professors do n't teach them ? | SELECT DISTINCT instructor.name FROM instructor, course, course_offering, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course_offering.offering_id = offering_instructor.offering_id AND instructor.instructor_id = offering_instructor.instructor_id AND NOT instr... | advising |
CREATE TABLE table_203_543 (
id number,
"year" text,
"show" text,
"role" text,
"channel" text,
"extra" text
) | what is the next show listed after ek anhonee ? | SELECT "show" FROM table_203_543 WHERE id = (SELECT id FROM table_203_543 WHERE "show" = 'ek anhonee (tele-film)') + 1 | squall |
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,
... | 查一下在医疗就诊98195604452中给病人金德水做检验的科室名称和编码 | SELECT JYKSBM, JYKSMC FROM jybgb WHERE JZLSH = '98195604452' | css |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTE... | Show the number of documents for each location code in a pie chart. | SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code | nvbench |
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 patients admitted before 2197 followed the procedure icd9 code 3323? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2197" AND procedures.icd9_code = "3323" | mimicsql_data |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEG... | A bar chart for what are the number of the purchase details of transactions with amount bigger than 10000?, could you sort in asc by the x axis? | SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY purchase_details | nvbench |
CREATE TABLE table_14534 (
"Country" text,
"Total population (1000)" real,
"Total Foreign-born (1000)" real,
"Born in other EU state (1000)" real,
"Born in a non EU state (1000)" real
) | How many Foreign-born (1000) are from Sweden and born in some other EU state (1000) larger than 477? | SELECT SUM("Total Foreign-born (1000)") FROM table_14534 WHERE "Country" = 'sweden' AND "Born in other EU state (1000)" > '477' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Popular answers with most viewed questions. | SELECT q.Title, q.Score AS QuestionScore, q.ViewCount, q.Tags, q.Id AS "post_link", ans.Score AS AnswerScore, ans.Id AS AnswerId FROM Posts AS ans JOIN Posts AS q ON ans.ParentId = q.Id WHERE q.ViewCount > 5000 AND ans.Score > 20 AND ans.OwnerUserId = 7586 ORDER BY q.ViewCount DESC | sede |
CREATE TABLE table_name_43 (
producer_s_ VARCHAR,
songwriter_s_ VARCHAR
) | Who is sezen aksu's producer? | SELECT producer_s_ FROM table_name_43 WHERE songwriter_s_ = "sezen aksu" | sql_create_context |
CREATE TABLE table_71563 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What is the record for the game with a score of 7 5? | SELECT "Record" FROM table_71563 WHERE "Score" = '7–5' | wikisql |
CREATE TABLE table_30524 (
"Name of Rivalry" text,
"Rival" text,
"Games Played" real,
"First Meeting" real,
"Last Meeting" real,
"AU Won" real,
"AU Lost" real,
"Ties" real,
"Streak" text,
"Latest win" text
) | when was the ending time where the enemy met in the iron bowl | SELECT "Last Meeting" FROM table_30524 WHERE "Name of Rivalry" = 'Iron Bowl' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE ... | After 10:00 does EHS 588 have any section ? | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '10:00' AND course.course_id = course_offering.course_id AND course.department = 'EHS' AND course.number = 588 AND semester.semester = 'WN' AND s... | advising |
CREATE TABLE table_74922 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which opponent has points less than 18, and a november greater than 11? | SELECT "Opponent" FROM table_74922 WHERE "Points" < '18' AND "November" > '11' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
... | what was the drug that patient 66015 was prescribed for within 2 days after receiving the reopen recent lap site during the last month? | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 66015 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ... | mimic_iii |
CREATE TABLE mill (
TYPE VARCHAR
) | What is the most common mill type, and how many are there? | SELECT TYPE, COUNT(*) FROM mill GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_4 (
qual VARCHAR,
laps VARCHAR,
start VARCHAR
) | Which Qual with laps less than 200 and an 11 start? | SELECT qual FROM table_name_4 WHERE laps < 200 AND start = "11" | sql_create_context |
CREATE TABLE table_17632217_2 (
third_place VARCHAR,
total_wins VARCHAR
) | Who took third-place when there were 4 total wins? | SELECT third_place FROM table_17632217_2 WHERE total_wins = 4 | sql_create_context |
CREATE TABLE table_name_25 (
status VARCHAR,
authors VARCHAR
) | What is the Status with an Author that is colbert? | SELECT status FROM table_name_25 WHERE authors = "colbert" | sql_create_context |
CREATE TABLE table_name_60 (
label VARCHAR,
catalog VARCHAR
) | What is the Label of the B0011141-01 Catalog? | SELECT label FROM table_name_60 WHERE catalog = "b0011141-01" | sql_create_context |
CREATE TABLE table_392 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Musical guest and song" text,
"Original air date" text,
"Production code" real
) | Who was the director of the Series 1 episode? | SELECT "Directed by" FROM table_392 WHERE "Series #" = '1' | wikisql |
CREATE TABLE table_name_48 (
partner VARCHAR,
score_in_the_final VARCHAR
) | Who was the partner when the final score was 7 6, 3 6, 6 7? | SELECT partner FROM table_name_48 WHERE score_in_the_final = "7–6, 3–6, 6–7" | sql_create_context |
CREATE TABLE table_17701 (
"Rank in Nyagatare Sectors, 2012" real,
"Sector" text,
"Area in sqkm" real,
"Population August 15, 2012" real,
"Population, August 15, 2002" real,
"Population Change 2002-2012 (%)" text,
"Population Density 2012 (km 2 )" real
) | When the population change 2002-2012 (%) is 35.5 what is the rank in nyagatare sectors? | SELECT MAX("Rank in Nyagatare Sectors, 2012") FROM table_17701 WHERE "Population Change 2002-2012 (%)" = '35.5' | wikisql |
CREATE TABLE table_name_51 (
position VARCHAR,
nationality VARCHAR,
nhl_team VARCHAR
) | What position is the player that is from Canada and on the Boston Bruins | SELECT position FROM table_name_51 WHERE nationality = "canada" AND nhl_team = "boston bruins" | sql_create_context |
CREATE TABLE table_name_40 (
away_team VARCHAR,
tie_no VARCHAR
) | What is the name of the away team with a Tie no of 7? | SELECT away_team FROM table_name_40 WHERE tie_no = "7" | sql_create_context |
CREATE TABLE table_34331 (
"Volume:Issue" text,
"Issue date" text,
"Weeks on numbe one" text,
"Song" text,
"Artist(s)" text
) | Which Artist's song is listed as ' missing '? | SELECT "Artist(s)" FROM table_34331 WHERE "Song" = ' missing ' | wikisql |
CREATE TABLE table_203_783 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | in what year did the team achieve the same place as 2010/11 ? | SELECT "season" FROM table_203_783 WHERE "season" <> '2010/11' AND "place" = (SELECT "place" FROM table_203_783 WHERE "season" = '2010/11') | squall |
CREATE TABLE table_204_426 (
id number,
"year" text,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
) | other than npsl , what league has ny mens soccer team played in ? | SELECT "league" FROM table_204_426 WHERE "league" <> 'npsl' | squall |
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... | 编号84294070811的医疗就诊,费用明细项目该走的结算流程都好了没 | SELECT (SELECT SUM(STA_FLG) FROM t_kc22 WHERE MED_CLINIC_ID = '84294070811') = (SELECT COUNT(*) FROM t_kc22 WHERE MED_CLINIC_ID = '84294070811') | css |
CREATE TABLE table_name_93 (
segment_b VARCHAR,
segment_d VARCHAR
) | For a segment D of pasta, what is the segment B? | SELECT segment_b FROM table_name_93 WHERE segment_d = "pasta" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.