context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_90 (
player VARCHAR,
place VARCHAR,
country VARCHAR
) | Who has a place of T7 and is from the United States? | SELECT player FROM table_name_90 WHERE place = "t7" AND country = "united states" | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_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,
... | 医院1900114中单价最高的患者21485538在被开出的药品编码和名称及其单价分别是? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '21485538' AND t_kc21.MED_SER_ORG_NO = '1900114') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1 | css |
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 从00年3月11日直到2001年6月23日之间医疗机构8880467处理的新生儿门诊的就诊次数一共是多少次? | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '8880467' AND wdmzjzjlb.JZKSRQ BETWEEN '2000-03-11' AND '2001-06-23' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '8880467' AND bdmzjzjlb.JZKSRQ BETWEEN '2000-03-11' AND '2001-06-23' AND bdmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE table_name_40 (
total INTEGER,
gold VARCHAR,
rank VARCHAR
) | What is the highest total number of medals for a team ranked smaller than 1 and had 20 gold medals? | SELECT MAX(total) FROM table_name_40 WHERE gold = 20 AND rank < 1 | sql_create_context |
CREATE TABLE table_10361453_2 (
attendance INTEGER,
record VARCHAR
) | The record of 7-3 had the largest attendance of what? | SELECT MAX(attendance) FROM table_10361453_2 WHERE record = "7-3" | sql_create_context |
CREATE TABLE table_name_14 (
money___ INTEGER,
country VARCHAR,
to_par VARCHAR
) | What is the average Money ( $ ), when Country is 'United States', and when To par is '+3'? | SELECT AVG(money___) AS $__ FROM table_name_14 WHERE country = "united states" AND to_par = "+3" | sql_create_context |
CREATE TABLE table_name_8 (
total INTEGER,
rank VARCHAR,
silver VARCHAR
) | Rank of 5, and a Silver larger than 0 had what sum of total? | SELECT SUM(total) FROM table_name_8 WHERE rank = "5" AND silver > 0 | sql_create_context |
CREATE TABLE table_16168 (
"County" text,
"Location" text,
"Street Names" text,
"Milepost" text,
"Roads Intersected" text,
"Notes" text
) | How many mileposts are there on Anne Street? | SELECT COUNT("Milepost") FROM table_16168 WHERE "Street Names" = 'Anne Street' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose diagnoses long title is abnormal coagulation profile and lab test category is chemistry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Abnormal coagulation profile" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_72017 (
"Wicket" text,
"Runs" text,
"Partnerships" text,
"Venue" text,
"Date" text
) | What venue did the partnership of herschelle gibbs / justin kemp happen? | SELECT "Venue" FROM table_72017 WHERE "Partnerships" = 'herschelle gibbs / justin kemp' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numbe... | when was the first time the heart rate of patient 10855 was measured on the current intensive care unit visit at less than 71.0? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH... | mimic_iii |
CREATE TABLE table_39781 (
"Index" text,
"Name" text,
"Song" text,
"Group Song" text,
"Score" text
) | What song had an index of m6? | SELECT "Song" FROM table_39781 WHERE "Index" = 'm6' | wikisql |
CREATE TABLE table_42376 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the 2nd leg that has 31-37 as the 1st leg? | SELECT "2nd leg" FROM table_42376 WHERE "1st leg" = '31-37' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Descr... | What tag is most common for first posts?. | SELECT COUNT(*) AS N, TagName FROM PostTags JOIN Tags AS t ON (t.Id = 2032) WHERE PostId IN (SELECT MIN(p.Id) FROM Users AS u JOIN Posts AS p ON (u.Id = OwnerUserId) JOIN PostTypes AS type ON (type.Id = PostTypeId) WHERE type.Name IN ('Question', 'Answer') GROUP BY OwnerUserId) GROUP BY TagName ORDER BY COUNT(*) DESC | sede |
CREATE TABLE table_24171 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original Airdate" text
) | Who was the director when the writer(s) was John W. Bloch? | SELECT "Director" FROM table_24171 WHERE "Writer(s)" = 'John W. Bloch' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | count the number of patients whose admission type is newborn and admission year is less than 2157? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admityear < "2157" | mimicsql_data |
CREATE TABLE body_builder (
body_builder_id number,
people_id number,
snatch number,
clean_jerk number,
total number
)
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
birth_date text,
birth_place text
) | What are the names of body builders in descending order of total scores? | SELECT T2.name FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id ORDER BY T1.total DESC | spider |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)... | please show me all fares for flights from DENVER to OAKLAND | SELECT DISTINCT fare.fare_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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
CREATE TABLE table_25461946_5 (
record VARCHAR,
date VARCHAR
) | How many games were played on november 27? | SELECT COUNT(record) FROM table_25461946_5 WHERE date = "November 27" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
had... | how much insulin human regular was prescribed to patient 40435 since 03/2104, for the first time? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435) AND prescriptions.drug = 'insulin human regular' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-03' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_7021 (
"Year" text,
"Team" text,
"SckY" text,
"Int%" text,
"Rate" text,
"RAtt" text,
"RYds" text,
"RAvg" text,
"RLng" text,
"R1st" text
) | What was the rate for 73 RYds? | SELECT "Rate" FROM table_7021 WHERE "RYds" = '73' | wikisql |
CREATE TABLE table_57915 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | On what Date is there a race on the Circuit of brands hatch? | SELECT "Date" FROM table_57915 WHERE "Circuit" = 'brands hatch' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 检验报告单的编码为23522676937的检测项目代码是什么?检测项目名字叫什么? | SELECT jybgb.JYXMDM, jybgb.JYXMMC FROM jybgb WHERE jybgb.BGDH = '23522676937' | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | count the number of patients who have received an gastroenterology consultation procedure during the same hospital encounter after getting a wound care procedure since 2105. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'wound care' AND STRFTIME('%y', treatment.treatmenttime) >= '2105') AS t1 ... | eicu |
CREATE TABLE table_32358 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team has the Brunswick Street Oval venue? | SELECT "Home team score" FROM table_32358 WHERE "Venue" = 'brunswick street oval' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
la... | what was the average value of patient 027-185580's triglycerides in the first hospital visit? | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-185580' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospita... | eicu |
CREATE TABLE table_61936 (
"Summoned" text,
"Elected" text,
"Assembled" text,
"Dissolved" text,
"1st member" text,
"2nd member" text
) | What is the dissolved date of the parliament assembled on 4 November 1461 with an unknown 2nd member? | SELECT "Dissolved" FROM table_61936 WHERE "2nd member" = 'unknown' AND "Assembled" = '4 november 1461' | wikisql |
CREATE TABLE table_name_57 (
distance VARCHAR,
athlete VARCHAR
) | What is Distance, when Athlete is 'Irving Saladino'? | SELECT distance FROM table_name_57 WHERE athlete = "irving saladino" | sql_create_context |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopi... | Median time of getting accepted answers. | WITH diffs AS (SELECT CAST(a.CreationDate - q.CreationDate AS FLOAT) AS d FROM Posts AS q JOIN Posts AS a ON a.Id = q.AcceptedAnswerId) SELECT ((SELECT MAX(d) FROM (SELECT PERCENT AS d FROM diffs ORDER BY d LIMIT 50) AS BottomHalf) + (SELECT MIN(d) FROM (SELECT PERCENT AS d FROM diffs ORDER BY d DESC LIMIT 50) AS TopHa... | sede |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | when had patient 010-32430 first been prescribed for metoprolol (lopressor) tab 25 mg and albuterol 2.5 mg/0.5ml ud inh soln at the same time until 04/2100? | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'metoprolol (lopressor) tab 25 mg' AND patient.uniquepid = '010-32430' AND STRFTIME('%y-%m', medication.drugstarttime) <= ... | eicu |
CREATE TABLE table_name_64 (
place VARCHAR,
money___$__ VARCHAR,
player VARCHAR
) | Which ranking has money of $82 and Al Watrous as the player? | SELECT place FROM table_name_64 WHERE money___$__ = 82 AND player = "al watrous" | sql_create_context |
CREATE TABLE table_name_49 (
last_issue VARCHAR,
title VARCHAR
) | What is the last issue entry for Aron's Absurd Armada? | SELECT last_issue FROM table_name_49 WHERE title = "aron's absurd armada" | sql_create_context |
CREATE TABLE table_21689 (
"Athlete" text,
"Event" text,
"Round of 32" text,
"Round of 16" text,
"Quarterfinals" text,
"Semifinals" text
) | Who did Abdelhafid Benchebla face in the quarterfinals? | SELECT "Quarterfinals" FROM table_21689 WHERE "Athlete" = 'Abdelhafid Benchebla' | wikisql |
CREATE TABLE table_name_16 (
attendance INTEGER,
record VARCHAR
) | What was the average attendance of a team with a 38 31 8 record? | SELECT AVG(attendance) FROM table_name_16 WHERE record = "38–31–8" | sql_create_context |
CREATE TABLE table_name_72 (
home_team VARCHAR,
venue VARCHAR
) | What home team plays at Arden Street Oval? | SELECT home_team FROM table_name_72 WHERE venue = "arden street oval" | sql_create_context |
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 mzjzjlb (
HXPLC number,
HZXM ... | 哪个科室负责检验检验报告单58304822879的,提供一下该科室的编码及名称 | SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.BGDH = '58304822879' | 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 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 admission location is trsf within this facility and primary disease is copd exacerbation? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "COPD EXACERBATION" | mimicsql_data |
CREATE TABLE table_7551 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the lowest Points with an against of 20 and less than 1 lost? | SELECT MIN("Points") FROM table_7551 WHERE "Against" = '20' AND "Lost" < '1' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 列出患者24372784入院科室名称包含职业病的在医院8690714中有什么住院就诊记录? | SELECT * FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb... | css |
CREATE TABLE table_71653 (
"Island" text,
"Location" text,
"Area ( ha )" real,
"Population" real,
"Height (m)" real
) | What is the highest population of Trondra Island in the Scalloway Islands? | SELECT MAX("Population") FROM table_71653 WHERE "Location" = 'scalloway islands' AND "Island" = 'trondra' | wikisql |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_las... | Show the booking status code and the corresponding number of bookings Show bar chart, and could you order by the total number in descending? | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY COUNT(*) DESC | nvbench |
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
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | until 09/2105 has patient 5395 received a rdw test? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5395) AND STRFTIME('%y-%m', labevents.charttime) <= '2105-09' | mimic_iii |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiolo... | did magnesium sulfate, hydralazine, or ns have been prescribed for patient 80555 in 12/2105? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80555) AND prescriptions.drug IN ('magnesium sulfate', 'hydralazine', 'ns') AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-12' | mimic_iii |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,... | what was patient 59275's first careunit of the ward until 2102? | SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59275) AND NOT transfers.careunit IS NULL AND STRFTIME('%y', transfers.intime) <= '2102' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTy... | Reciprocal accepting of answers for user questions. | WITH questions AS (SELECT p1.OwnerUserId AS question_userid, p2.OwnerUserId AS answer_userid, p1.Id FROM Posts AS p1 INNER JOIN Posts AS p2 ON p1.AcceptedAnswerId = p2.Id) SELECT q1.question_userid AS userid1, q1.answer_userid AS userid2, q1.Id, q2.Id FROM questions AS q1 INNER JOIN questions AS q2 ON q1.question_useri... | sede |
CREATE TABLE table_33032 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In which venue did the away team score 9.11 (65)? | SELECT "Venue" FROM table_33032 WHERE "Away team score" = '9.11 (65)' | wikisql |
CREATE TABLE table_203_531 (
id number,
"date" text,
"tournament" text,
"location" text,
"winner" text,
"score" text,
"1st prize ($)" number
) | which tournament had a prize no less than $ 1,100,000 ? | SELECT "tournament" FROM table_203_531 WHERE "1st prize ($)" >= 1100000 | squall |
CREATE TABLE invoices (
invoice_number number,
invoice_date time,
invoice_details text
)
CREATE TABLE orders (
order_id number,
customer_id number,
order_status text,
date_order_placed time,
order_details text
)
CREATE TABLE order_items (
order_item_id number,
product_id number... | Which order's shipment tracking number is '3452'? Give me the id of the order. | SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452" | spider |
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's the cost of a drug named insulin-regular (human) *unit* inj? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'insulin-regular (human) *unit* inj') | eicu |
CREATE TABLE table_name_28 (
crowd VARCHAR,
venue VARCHAR
) | What was the listed crowd at junction oval? | SELECT crowd FROM table_name_28 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE table_test_17 (
"id" int,
"anemia" bool,
"left_ventricular_ejection_fraction_lvef" int,
"systolic_blood_pressure_sbp" int,
"active_infection" bool,
"fever" bool,
"bradycardia" int,
"renal_disease" bool,
"oliguria" bool,
"creatinine_clearance_cl" float,
"left_vent... | oxygen saturation < 91 % on room air | SELECT * FROM table_test_17 WHERE oxygen_saturation < 91 | criteria2sql |
CREATE TABLE table_33797 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Who did the Browns play on October 13, 1968? | SELECT "Opponent" FROM table_33797 WHERE "Date" = 'october 13, 1968' | wikisql |
CREATE TABLE table_name_64 (
constructor VARCHAR,
location VARCHAR
) | Tell me the constructor for zolder | SELECT constructor FROM table_name_64 WHERE location = "zolder" | sql_create_context |
CREATE TABLE table_204_275 (
id number,
"date" text,
"city" text,
"opponent" text,
"results" text,
"scorers" text,
"type of game" text
) | what was the total number of friendly 's played ? | SELECT COUNT(*) FROM table_204_275 WHERE "type of game" = 'friendly' | squall |
CREATE TABLE table_23288 (
"Draw" real,
"Artist" text,
"Song" text,
"Jury votes" real,
"Televotes" real,
"Total votes" real,
"Result" text
) | How many televotes are there for 'Lujuria'? | SELECT "Televotes" FROM table_23288 WHERE "Song" = 'Lujuria' | wikisql |
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
)
... | provide the number of patients whose discharge location is long term care hospital and diagnoses short title is neuropathy in diabetes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND diagnoses.short_title = "Neuropathy in diabetes" | mimicsql_data |
CREATE TABLE table_name_68 (
region VARCHAR,
format VARCHAR,
catalog VARCHAR
) | What is the region for Catalog amlh 66078 in stereo lp format? | SELECT region FROM table_name_68 WHERE format = "stereo lp" AND catalog = "amlh 66078" | sql_create_context |
CREATE TABLE table_name_47 (
runs VARCHAR,
venue VARCHAR
) | Name the Runs which has Venue of adelaide oval , adelaide? | SELECT runs FROM table_name_47 WHERE venue = "adelaide oval , adelaide" | sql_create_context |
CREATE TABLE Video_Games (
GameID INTEGER,
GName VARCHAR(40),
GType VARCHAR(40)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Plays_Games (
S... | Show the relationship between average age and minimum age in a scatter chart. | SELECT AVG(Age), MIN(Age) FROM Student GROUP BY Major | nvbench |
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 ... | what was the last height of patient 19428 since 06/2100. | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'... | mimic_iii |
CREATE TABLE table_204_455 (
id number,
"rd." number,
"grand prix" text,
"date" text,
"location" text,
"pole position" text,
"fastest lap" text,
"winning driver" text,
"constructor" text,
"report" text
) | how many did alain prost have the fastest lap ? | SELECT COUNT(*) FROM table_204_455 WHERE "fastest lap" = 'alain prost' | squall |
CREATE TABLE table_101336_1 (
crystal_structure VARCHAR,
formula VARCHAR
) | What is the crystal structure for the formula yba 2 cu 3 o 7? | SELECT crystal_structure FROM table_101336_1 WHERE formula = "YBa 2 Cu 3 O 7" | 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 average age of patients whose age is greater than or equal to 79 and admission year is greater than or equal to 2111? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.age >= "79" AND demographic.admityear >= "2111" | mimicsql_data |
CREATE TABLE table_name_94 (
round INTEGER,
position VARCHAR
) | What was the lowest round for a tight end position? | SELECT MIN(round) FROM table_name_94 WHERE position = "tight end" | sql_create_context |
CREATE TABLE table_38451 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the number of March that has 25-10-9 record and a Game more than 44? | SELECT COUNT("March") FROM table_38451 WHERE "Record" = '25-10-9' AND "Game" > '44' | wikisql |
CREATE TABLE table_204_843 (
id number,
"volume" number,
"year" text,
"names" text,
"articles" number,
"pages" number,
"images" number,
"maps" number,
"number of copies" number
) | how many articles were published in the 6th volume ? | SELECT "articles" FROM table_204_843 WHERE "volume" = 6 | squall |
CREATE TABLE table_28107 (
"Company" text,
"Name" text,
"County" text,
"Militia Regiment" text,
"Commander" text,
"Organization Date" text
) | Name the company for desha county | SELECT "Company" FROM table_28107 WHERE "County" = 'Desha' | wikisql |
CREATE TABLE table_10021158_3 (
best_finish VARCHAR,
scoring_rank VARCHAR
) | When the scoring rank was 117, what was the best finish? | SELECT best_finish FROM table_10021158_3 WHERE scoring_rank = "117" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | what is patient 027-81062's minimum value of pt - inr in 09/2103? | SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-81062')) AND lab.labname = 'pt - inr' AND STRFTIME('%y-%m', lab.labresulttime)... | eicu |
CREATE TABLE table_20278716_2 (
mccain__percentage VARCHAR,
others__percentage VARCHAR
) | What percentage of voters chose McCain in the county where 1.1% of voters voted third party? | SELECT mccain__percentage FROM table_20278716_2 WHERE others__percentage = "1.1%" | sql_create_context |
CREATE TABLE table_name_24 (
home_team VARCHAR,
venue VARCHAR
) | In the game that took place at junction oval, how much did the home team score? | SELECT home_team AS score FROM table_name_24 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE table_49883 (
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | Which Report has a Winning driver of emerson fittipaldi? | SELECT "Report" FROM table_49883 WHERE "Winning driver" = 'emerson fittipaldi' | wikisql |
CREATE TABLE table_22164 (
"Title" text,
"Developer" text,
"Category" text,
"Function" text,
"Release date" text,
"Version" text
) | What functions were released on 2011-06-23? | SELECT "Function" FROM table_22164 WHERE "Release date" = '2011-06-23' | wikisql |
CREATE TABLE table_27378582_1 (
current_womens_lacrosse_conference VARCHAR,
nickname VARCHAR
) | Name the current womens lacrosse conference for bison | SELECT current_womens_lacrosse_conference FROM table_27378582_1 WHERE nickname = "Bison" | sql_create_context |
CREATE TABLE table_23248910_11 (
score VARCHAR,
game VARCHAR
) | What was the score in game 6? | SELECT score FROM table_23248910_11 WHERE game = 6 | sql_create_context |
CREATE TABLE table_name_36 (
draw VARCHAR,
lost VARCHAR,
match VARCHAR
) | How many draws correspond to more than 11 losses in a match less than 14? | SELECT COUNT(draw) FROM table_name_36 WHERE lost > 11 AND match < 14 | sql_create_context |
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
... | In how many different states are banks located? | SELECT COUNT(DISTINCT state) FROM bank | spider |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationD... | Percentage of Questions wiuthout the Accepted Answer @until. | SELECT (CAST(COUNT(q.Id) AS FLOAT) / (SELECT COUNT(*) FROM Posts WHERE Posts.CreationDate < @until AND PostTypeId = 1) * 100) AS AcceptedPercentage FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE a.PostTypeId = 2 AND q.CreationDate < @until | sede |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | what was the first coronary artery disease - significant risk factors diagnosis time of patient 005-18714 in 2104? | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-18714')) AND diagnosis.diagnosisname = 'coronary artery disea... | eicu |
CREATE TABLE table_name_41 (
home_team VARCHAR,
venue VARCHAR
) | What did the home team score when playing at Western Oval? | SELECT home_team AS score FROM table_name_41 WHERE venue = "western oval" | sql_create_context |
CREATE TABLE table_name_8 (
szdsz VARCHAR,
mszp VARCHAR,
date VARCHAR
) | What is the SZDSZ percentage with an MSZP of 25% on 25/2/2009? | SELECT szdsz FROM table_name_8 WHERE mszp = "25%" AND date = "25/2/2009" | sql_create_context |
CREATE TABLE table_2528382_2 (
co_stars VARCHAR,
music_director VARCHAR,
year VARCHAR
) | Which co-stars did Kalyanji-anandji direct in 1963? | SELECT co_stars FROM table_2528382_2 WHERE music_director = "Kalyanji-Anandji" AND year = "1963" | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar... | For PHRMACOL 611 , who usually teaches the class ? | SELECT COUNT(instructor.name), instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PHRMACOL' AND course.number = 611 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id ... | advising |
CREATE TABLE table_21561 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | Who left a position on 24 January? | SELECT "Outgoing manager" FROM table_21561 WHERE "Date of vacancy" = '24 January' | wikisql |
CREATE TABLE table_name_8 (
rider VARCHAR,
rank VARCHAR,
time VARCHAR
) | Rank smaller than 5, and a Time of 31 03.093 is what rider? | SELECT rider FROM table_name_8 WHERE rank < 5 AND time = "31’ 03.093" | sql_create_context |
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 medication (
medicationid ... | indicate the monthly maximum amount of heartrate for patient 022-44805 until 12 days ago. | SELECT MAX(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-44805')) AND NOT vitalperiodic.heartrate IS NULL... | eicu |
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... | 对于被门诊诊断为疾病号码E70.881的人来说甲胎蛋白的参考值范畴下限和上限为多少? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.... | css |
CREATE TABLE table_name_85 (
tournament VARCHAR,
finalist VARCHAR
) | Which tournament had Richard Krajicek as a finalist? | SELECT tournament FROM table_name_85 WHERE finalist = "richard krajicek" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is average age of patients whose marital status is single and year of birth is greater than 2087? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2087" | mimicsql_data |
CREATE TABLE table_69897 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Opposition" text
) | What Player in Opposition of Kilkenny has a Total of 10? | SELECT "Player" FROM table_69897 WHERE "Total" = '10' AND "Opposition" = 'kilkenny' | wikisql |
CREATE TABLE table_59454 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
) | Name the Report of tourist trophy? | SELECT "Report" FROM table_59454 WHERE "Name" = 'tourist trophy' | wikisql |
CREATE TABLE table_3002894_4 (
sonnet VARCHAR,
model VARCHAR
) | When included ram (mib) is the model what is the sonnet? | SELECT sonnet FROM table_3002894_4 WHERE model = "Included RAM (MiB)" | sql_create_context |
CREATE TABLE table_46758 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What was the position of the player who was picked in round 22? | SELECT "Position" FROM table_46758 WHERE "Round" = '22' | wikisql |
CREATE TABLE table_13609 (
"Year" real,
"Finish position" text,
"1st day" text,
"2nd day" text,
"3rd day" text,
"4th Day" text
) | Which Finish position has a 4th Day of bumped robinson? | SELECT "Finish position" FROM table_13609 WHERE "4th Day" = 'bumped robinson' | wikisql |
CREATE TABLE table_name_38 (
score VARCHAR,
opponent VARCHAR
) | What is Score, when Opponent is 'Daniel Gimeno-Traver'? | SELECT score FROM table_name_38 WHERE opponent = "daniel gimeno-traver" | sql_create_context |
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
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | calculate the difference between the total input and the output today for patient 15794. | SELECT (SELECT SUM(inputevents_cv.amount) 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 = 15794)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_... | mimic_iii |
CREATE TABLE table_name_60 (
city VARCHAR
) | What 2007-08 season has marcianise as the city? | SELECT 2007 AS _08_season FROM table_name_60 WHERE city = "marcianise" | sql_create_context |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester i... | To declare a major in MEMS , are there certain classes that I need to take ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%MEMS%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
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
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | how much weight was patient 20166's last weight when they came to the hospital first time? | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20166 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.ite... | mimic_iii |
CREATE TABLE faculty (
campus VARCHAR,
faculty VARCHAR
)
CREATE TABLE campuses (
id VARCHAR
) | List the campus that have between 600 and 1000 faculty lines in year 2004. | SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.