context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_16350 (
"Year [e ] (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
) | Who were the directors of the film with the original title o.k.? | SELECT "Director" FROM table_16350 WHERE "Original title" = 'o.k.' | wikisql |
CREATE TABLE table_44607 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is Date, when Championship is Mackay? | SELECT "Date" FROM table_44607 WHERE "Championship" = 'mackay' | wikisql |
CREATE TABLE table_name_37 (
total INTEGER,
gold VARCHAR,
bronze VARCHAR,
nation VARCHAR
) | what is the total when bronze is more than 1, nation is hong kong (hkg) and gold is less than 3? | SELECT SUM(total) FROM table_name_37 WHERE bronze > 1 AND nation = "hong kong (hkg)" AND gold < 3 | sql_create_context |
CREATE TABLE table_74566 (
"Area" text,
"Advertisement date" text,
"Block" text,
"Winning applicant" text,
"Ensemble name" text
) | Which Block does Northamptonshire Area have? | SELECT "Block" FROM table_74566 WHERE "Area" = 'northamptonshire' | wikisql |
CREATE TABLE table_name_15 (
architecture VARCHAR,
vehicle_name VARCHAR
) | What type of architecture does the Saturn Vue have? | SELECT architecture FROM table_name_15 WHERE vehicle_name = "saturn vue" | sql_create_context |
CREATE TABLE table_name_43 (
year INTEGER,
location VARCHAR,
champion VARCHAR
) | When is the earliest year in milan that guillermo vilas was champion? | SELECT MIN(year) FROM table_name_43 WHERE location = "milan" AND champion = "guillermo vilas" | 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... | count the number of elective hospital admission patients who have been diagnosed with subarachnoid hemorrhage. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Subarachnoid hemorrhage" | mimicsql_data |
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 patients whose days of hospital stay is greater than 34 and drug route is both eyes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "34" AND prescriptions.route = "BOTH EYES" | mimicsql_data |
CREATE TABLE table_55073 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was Richmond's score when it was the away team? | SELECT "Away team score" FROM table_55073 WHERE "Away team" = 'richmond' | wikisql |
CREATE TABLE table_39744 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the date for the game with an opponent of the Houston Oilers from before week 3? | SELECT "Date" FROM table_39744 WHERE "Week" < '3' AND "Opponent" = 'houston oilers' | wikisql |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cine... | Show each location and the number of cinemas there Show bar chart, rank by the bars in descending. | SELECT Location, COUNT(*) FROM cinema GROUP BY Location ORDER BY Location DESC | nvbench |
CREATE TABLE table_203_522 (
id number,
"week" number,
"date" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"venue" text,
"attendance" number
) | which is the only opponent to have used the lambeau field ? | SELECT "opponent" FROM table_203_522 WHERE "venue" = 'lambeau field' | squall |
CREATE TABLE table_29042 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | What was the original air date of the episode that was directed by Jessica Landaw? | SELECT "Original air date" FROM table_29042 WHERE "Directed by" = 'Jessica Landaw' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDat... | posts with the most suggested edits. | SELECT p.Id AS "post_link", SUM(CASE WHEN s.ApprovalDate IS NULL THEN 0 ELSE 1 END) AS "accepted", SUM(CASE WHEN s.ApprovalDate IS NULL THEN 1 ELSE 0 END) AS "rejected", COUNT(*) AS "total" FROM Posts AS p, SuggestedEdits AS s WHERE p.Id = s.PostId GROUP BY p.Id ORDER BY 'total' DESC LIMIT 1000 | sede |
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,... | what is the number of patients whose admission location is emergency room admit and item id is 51032? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.itemid = "51032" | mimicsql_data |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean... | Posts where a given tag was added and removed. | WITH firstWITHtag_cte AS (SELECT DISTINCT p.Id AS pid, MIN(ph1.Id) AS phWITHId FROM PostHistory AS ph1 INNER JOIN Posts AS p ON ph1.PostId = p.Id WHERE ph1.PostHistoryTypeId IN (3, 6, 9) AND ph1.Text LIKE '%<##tagName##>%' GROUP BY p.Id), firstWITHouttag_cte AS (SELECT pid, phWITHId, MIN(ph2.Id) AS phWITHoutId FROM fir... | sede |
CREATE TABLE addresses (
address_id number,
line_1_number_building text,
city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE staff (
staff_id number,
staff_address_id number,
nickname text,
first_name text,
middle_name text,
last_name te... | What is maximum, minimum and average amount of outstanding of customer? | SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM customers | spider |
CREATE TABLE table_name_93 (
chassis VARCHAR,
year VARCHAR,
engine VARCHAR,
points VARCHAR
) | What kind of Chassis supports a Maserati Straight-6 engine with Points greater than 0 and built in the year 1955? | SELECT chassis FROM table_name_93 WHERE engine = "maserati straight-6" AND points > 0 AND year = 1955 | 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... | 列出患者赵星波被开出的所有检验报告单在2011-11-25到2013-05-15期间的检验报告单号是什么? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ... | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients whose admission year is less than 2157 and diagnoses icd9 code is 82022? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2157" AND diagnoses.icd9_code = "82022" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is drug type and drug name of drug code hydz20i? | SELECT prescriptions.drug_type, prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "HYDZ20I" | mimicsql_data |
CREATE TABLE table_name_40 (
location VARCHAR,
iteration VARCHAR
) | What is the Location of the 10th Iteration? | SELECT location FROM table_name_40 WHERE iteration = "10th" | sql_create_context |
CREATE TABLE table_name_40 (
record VARCHAR,
home VARCHAR
) | what game was in chicago | SELECT record FROM table_name_40 WHERE home = "chicago" | sql_create_context |
CREATE TABLE table_name_4 (
year INTEGER
) | Which 2nd day has a year prior to 2009? | SELECT 2 AS nd_day FROM table_name_4 WHERE year < 2009 | sql_create_context |
CREATE TABLE table_28316 (
"City / Municipality" text,
"Date of Creation" text,
"Area (km 2 )" text,
"Population (2010)" real,
"Income Classification ( DOF )" text
) | What is the area (km2) for the place with a 2010 population of 153085? | SELECT "Area (km 2 )" FROM table_28316 WHERE "Population (2010)" = '153085' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 俞玉轩这位参保人住院整数金额有多少次 | SELECT COUNT(*) FROM t_kc21 WHERE PERSON_NM = '俞玉轩' AND CLINIC_TYPE = '住院' AND MOD(MED_AMOUT, 1) = 0 | css |
CREATE TABLE table_28345 (
"Road race" text,
"Distance" text,
"Location" text,
"Country" text,
"Month held" text
) | What's the whole range of united states where road race is ottawa marathon | SELECT COUNT("Country") FROM table_28345 WHERE "Road race" = 'Ottawa Marathon' | wikisql |
CREATE TABLE table_name_57 (
party VARCHAR,
incumbent VARCHAR
) | What is the party affiliation of Virginia Foxx? | SELECT party FROM table_name_57 WHERE incumbent = "virginia foxx" | sql_create_context |
CREATE TABLE table_50676 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What was the total for the golfer who had a year won of 1987? | SELECT "Total" FROM table_50676 WHERE "Year(s) won" = '1987' | wikisql |
CREATE TABLE table_20157 (
"Kinship" text,
"Proto-Austronesian" text,
"Proto-Malayo-Polynesian" text,
"Proto-Oceanic" text,
"Proto-Polynesian" text
) | Name the proto-austrronesian for *pine, *papine | SELECT "Proto-Austronesian" FROM table_20157 WHERE "Proto-Oceanic" = '*pine, *papine' | 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... | 吴德泽病患的药品消费不低于5837.52元的医疗记录有哪几次?把医疗就诊编号一一列出来 | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '吴德泽' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT < 5837.52) | css |
CREATE TABLE table_name_64 (
score VARCHAR,
to_par VARCHAR,
player VARCHAR
) | What is Anders Forsbrand's score with a to par of +1? | SELECT score FROM table_name_64 WHERE to_par = "+1" AND player = "anders forsbrand" | sql_create_context |
CREATE TABLE table_name_15 (
city_population__2009_ INTEGER,
serial_no VARCHAR,
city_area_km_2__ VARCHAR,
district VARCHAR
) | What was the lowest city population for the district of rajanpur district with a area of 6 km squared and a serial number less than 29? | SELECT MIN(city_population__2009_) FROM table_name_15 WHERE city_area_km_2__ = 6 AND district = "rajanpur district" AND serial_no < 29 | sql_create_context |
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... | 查一下46226661513这个医疗就诊中,哪些药是昌医师开具的 | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '46226661513' AND HOSP_DOC_NM LIKE '昌%' | css |
CREATE TABLE table_2950964_5 (
isbn VARCHAR,
title VARCHAR
) | The Ring of Steel possesses what ISBN? | SELECT isbn FROM table_2950964_5 WHERE title = "The Ring Of Steel" | sql_create_context |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
dat... | Scatterplot of card_number vs customer id by card_type_code | SELECT customer_id, card_number FROM Customers_Cards GROUP BY card_type_code | nvbench |
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 much does sao2 change for patient 011-23004 last measured on the last icu visit compared to the value first measured on the last icu visit? | SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-23004') AND NOT patient.unitdischargetime IS NULL ... | eicu |
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... | 能举出在2002年7月9日到2012年2月15日这段时间患者21625825被开出的所有检验报告单的检验报告单号具体都有啥吗? | SELECT zyjybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '21625825' AND zyjybgb.BGRQ BETWEEN '2002-07-09' AND '2012-02... | css |
CREATE TABLE table_name_46 (
date VARCHAR,
home_team VARCHAR
) | What was the date of the footscray home game? | SELECT date FROM table_name_46 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE table_name_5 (
name VARCHAR,
number VARCHAR
) | What name has 8 as the number? | SELECT name FROM table_name_5 WHERE number = "8" | sql_create_context |
CREATE TABLE table_31220 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
) | What is the L when the skip club is Jeff Richard (kelowna)? | SELECT MAX("L") FROM table_31220 WHERE "Skip (Club)" = 'Jeff Richard (Kelowna)' | wikisql |
CREATE TABLE table_name_90 (
evening_gown VARCHAR,
swimsuit VARCHAR,
country VARCHAR
) | Name the evening gown for swimsuit more than 9.51 for maryland | SELECT evening_gown FROM table_name_90 WHERE swimsuit > 9.51 AND country = "maryland" | sql_create_context |
CREATE TABLE table_52123 (
"Airing date" text,
"English title (Chinese title)" text,
"Number of episodes" real,
"Genre" text,
"Official website" text
) | What genre is revolving doors of vengeance ? | SELECT "Genre" FROM table_52123 WHERE "English title (Chinese title)" = 'revolving doors of vengeance 酒店風雲' | wikisql |
CREATE TABLE table_34532 (
"Name" text,
"Town/City" text,
"Borough" text,
"Region" text,
"Type" text
) | In what Town/City is Nana Museum of The Arctic located? | SELECT "Town/City" FROM table_34532 WHERE "Name" = 'nana museum of the arctic' | wikisql |
CREATE TABLE table_22592 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | What episode number in the series originally aired on February 25, 2001? | SELECT "No. in series" FROM table_22592 WHERE "Original air date" = 'February 25, 2001' | wikisql |
CREATE TABLE table_204_337 (
id number,
"festival" text,
"year" number,
"award" text,
"nominee" text,
"result" text
) | how many festivals were held after 2012 ? | SELECT COUNT("festival") FROM table_204_337 WHERE "year" > 2012 | squall |
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... | 医疗费总额与医疗就诊03425240816相同的医疗就诊记录有哪些呢?查出这些记录的ID、人员ID、人员姓名、公民身份号码、人员性别、人员年龄 | SELECT t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.... | css |
CREATE TABLE table_47403 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the points when played is less than 38? | SELECT SUM("Points") FROM table_47403 WHERE "Played" < '38' | wikisql |
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 patients whose year of birth is less than 2060 and lab test fluid is ascites? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2060" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_7232 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Attendance" real
) | What is the result against Clemson? | SELECT "Result" FROM table_7232 WHERE "Opponent" = 'clemson' | wikisql |
CREATE TABLE table_17526 (
"Season" text,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | Name the number of mens doubles for 2004/2005 | SELECT COUNT("Mens doubles") FROM table_17526 WHERE "Season" = '2004/2005' | wikisql |
CREATE TABLE Documents_with_expenses (
document_id VARCHAR
)
CREATE TABLE Documents (
document_id VARCHAR
) | What are the ids of documents which don't have expense budgets? | SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses | 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... | 编号为23981403团伙成员有哪些药是其最常开的排一下序? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '23981403' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.ME... | css |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | what is the maximum total cost of a hospital with t3 since 5 years ago? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 't3')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-5 ... | eicu |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Is Prof. Kubena the only teacher of Pd Anes Rotatn ? | 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 '%Pd Anes Rotatn%' AND NOT instructor.name LIKE '%Kubena%' AND offering_instructor.instructor_id = instruct... | advising |
CREATE TABLE table_13020 (
"Team" text,
"2005\u201306 Pts" real,
"2006\u201307 Pts" real,
"2007\u201308 Pts" real,
"Total Pts" real,
"Total Pld" real
) | Which 2005 06 Pts has a Team of estudiantes (lp), and a 2006 07 Pts smaller than 81? | SELECT COUNT("2005\u201306 Pts") FROM table_13020 WHERE "Team" = 'estudiantes (lp)' AND "2006\u201307 Pts" < '81' | wikisql |
CREATE TABLE table_name_14 (
venue VARCHAR,
away_team VARCHAR
) | Which venue has an Away team of south melbourne? | SELECT venue FROM table_name_14 WHERE away_team = "south melbourne" | sql_create_context |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Number of questions tagged with 'qt' and ('iOS' or 'Android'). | SELECT COUNT(*) FROM (SELECT PostId FROM PostTags WHERE TagId IN (SELECT Id FROM Tags WHERE TagName LIKE '%qt%') INTERSECT (SELECT PostId FROM PostTags WHERE TagId IN (SELECT Id FROM Tags WHERE TagName LIKE '%ios%') UNION SELECT PostId FROM PostTags WHERE TagId IN (SELECT Id FROM Tags WHERE TagName LIKE '%android%'))) ... | sede |
CREATE TABLE table_38470 (
"Storm name" text,
"Dates active" text,
"Max 1-min wind mph (km/h)" text,
"Min. press. ( mbar )" text,
"Damage (millions USD )" text,
"Deaths" text
) | Which Max 1-min wind mph (km/h) that has Dates active on september22 september28? | SELECT "Max 1-min wind mph (km/h)" FROM table_38470 WHERE "Dates active" = 'september22– september28' | wikisql |
CREATE TABLE table_204_833 (
id number,
"game" number,
"date" text,
"team" text,
"score" text,
"high points" text,
"high rebounds" text,
"high assists" text,
"location\nattendance" text,
"record" text
) | which game at most has the most high rebounds ? | SELECT "game" FROM table_204_833 ORDER BY "high rebounds" DESC LIMIT 1 | squall |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | show me the available flights from SAN FRANCISCO to BOSTON on 11 24 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 24 AND date_day.month_number = 11 AND d... | atis |
CREATE TABLE table_name_10 (
date VARCHAR,
series VARCHAR
) | What was the date of the game when the record of the series was 0 1? | SELECT date FROM table_name_10 WHERE series = "0–1" | sql_create_context |
CREATE TABLE table_62737 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text
) | What's the date of the circuit Winton Motor Raceway? | SELECT "Date" FROM table_62737 WHERE "Circuit" = 'winton motor raceway' | wikisql |
CREATE TABLE table_15618241_1 (
purse___us INTEGER,
year VARCHAR
) | Name the least purse for 2011 | SELECT MIN(purse___us) AS $__ FROM table_15618241_1 WHERE year = 2011 | 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 candidiasis of skin and nails diagnoses have been hospitalized for more than 4 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "4" AND diagnoses.long_title = "Candidiasis of skin and nails" | mimicsql_data |
CREATE TABLE table_64149 (
"Rank" text,
"Country" text,
"Jerseys" real,
"Vuelta Wins" real,
"Points" real,
"Combo'" real,
"Different holders" real
) | How many times is the country ireland and points more than 4? | SELECT COUNT("Vuelta Wins") FROM table_64149 WHERE "Country" = 'ireland' AND "Points" > '4' | wikisql |
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city... | What are the ids of all students who have advisor number 1121? | SELECT stuid FROM student WHERE advisor = 1121 | spider |
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 demographic (
subject_id text,
hadm_id t... | provide the number of patients whose language is port and days of hospital stay is greater than 6? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PORT" AND demographic.days_stay > "6" | mimicsql_data |
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... | 以前,患者曹烨磊做过那些治疗? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '曹烨磊' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.P... | css |
CREATE TABLE table_name_46 (
area_km_2 INTEGER,
official_name VARCHAR
) | Notre-Dame-De-Lourdes has what average area km 2? | SELECT AVG(area_km_2) FROM table_name_46 WHERE official_name = "notre-dame-de-lourdes" | 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... | How many patients of white russian ethnicity had a procedure for dorsal and dorsolumbar fusion of the posterior column posterior technique? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND procedures.long_title = "Dorsal and dorsolumbar fusion of the posterior column, posterior technique" | mimicsql_data |
CREATE TABLE table_name_34 (
country VARCHAR,
date VARCHAR
) | What is the country associated with the date in 2003? | SELECT country FROM table_name_34 WHERE date = "2003" | sql_create_context |
CREATE TABLE table_74217 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the high points when the score was w 112-110? | SELECT "High points" FROM table_74217 WHERE "Score" = 'W 112-110' | wikisql |
CREATE TABLE table_31660 (
"Date" text,
"Result" text,
"Opponent" text,
"Method" text,
"Round" real
) | When did the opponent knockout Barry Prior in more than 2 rounds? | SELECT "Date" FROM table_31660 WHERE "Method" = 'knockout' AND "Round" > '2' AND "Opponent" = 'barry prior' | wikisql |
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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit... | what was the name of the specimen test that patient 61683 had received the first time until 09/2104? | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61683) AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2104-09' ORDER BY microbiologyevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_13258876_2 (
opponent VARCHAR,
attendance VARCHAR
) | Who did the Seahawks play when the listed attendance was 61615? | SELECT opponent FROM table_13258876_2 WHERE attendance = 61615 | sql_create_context |
CREATE TABLE table_674 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what are all the result for New York 16 district | SELECT "Result" FROM table_674 WHERE "District" = 'New York 16' | wikisql |
CREATE TABLE table_name_25 (
country VARCHAR,
author VARCHAR
) | Waht is the Country of the play by Author Aristophanes? | SELECT country FROM table_name_25 WHERE author = "aristophanes" | sql_create_context |
CREATE TABLE table_name_29 (
no_8 VARCHAR,
no_4 VARCHAR,
no_7 VARCHAR
) | What is the No. 8 of the person with a No. 4 of Matthew and a No. 7 of Anthony? | SELECT no_8 FROM table_name_29 WHERE no_4 = "matthew" AND no_7 = "anthony" | sql_create_context |
CREATE TABLE table_35951 (
"Nation" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | In what nation did Darko Sovran place third? | SELECT "Nation" FROM table_35951 WHERE "Third" = 'darko sovran' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 从08年5月3日到11年5月6日患者77333677检查的次数是多少? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '77333677' AND t_kc22.STA_DATE BETWEEN '2008-05-03' AND '2011-05-06' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB d... | How many professors have a Ph.D. in each department. Show bar chart. | SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_204_788 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | who finished the same amount of laps as belmondo ? | SELECT "driver" FROM table_204_788 WHERE "driver" <> 'paul belmondo' AND "laps" = (SELECT "laps" FROM table_204_788 WHERE "driver" = 'paul belmondo') | 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... | 参保人94302117入院整数金额次数有多少次? | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '94302117' AND t_kc21.CLINIC_TYPE = '住院' AND MOD(t_kc21.MED_AMOUT, 1) = 0 | css |
CREATE TABLE table_name_35 (
q1 VARCHAR,
q2_time VARCHAR,
q1_order VARCHAR
) | What is the Q1+Q2 time for the driver whose Q1 order was 13? | SELECT q1 + q2_time FROM table_name_35 WHERE q1_order = 13 | sql_create_context |
CREATE TABLE table_3644 (
"Country or territory with flag" text,
"Area (km\u00b2) (per sqmi)" text,
"Population (July 2009 est.)" real,
"Population density per km\u00b2" text,
"Capital" text
) | What was the maximum population of the country with Quito as capital? | SELECT MAX("Population (July 2009 est.)") FROM table_3644 WHERE "Capital" = 'Quito' | wikisql |
CREATE TABLE table_27615896_20 (
status VARCHAR,
points VARCHAR
) | What's the status of the player with 3041 points? | SELECT status FROM table_27615896_20 WHERE points = 3041 | sql_create_context |
CREATE TABLE table_name_12 (
played INTEGER,
team VARCHAR,
against VARCHAR
) | What is the sum of games Played by the Team Vasco Da Gama, with fewer than 12 Against? | SELECT SUM(played) FROM table_name_12 WHERE team = "vasco da gama" AND against < 12 | sql_create_context |
CREATE TABLE table_34402 (
"Club" text,
"Wins" real,
"Last Win" text,
"Runners-up" real,
"Last Runners-up" real
) | What is the number of Last Runners-up that has the club name of dempo sc? | SELECT SUM("Last Runners-up") FROM table_34402 WHERE "Club" = 'dempo sc' | wikisql |
CREATE TABLE zzmzjzjlb (
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... | 列出患者奚经略所有检验结果指标记录中的检测方法在2007-09-21到2008-12-08内有什么? | SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.... | css |
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... | 从03年8月17日开始直到14年5月16日,患者秦鹏赋的住院次数是多少? | SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_SEX = '秦鹏赋' AND zyb.IN_HOSP_DAYS BETWEEN '2003-08-17' AND '2014-05-16' | css |
CREATE TABLE table_27893892_2 (
game_site VARCHAR,
date VARCHAR
) | what is the location for saturday, april 21 | SELECT game_site FROM table_27893892_2 WHERE date = "Saturday, April 21" | sql_create_context |
CREATE TABLE table_test_22 (
"id" int,
"ejection_fraction_ef" int,
"pregnancy_or_lactation" bool,
"child_pugh_class" string,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"active_infection" bool,
"leukocyte_count" int,
"hiv_infection" bool,
"left_ventricular_dysfunction" bool,
... | known active infection or chronic infection with hiv, hbv or hcv | SELECT * FROM table_test_22 WHERE active_infection = 1 OR active_infection = 1 AND (hiv_infection = 1 OR hbv = 1 OR hcv = 1) | criteria2sql |
CREATE TABLE table_11686 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team that hosted an away team with a score of 21.15 (141)? | SELECT "Home team" FROM table_11686 WHERE "Away team score" = '21.15 (141)' | wikisql |
CREATE TABLE table_30466 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Team classification" text
) | When michael reihs is the mountains classification what is the stage? | SELECT "Stage" FROM table_30466 WHERE "Mountains classification" = 'Michael Reihs' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在哪几家医院患者陈乐湛被开出过药品213784238? | SELECT t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '陈乐湛' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '213784238') | css |
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... | 编码为69103720的病患有哪些检验报告单的报告日期在21年11月4日以前?这些报告单对应的住院就诊的流水号是什么 | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '69103720' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2021-11-04' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb... | css |
CREATE TABLE table_6959 (
"Date" text,
"Title" text,
"Director" text,
"Producer" text,
"Production Cost" text,
"Singapore Gross" text
) | What is the name of the director who directed the movie that Raintree Pictures produced? | SELECT "Director" FROM table_6959 WHERE "Producer" = 'raintree pictures' | wikisql |
CREATE TABLE table_11348 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | What was the result on 1990-11-04? | SELECT "Result" FROM table_11348 WHERE "Date" = '1990-11-04' | wikisql |
CREATE TABLE table_name_51 (
round VARCHAR,
surface VARCHAR,
opponent VARCHAR
) | What's Round has a Surface of hard and Opponent of Jelena Simic? | SELECT round FROM table_name_51 WHERE surface = "hard" AND opponent = "jelena simic" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.