context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | what are the three most frequently ordered procedures for patients who have previously received open liver biopsy within the same month, until 2104? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admi... | mimic_iii |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | in this year, what are the top five most frequent diagnoses that patients were given in the same month after hyperchloremia? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperchloremia' AND DATETIME(diagnosis.d... | eicu |
CREATE TABLE table_4033 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Area" real,
"Population" real,
"Density" real
) | What is the density of the place with an area of 1512? | SELECT MAX("Density") FROM table_4033 WHERE "Area" = '1512' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDe... | select DisplayName from Users where Location = 'Tunisia';. | SELECT DisplayName FROM Users WHERE Location = 'Tunisia' | sede |
CREATE TABLE table_name_61 (
size VARCHAR,
school VARCHAR,
_number___county VARCHAR,
year_joined VARCHAR,
ihsaa_class VARCHAR
) | What's the size of Centerville in 89 Wayne county with an IHSAA class of AA in the year before 1974? | SELECT size FROM table_name_61 WHERE year_joined < 1974 AND ihsaa_class = "aa" AND _number___county = "89 wayne" AND school = "centerville" | sql_create_context |
CREATE TABLE gyb (
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... | 对于医疗费总额高于5656.54元的患者窦麦冬的医疗记录,列出入院诊断有什么疾病编码和名称? | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '窦麦冬' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 5656.54) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '窦麦冬' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLIN... | css |
CREATE TABLE table_8843 (
"Year" real,
"Ship" text,
"Departed From" text,
"Departed On" text,
"Returned On" text
) | Which Ship has a Year larger than 2013? | SELECT "Ship" FROM table_8843 WHERE "Year" > '2013' | wikisql |
CREATE TABLE table_204_399 (
id number,
"outcome" text,
"no." number,
"year" number,
"championship" text,
"opponent in the final" text,
"score" text
) | when was stephen hendry 's first uk championship win ? | SELECT "year" FROM table_204_399 WHERE "championship" = 'uk championship' AND "outcome" = 'winner' ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_74506 (
"Region" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2009" text,
"2010" text,
"2011" text
) | What is the 2010 Lukoil oil prodroduction when in 2009 oil production 21.662 million tonnes? | SELECT "2010" FROM table_74506 WHERE "2009" = '21.662' | wikisql |
CREATE TABLE table_22949 (
"Round" real,
"Date" text,
"City and venue" text,
"Winner" text,
"Runner-up" text,
"3rd placed" text,
"4th placed" text,
"Results" text
) | Where did Grzegorz Walasek place 4th? | SELECT "City and venue" FROM table_22949 WHERE "4th placed" = 'Grzegorz Walasek' | wikisql |
CREATE TABLE table_49574 (
"Date" text,
"Place" text,
"Race winners" text,
"GP winner" text,
"Source" text
) | What is the GP winner for the Race winners valentin giraud / nicolas musset, and a place genk? | SELECT "GP winner" FROM table_49574 WHERE "Race winners" = 'valentin giraud / nicolas musset' AND "Place" = 'genk' | wikisql |
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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a scatter chart about the correlation between manager_id and department_id . | SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_203_94 (
id number,
"year" number,
"player" text,
"country" text,
"score" text,
"to par" number,
"margin\nof victory" text,
"course" text,
"location" text,
"purse ($)" number,
"winner's\nshare ($)" number
) | which player earned the most between 2007 and 2013 in the western open ? | SELECT "player" FROM table_203_94 GROUP BY "player" ORDER BY SUM("winner's\nshare ($)") DESC LIMIT 1 | squall |
CREATE TABLE table_12027 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the time for 18 laps and 5 grids? | SELECT "Time" FROM table_12027 WHERE "Laps" = '18' AND "Grid" = '5' | 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... | give me the number of patients whose admission location is trsf within this facility and primary disease is abdominal pain? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "ABDOMINAL PAIN" | mimicsql_data |
CREATE TABLE table_name_38 (
Champions INTEGER,
league INTEGER
) | What is the average Champions League assists for the players with League assists under 4? | SELECT AVG(Champions) AS league FROM table_name_38 WHERE league < 4 | sql_create_context |
CREATE TABLE table_name_46 (
condition VARCHAR,
prothrombin_time VARCHAR,
partial_thromboplastin_time VARCHAR,
platelet_count VARCHAR
) | Which Condition has an unaffected Partial thromboplastin time, Platelet count, and a Prothrombin time? | SELECT condition FROM table_name_46 WHERE partial_thromboplastin_time = "unaffected" AND platelet_count = "unaffected" AND prothrombin_time = "unaffected" | sql_create_context |
CREATE TABLE table_name_97 (
rank INTEGER
) | What is the sum of 2010-11 when the rank is greater than 11? | SELECT COUNT(2010 AS _11) FROM table_name_97 WHERE rank > 11 | sql_create_context |
CREATE TABLE table_1644876_2 (
l INTEGER
) | What is the fewest number of losses? | SELECT MIN(l) FROM table_1644876_2 | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
... | what was the marital status of patient 28447 during their current hospital encounter? | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 28447 AND admissions.dischtime IS NULL | mimic_iii |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE... | For those employees who did not have any job in the past, find hire_date and the average of employee_id bin hire_date by time, and visualize them by a bar chart, display y axis in asc order. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_45842 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Who is the home team that tied no 2? | SELECT "Home team" FROM table_45842 WHERE "Tie no" = '2' | wikisql |
CREATE TABLE table_204_168 (
id number,
"date" text,
"time" text,
"opponent" text,
"site" text,
"tv" text,
"result" text,
"attendance" number,
"record" text
) | how many games did the wildcats play in daytona beach , fl ? | SELECT COUNT(*) FROM table_204_168 WHERE "site" = 'moore gymnasium • daytona beach, fl' | squall |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid numb... | what is the daily minimum amount of jp b that patient 027-146876 had until 25 months ago? | SELECT MIN(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 = '027-146876')) AND intakeoutput.celllabel = 'jp b... | eicu |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_zone (
time_zone_code tex... | show me flights from MILWAUKEE to ORLANDO one way | 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 = 'ORLANDO' AND fare.round_trip_required = 'NO' AND flight_fare.fare_id =... | atis |
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... | 哪些疾病,患者卫滨海以前有过? | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '卫滨海' UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '卫滨海' UNION SELECT zyb.IN_DIAG_DIS_CD, zyb.IN_DIAG_DIS_NM FROM zyb WHERE zyb.PERSON_NM = '卫滨海' UNION SELECT mzb.IN_DIAG_DIS_CD, mzb.IN_DIAG_DIS_NM FROM mz... | css |
CREATE TABLE table_6455 (
"Driver" text,
"Points" real,
"Season" text,
"Races" real,
"Percentage of possible points" real
) | What season had less than 301 points and 17 races? | SELECT "Season" FROM table_6455 WHERE "Points" < '301' AND "Races" = '17' | wikisql |
CREATE TABLE table_name_5 (
rank INTEGER,
opposition VARCHAR,
total VARCHAR
) | What is the average rank of the match where offaly was the opposition and the total was greater than 9? | SELECT AVG(rank) FROM table_name_5 WHERE opposition = "offaly" AND total > 9 | sql_create_context |
CREATE TABLE table_52480 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | Who is the visitor team on 23 November 2007? | SELECT "Visitor" FROM table_52480 WHERE "Date" = '23 november 2007' | wikisql |
CREATE TABLE table_50076 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text,
"Points" real
) | What is the date of the game with toronto as the visitor? | SELECT "Date" FROM table_50076 WHERE "Visitor" = 'toronto' | wikisql |
CREATE TABLE table_9644 (
"Lane" real,
"Name" text,
"Country" text,
"Mark" real,
"React" real
) | What is the total number of Lane, when Mark is '7.93', and when React is less than 0.145? | SELECT COUNT("Lane") FROM table_9644 WHERE "Mark" = '7.93' AND "React" < '0.145' | wikisql |
CREATE TABLE table_17244483_1 (
grid VARCHAR,
driver VARCHAR
) | Scott Dixon had how many Grid positions? | SELECT COUNT(grid) FROM table_17244483_1 WHERE driver = "Scott Dixon" | sql_create_context |
CREATE TABLE table_70256 (
"Institution" text,
"Main Campus Location" text,
"Founded" real,
"Mascot" text,
"School Colors" text
) | Which Institution has a Mascot of broncbusters? | SELECT "Institution" FROM table_70256 WHERE "Mascot" = 'broncbusters' | wikisql |
CREATE TABLE table_1682 (
"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 location and attendance at the game where the final score is w 118-112? | SELECT "Location Attendance" FROM table_1682 WHERE "Score" = 'W 118-112' | wikisql |
CREATE TABLE products (
product_id number,
product_name text,
product_price number,
product_description text
)
CREATE TABLE actual_orders (
actual_order_id number,
order_status_code text,
regular_order_id number,
actual_order_date time
)
CREATE TABLE customers (
customer_id number,... | Find the name of route that has the highest number of deliveries. | SELECT t1.route_name FROM delivery_routes AS t1 JOIN delivery_route_locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE diagnoses_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 cost (
row_id number,
subject_id number,
hadm_id ... | what is the first thing patient 14502 had for intake on the last intensive care unit visit? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14502) AND NOT icustays.outtime IS N... | mimic_iii |
CREATE TABLE table_name_98 (
airline VARCHAR,
rank VARCHAR
) | Name the airline for rank of 4 | SELECT airline FROM table_name_98 WHERE rank = 4 | sql_create_context |
CREATE TABLE table_name_98 (
game INTEGER,
attendance VARCHAR
) | What is the first game number that had attendance of 56,505? | SELECT MIN(game) FROM table_name_98 WHERE attendance = 56 OFFSET 505 | sql_create_context |
CREATE TABLE table_2840500_4 (
position VARCHAR,
player VARCHAR
) | What position does Antti-Jussi Niemi play? | SELECT position FROM table_2840500_4 WHERE player = "Antti-Jussi Niemi" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | count the number of white ethnic background patients who had replaced route of drug administration. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "REPLACE" | mimicsql_data |
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,
... | 为韩飞双这个患者在05年4月12日到12年6月12日内检测过尿素的医务人员工号及姓名分别是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZ... | css |
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Pla... | Stacked bar chart of how many date in location from for with each Location_Code in each date in location from, and order by the y axis in descending. | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Date_in_Location_From) DESC | 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,... | Are 10 -credit classes the only option for upper level classes ? | SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 10 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_name_31 (
position VARCHAR,
school_club_team VARCHAR
) | What position did the player from Florida International play? | SELECT position FROM table_name_31 WHERE school_club_team = "florida international" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | out of total number of patients diagnosed with esophageal reflux, how many of them were unmarried? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Esophageal reflux" | mimicsql_data |
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... | 汉防己甲素片(薄膜衣)在医疗就医号码82581255235的收费项目中等级是什么等级? | SELECT t_kc22.CHA_ITEM_LEV 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 = '82581255235' AND t_kc22.SOC_SRT_DIRE_NM = '汉防己甲素片(薄膜衣)' | css |
CREATE TABLE table_name_99 (
place INTEGER,
artist VARCHAR,
points VARCHAR
) | what is the average place when the artist is juliana pasha & luiz ejlli and the points is more than 119? | SELECT AVG(place) FROM table_name_99 WHERE artist = "juliana pasha & luiz ejlli" AND points > 119 | sql_create_context |
CREATE TABLE table_10662 (
"Round" real,
"Overall" text,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
) | What is the Overall of 15 Club team with a Nationality of Canada? | SELECT "Club team" FROM table_10662 WHERE "Nationality" = 'canada' AND "Overall" = '15' | 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... | what is drug name of subject id 3343? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.subject_id = "3343" | mimicsql_data |
CREATE TABLE table_45756 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | What is Date of Appointment, when Outgoing Manager is 'Giray Bulak'? | SELECT "Date of appointment" FROM table_45756 WHERE "Outgoing manager" = 'giray bulak' | wikisql |
CREATE TABLE table_55115 (
"Region" text,
"Capital" text,
"Area (km\u00b2)" text,
"Area (sq. mi.)" text,
"Population" text,
"GDP ( bn )" text
) | Which Region has an Area of 9,451km ? | SELECT "Region" FROM table_55115 WHERE "Area (km\u00b2)" = '9,451' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | when did patient 1114 get prescribed a drug via po/ng for the first time since 31 months ago? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114) AND prescriptions.route = 'po/ng' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-31 month') ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_28204447_3 (
tries_for VARCHAR,
l INTEGER
) | Name the tries for when L is less than 2.0 | SELECT tries_for FROM table_28204447_3 WHERE l < 2.0 | sql_create_context |
CREATE TABLE table_name_87 (
profession VARCHAR,
city VARCHAR
) | What is the profession of the housemate from Leskovac city? | SELECT profession FROM table_name_87 WHERE city = "leskovac" | sql_create_context |
CREATE TABLE table_46632 (
"Nominative" text,
"Ergative" text,
"Dative" text,
"Genitive" text,
"Instrumental" text,
"Adverbial" text
) | What is the ergative for the dative chven? | SELECT "Ergative" FROM table_46632 WHERE "Dative" = 'chven' | wikisql |
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... | 从0三年七月十四日到一0年一月二十五日,患者45492720的医保统筹基金总共被刷了多少金额 | SELECT SUM(OVE_PAY) FROM t_kc24 WHERE PERSON_ID = '45492720' AND CLINIC_SLT_DATE BETWEEN '2003-07-14' AND '2010-01-25' | css |
CREATE TABLE table_32139 (
"Player" text,
"Career" text,
"Goals" real,
"Caps" real,
"Average" real
) | Who scored more than 8 goals, had more than 75 caps, and averaged 0.432? | SELECT "Player" FROM table_32139 WHERE "Goals" > '8' AND "Caps" > '75' AND "Average" = '0.432' | wikisql |
CREATE TABLE table_name_51 (
year_startup VARCHAR,
project_name VARCHAR
) | What year was the startup for the Project Named of taq taq ph 2? | SELECT year_startup FROM table_name_51 WHERE project_name = "taq taq ph 2" | 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... | 门诊诊断为疾病Q71.430的患者45034642的脂肪酶的结果定量及其单位数据均为? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb... | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many female patients are with lab test id 51458? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "51458" | mimicsql_data |
CREATE TABLE table_18110 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | Name the results for district new york 24 | SELECT "Results" FROM table_18110 WHERE "District" = 'New York 24' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | was po intake given to patient 12775 on the current intensive care unit visit? | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775) AND icustays.outtime IS NULL) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WH... | mimic_iii |
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,... | 在06年6月14日到07年3月9日这一年内,医疗机构7349327的患者平均住院时长是多久? | SELECT AVG(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '7349327' AND IN_HOSP_DATE BETWEEN '2006-06-14' AND '2007-03-09' | css |
CREATE TABLE table_57766 (
"Heat." real,
"Race Title" text,
"Circuit" text,
"Location / State" text,
"Date" text,
"Winner" text,
"Team" text
) | What is the lowest heat of the Lakeside race? | SELECT MIN("Heat.") FROM table_57766 WHERE "Race Title" = 'lakeside' | wikisql |
CREATE TABLE table_22425 (
"Candidate" text,
"Office running for" text,
"Running with (in team)" text,
"Won or lost" text,
"Votes given" text
) | Name the running with for elizabeth falco | SELECT "Running with (in team)" FROM table_22425 WHERE "Candidate" = 'Elizabeth Falco' | wikisql |
CREATE TABLE table_27723228_8 (
high_rebounds VARCHAR,
record VARCHAR
) | Who had the high rebounds when the record was 14 7? | SELECT high_rebounds FROM table_27723228_8 WHERE record = "14–7" | sql_create_context |
CREATE TABLE table_79976 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | Who is the away captain for Kingsmead? | SELECT "Away captain" FROM table_79976 WHERE "Venue" = 'kingsmead' | wikisql |
CREATE TABLE table_204_163 (
id number,
"airline" text,
"icao" text,
"iata" text,
"callsign" text,
"commenced\noperations" number
) | which airlines have not commenced operations as of 2013 ? | SELECT "airline" FROM table_204_163 WHERE "commenced\noperations" IS NULL | squall |
CREATE TABLE table_203_759 (
id number,
"year" number,
"company" text,
"number of members affected" number,
"duration of strike" text,
"notes" text
) | how many total people were impacted by the southern bell telephone co. strike in 1955 ? | SELECT "number of members affected" FROM table_203_759 WHERE "company" = 'southern bell telephone co' AND "year" = 1955 | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | give me the number of patients whose ethnicity is black/african american and age is less than 83? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.age < "83" | mimicsql_data |
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... | 患者17848592在医院7692804入院是有哪些在住院就诊记录里名字不包含咨询的科室? | SELECT * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.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_info.YLJGDM AND person_info_hz_i... | css |
CREATE TABLE table_61551 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What place is John Cook in? | SELECT "Place" FROM table_61551 WHERE "Player" = 'john cook' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction 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,
admi... | After 17:45 A.M. which section is in MICRBIOL 510 ? | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '17:45' AND course.course_id = course_offering.course_id AND course.department = 'MICRBIOL' AND course.number = 510 AND semester.semester = 'WN' ... | advising |
CREATE TABLE table_13829 (
"Date" real,
"Ships sunk (Pola)" text,
"Tonnage" text,
"U-boats destroyed (KuK)" text,
"U-boats destroyed (Pola)" text
) | What is the listed Tonnage that has U-boats destroyed (KuK) of 2 and Ships sunk (Pola) of (not recorded)? | SELECT "Tonnage" FROM table_13829 WHERE "U-boats destroyed (KuK)" = '2' AND "Ships sunk (Pola)" = '(not recorded)' | wikisql |
CREATE TABLE product_characteristics (
product_id VARCHAR,
characteristic_id VARCHAR
)
CREATE TABLE products (
product_id VARCHAR,
product_name VARCHAR
)
CREATE TABLE CHARACTERISTICS (
characteristic_name VARCHAR,
characteristic_data_type VARCHAR,
characteristic_id VARCHAR
) | List all the characteristic names and data types of product 'cumin'. | SELECT t3.characteristic_name, t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "cumin" | sql_create_context |
CREATE TABLE table_name_61 (
pick VARCHAR,
position VARCHAR
) | How many Picks have a Position of defensive back? | SELECT COUNT(pick) FROM table_name_61 WHERE position = "defensive back" | 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 diagnoses (
... | which ethnic background does the patient paul edwards belong to? | SELECT demographic.ethnicity FROM demographic WHERE demographic.name = "Paul Edwards" | mimicsql_data |
CREATE TABLE table_11274 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" real
) | What's the lowest place for song 'starac i more' with draw over 13? | SELECT MIN("Place") FROM table_11274 WHERE "Song" = 'starac i more' AND "Draw" > '13' | wikisql |
CREATE TABLE table_24639086_3 (
written_by VARCHAR,
season__number VARCHAR
) | If the season number is 2.08, who was the episode written by? | SELECT written_by FROM table_24639086_3 WHERE season__number = "2.08" | sql_create_context |
CREATE TABLE airlines (
alid integer,
name text,
iata varchar(2),
icao varchar(3),
callsign text,
country text,
active varchar(2)
)
CREATE TABLE routes (
rid integer,
dst_apid integer,
dst_ap varchar(4),
src_apid bigint,
src_ap varchar(4),
alid bigint,
airline va... | A bar chart for what are the number of the countries of all airlines whose names start with Orbit?, could you sort by the y-axis in desc? | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY COUNT(country) DESC | nvbench |
CREATE TABLE table_name_14 (
performer_4 VARCHAR,
performer_3 VARCHAR,
episode VARCHAR
) | What was Performer 4's name when Performer 3 was Ryan Stiles on episode 14? | SELECT performer_4 FROM table_name_14 WHERE performer_3 = "ryan stiles" AND episode = 14 | sql_create_context |
CREATE TABLE table_name_12 (
country VARCHAR,
to_par VARCHAR,
score VARCHAR
) | What is the Country of the Player with a To par of +1 and a Score of 74-70-70=214? | SELECT country FROM table_name_12 WHERE to_par = "+1" AND score = 74 - 70 - 70 = 214 | 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
)
... | what is the number of patients whose primary disease is upper gi bleed and year of death is less than or equal to 2154? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "UPPER GI BLEED" AND demographic.dod_year <= "2154.0" | mimicsql_data |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
... | when did patient 8103 in 2105 get discharged from the hospital for the first time? | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 8103 AND STRFTIME('%y', admissions.dischtime) = '2105' ORDER BY admissions.dischtime LIMIT 1 | mimic_iii |
CREATE TABLE table_598 (
"No" real,
"Player" text,
"Height" text,
"Position" text,
"Year born" real,
"Current Club" text
) | What year was the player with the height 2.04 born? | SELECT MIN("Year born") FROM table_598 WHERE "Height" = '2.04' | wikisql |
CREATE TABLE table_name_94 (
country VARCHAR,
catalogue_number_s_ VARCHAR
) | Which Country has a Catalogue number(s) of eredv711? | SELECT country FROM table_name_94 WHERE catalogue_number_s_ = "eredv711" | sql_create_context |
CREATE TABLE table_name_25 (
avge VARCHAR,
name VARCHAR,
goals VARCHAR
) | What is the total avge of John Hall, who has less than 63 goals? | SELECT COUNT(avge) FROM table_name_25 WHERE name = "john hall" AND goals < 63 | sql_create_context |
CREATE TABLE table_35122 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | What is the smallest ERP W with a frequency MHz of 94.9? | SELECT MIN("ERP W") FROM table_35122 WHERE "Frequency MHz" = '94.9' | wikisql |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
) | What are the names of climbers and the corresponding heights of the mountains that they climb Show bar chart, and I want to show X-axis from high to low order. | SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_19874 (
"Task No." real,
"Day announced" text,
"Description" text,
"Options" text,
"Viewers selection" text,
"Result" text
) | What was the description when the viewers selected Nan? | SELECT "Description" FROM table_19874 WHERE "Viewers selection" = 'Nan' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id numbe... | tell me the number of times patient 2514 had taken lipids 20% on 07/13/this year. | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2514)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'lipids 20%' A... | mimic_iii |
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCHAR(40),
Credits INTEGER,
Instructor INTEGER,
Days VARCHAR(5),
Hours VARCHAR(11),
DNO INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
... | A bar chart shows the distribution of Days and the average of Instructor , and group by attribute Days. | SELECT Days, AVG(Instructor) FROM Course GROUP BY Days ORDER BY Credits | nvbench |
CREATE TABLE table_name_84 (
time VARCHAR,
news_freq VARCHAR,
show_name VARCHAR
) | Which time has a news frequency of 1 hour and show name of Best Mix Overnight? | SELECT time FROM table_name_84 WHERE news_freq = "1 hour" AND show_name = "best mix overnight" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid ... | what was patient 006-185446's last time of insulin regular intake? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-185446')) AND intakeoutput.cellpath LIKE '%intake... | eicu |
CREATE TABLE table_26355116_1 (
nickname VARCHAR,
school VARCHAR
) | What is the nickname of the University of Alabama? | SELECT nickname FROM table_26355116_1 WHERE school = "University of Alabama" | sql_create_context |
CREATE TABLE table_19720 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | What was the final score of the game against the Dallas Cowboys? | SELECT "Result" FROM table_19720 WHERE "Opponent" = 'Dallas Cowboys' | wikisql |
CREATE TABLE table_203_13 (
id number,
"year" number,
"champion" text,
"score" text,
"runner-up" text,
"coach" text
) | in what year was their largest margin of victory ? | SELECT "year" FROM table_203_13 ORDER BY "score" - "score" DESC LIMIT 1 | squall |
CREATE TABLE table_79322 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | During what competition was a game played with a score of 3 1? | SELECT "Competition" FROM table_79322 WHERE "Score" = '3–1' | wikisql |
CREATE TABLE table_name_73 (
date VARCHAR,
week VARCHAR
) | When has a Week of 8? | SELECT date FROM table_name_73 WHERE week = 8 | sql_create_context |
CREATE TABLE table_78845 (
"Season" text,
"League" text,
"Teams" text,
"Home" text,
"Away" text
) | Which season has the regionalliga s d (iii) league? | SELECT "Season" FROM table_78845 WHERE "League" = 'regionalliga süd (iii)' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.