context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_66 (
original_title VARCHAR,
result VARCHAR,
year__ceremony_ VARCHAR
) | In the 2012 (85th) Ceremony, what was the Original title of the film not nominated? | SELECT original_title FROM table_name_66 WHERE result = "not nominated" AND year__ceremony_ = "2012 (85th)" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | A bar chart about what is the total revenue of each manufacturer?, display by the X from low to high. | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE flight (
flno number(4,0),
origin var... | Show all origins and the number of flights from each origin Show bar chart, and list X-axis in asc order please. | SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY origin | nvbench |
CREATE TABLE table_17414 (
"Train No." text,
"Train Name" text,
"Origin" text,
"Destination" text,
"Frequency" text
) | What train number is heading to amritsar? | SELECT "Train No." FROM table_17414 WHERE "Destination" = 'Amritsar' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | what is the number of patients whose diagnoses icd9 code is e8788? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "E8788" | mimicsql_data |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req 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 ... | Are students allowed to take BCS 534 and BCS 231 in the same semester ? | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_offering AS COURSE_OFFERING_0, course_offering AS COURSE_OFFERING_1, course_prerequisite WHERE COURSE_OFFERING_1.semester = COURSE_OFFERING_0.semester AND COURSE_0.course_id = COURSE_OFFERING_0.course_id AND COURSE_0.department = 'BCS' AND COURSE_0... | advising |
CREATE TABLE table_57486 (
"Bowling" text,
"Player" text,
"Opponent" text,
"Venue" text,
"Season" text
) | Which season did Tich Freeman play against opponent V Warwickshire? | SELECT "Season" FROM table_57486 WHERE "Player" = 'tich freeman' AND "Opponent" = 'v warwickshire' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 患者98927870为检测指标229548从06年10月2日到2011年7月16日之内的医务人员工号与姓名都是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM ... | css |
CREATE TABLE table_name_63 (
player VARCHAR,
venue VARCHAR
) | Who is the player associated with the Esher venue? | SELECT player FROM table_name_63 WHERE venue = "esher" | sql_create_context |
CREATE TABLE table_31891 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | Tell me the result for week of 4 | SELECT "Result" FROM table_31891 WHERE "Week" = '4' | wikisql |
CREATE TABLE table_25774493_3 (
points_per_game VARCHAR,
rebounds_per_game VARCHAR
) | What were the points per game in the selection where the rebounds per game were 15.0? | SELECT points_per_game FROM table_25774493_3 WHERE rebounds_per_game = "15.0" | sql_create_context |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | how many patients are diagnosed with complete kidney transplant and tested with ascites in lab? | 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.short_title = "Compl kidney transplant" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_name_45 (
party VARCHAR,
member VARCHAR
) | What party is Mick Young a member of? | SELECT party FROM table_name_45 WHERE member = "mick young" | sql_create_context |
CREATE TABLE table_12762 (
"Name" text,
"Championship" real,
"League Cup" real,
"FA Cup" real,
"Total" real
) | Which Championship has a League Cup larger than 0, and a FA Cup larger than 0? | SELECT MIN("Championship") FROM table_12762 WHERE "League Cup" > '0' AND "FA Cup" > '0' | wikisql |
CREATE TABLE table_name_81 (
year VARCHAR,
position VARCHAR,
leading_scorer VARCHAR
) | what is the year when the position is 1/22 promoted and the leading scorer is james dean (27)? | SELECT year FROM table_name_81 WHERE position = "1/22 promoted" AND leading_scorer = "james dean (27)" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | count the number of patients whose drug code is diaz5? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "DIAZ5" | mimicsql_data |
CREATE TABLE table_204_772 (
id number,
"team" text,
"county" text,
"wins" number,
"years won" number
) | how many wins did confey have ? | SELECT COUNT(*) FROM table_204_772 WHERE "team" = 'confey' | squall |
CREATE TABLE table_29739 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | If the location attendance was Quicken Loans Arena 20,562, who had the High Assists? | SELECT "High assists" FROM table_29739 WHERE "Location Attendance" = 'Quicken Loans Arena 20,562' | wikisql |
CREATE TABLE table_36994 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance (Away)" real
) | Name the least attendance with venue of away on 24 august 2007 | SELECT MIN("Attendance (Away)") FROM table_36994 WHERE "Venue" = 'away' AND "Date" = '24 august 2007' | wikisql |
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country... | Compute the total number in each competition type, and then split by country. | SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country | nvbench |
CREATE TABLE table_71224 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | What lane did the swimmer with a time of 52.84 have? | SELECT MAX("Lane") FROM table_71224 WHERE "Time" = '52.84' | wikisql |
CREATE TABLE table_46558 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | For the game where the opponent is listed as @ Indiana Pacers, what was the end record? | SELECT "Record" FROM table_46558 WHERE "Opponent" = '@ indiana pacers' | 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 inputevents_cv (
row_id number,
subject_id number,
... | when has patient 18677 been given a microbiology test for the last time this month? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18677) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY microbiologyevent... | mimic_iii |
CREATE TABLE table_35218 (
"Constituency" text,
"Electorate" real,
"Turnout" text,
"Spoilt" text,
"Valid Poll" real,
"Quota" text,
"Seats" real,
"Candidates" real
) | Name the total number of valid poll with seats more than 4 and candidates more than 9 | SELECT COUNT("Valid Poll") FROM table_35218 WHERE "Seats" > '4' AND "Candidates" > '9' | 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... | 在医疗就诊04955741225内的定点医疗诊断机构编码是几号? | SELECT FLX_MED_ORG_ID FROM t_kc21 WHERE MED_CLINIC_ID = '04955741225' | css |
CREATE TABLE table_33162 (
"Province" text,
"Inhabitants" real,
"President" text,
"Party" text,
"Election" real
) | What province has an election after 2009? | SELECT "Province" FROM table_33162 WHERE "Election" > '2009' | wikisql |
CREATE TABLE table_name_68 (
goals INTEGER,
matches INTEGER
) | What average goals have matches less than 228? | SELECT AVG(goals) FROM table_name_68 WHERE matches < 228 | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id... | how many hours have passed since first time on the current hospital visit patient 14671 stayed in the careunit micu? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults number,
kids number
)
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
basepric... | Find the number of times ROY SWEAZY has reserved a room. | SELECT COUNT(*) FROM reservations WHERE firstname = "ROY" AND lastname = "SWEAZY" | spider |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Questions that were initially tagged 'books'. | SELECT DISTINCT Score, PostId AS "post_link" FROM PostHistory INNER JOIN Posts ON Posts.Id = PostId WHERE PostHistoryTypeId IN (3, 6) AND Text LIKE '%<books>%' ORDER BY Score DESC | sede |
CREATE TABLE Movie (
director VARCHAR,
title VARCHAR
) | Who is the director of movie Avatar? | SELECT director FROM Movie WHERE title = 'Avatar' | sql_create_context |
CREATE TABLE table_13618358_1 (
agri_culture_b VARCHAR
) | What was head count in 2010 where the farm production is 6.9? | SELECT MAX(2010 AS _population__000_) FROM table_13618358_1 WHERE agri_culture_b = "6.9" | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
... | What courses would be useful to take before SW 693 ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'SW' AND number = 693 | advising |
CREATE TABLE table_name_70 (
rank VARCHAR
) | the sum of 2009 with rank of 5 and 2010 less than 76.5 is what? | SELECT SUM(2009) FROM table_name_70 WHERE rank = 5 AND 2010 < 76.5 | sql_create_context |
CREATE TABLE table_59180 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is 2nd Leg, when Team 2 is 'Dunaferr'? | SELECT "2nd leg" FROM table_59180 WHERE "Team 2" = 'dunaferr' | 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 output of patient 012-4131 for the first time, on last month/21? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-4131')) AND intakeoutput.cellpath LIKE '%output%' AND DA... | eicu |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | how much is patient 017-55081's weight for the first time in 06/last year? | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-55081') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-... | eicu |
CREATE TABLE table_57113 (
"College Name" text,
"Location" text,
"District" text,
"Affiliation" text,
"Estd" text
) | What is the location of the salem district? | SELECT "Location" FROM table_57113 WHERE "District" = 'salem district' | wikisql |
CREATE TABLE table_name_65 (
launched VARCHAR,
homeport__as_of_july_2013_ VARCHAR,
pennant_number VARCHAR
) | What kind of Launched has a Homeport (as of July 2013) of sold to chile, and a Pennant number of f80? | SELECT launched FROM table_name_65 WHERE homeport__as_of_july_2013_ = "sold to chile" AND pennant_number = "f80" | sql_create_context |
CREATE TABLE table_13023 (
"Team" text,
"2005\u201306 Pts" real,
"2006\u201307 Pts" real,
"2007\u201308 Pts" real,
"Total Pts" real,
"Total Pld" real
) | Which 2006 07 Pts has a 2007 08 Pts of 53, and a 2005 06 Pts larger than 51? | SELECT MAX("2006\u201307 Pts") FROM table_13023 WHERE "2007\u201308 Pts" = '53' AND "2005\u201306 Pts" > '51' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | what are the five most commonly performed procedures for patients who have also received agent specific therapy previously during the same hospital visit,? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'agent... | eicu |
CREATE TABLE table_name_20 (
podiums INTEGER,
season VARCHAR,
races VARCHAR
) | Can you tell me the sum of Podiums that has the Season of 2006, and the Races larger than 16? | SELECT SUM(podiums) FROM table_name_20 WHERE season = "2006" AND races > 16 | sql_create_context |
CREATE TABLE table_name_27 (
flattening_ratio VARCHAR,
equatorial_diameter VARCHAR
) | What is the Flattening ratio associated with the Equatorial diameter of 12,756.28km? | SELECT flattening_ratio FROM table_name_27 WHERE equatorial_diameter = "12,756.28km" | sql_create_context |
CREATE TABLE table_50737 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What catalog had an Epic Records label in CD format? | SELECT "Catalog" FROM table_50737 WHERE "Label" = 'epic records' AND "Format" = 'cd' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
... | had patient 030-53416 ever had some output y (ml)-chest tube y - a #2 mid b #3 mid's since 118 months ago? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... | eicu |
CREATE TABLE Circulation_History (
document_id VARCHAR,
employee_id VARCHAR
) | For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees. | SELECT document_id, COUNT(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id | sql_create_context |
CREATE TABLE table_name_98 (
silver INTEGER,
rank VARCHAR,
total VARCHAR
) | What is the sum of silvers for teams with ranks over 3 and totals under 2? | SELECT SUM(silver) FROM table_name_98 WHERE rank > 3 AND total < 2 | sql_create_context |
CREATE TABLE table_58378 (
"Year" real,
"Theme" text,
"Artist" text,
"Mintage" real,
"Issue Price" text
) | What year has an issue price of $697.95? | SELECT COUNT("Year") FROM table_58378 WHERE "Issue Price" = '$697.95' | wikisql |
CREATE TABLE table_name_2 (
home_team VARCHAR,
away_team VARCHAR
) | Which team plays against Footscray as the home team? | SELECT home_team FROM table_name_2 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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... | how many hours have passed since patient 17667 has received a base excess test for the first time on this hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'base excess') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17667 AND admiss... | mimic_iii |
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... | 患者56707289764在经过医疗就诊后是哪一天出院的? | SELECT t_kc21.OUT_HOSP_DATE FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '56707289764' | css |
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,... | 参照不同的科室编号与入院疾病的编码找出医院9424563所有就诊的记录里面医保大病支付的值比上总的医疗费用比值最小的是多少 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9424563' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD | css |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 在47241272961住院就诊中,门诊的主要诊断如何?编码类型、编码列表、名称列表分别是啥 | SELECT MZBMLX, MZZDBM, MZZDMC FROM zyjzjlb WHERE JZLSH = '47241272961' | 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 diagnoses (
... | what is drug type and drug route of drug name neo*iv*vancomycin? | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "NEO*IV*Vancomycin" | mimicsql_data |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Top 5 User from Surat. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%surat%' OR UPPER(Location) LIKE '%SURAT' ORDER BY Reputation DESC LIMIT 5 | sede |
CREATE TABLE table_24865 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | Who directed the title 'peggy sue got work'? | SELECT "Directed by" FROM table_24865 WHERE "Title" = 'Peggy Sue Got Work' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | HTTP imgur links (instead of HTTPS). | SELECT CreationDate, Id AS "post_link" FROM Posts WHERE PostTypeId IN (1, 2) AND (Body LIKE '%http://i.stack.imgur.com%' OR Body LIKE '%http://i.imgur.com%') ORDER BY CreationDate DESC LIMIT 1000 | sede |
CREATE TABLE table_14465924_1 (
telephone__052_ VARCHAR,
area__km_2__ VARCHAR
) | Name the telephone 052 for area km2 being 5.42 | SELECT telephone__052_ FROM table_14465924_1 WHERE area__km_2__ = "5.42" | sql_create_context |
CREATE TABLE table_2231 (
"Pos" text,
"No" text,
"Driver" text,
"Constructor" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Grid" text
) | Who was the driver in grid 01 1? | SELECT "Driver" FROM table_2231 WHERE "Grid" = '01 1' | wikisql |
CREATE TABLE table_203_874 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | what was the name of the competition that took place before the olympic games in 1996 ? | SELECT "competition" FROM table_203_874 WHERE "year" < (SELECT "year" FROM table_203_874 WHERE "competition" = 'olympic games' AND "year" = 1996) ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE table_20478 (
"Office" text,
"Type" text,
"Location" text,
"Elected" real,
"Term began" text,
"Term ended" text
) | What type are State Assemblyman | SELECT "Type" FROM table_20478 WHERE "Office" = 'State Assemblyman' | wikisql |
CREATE TABLE table_56333 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
) | How many losses occurred with less than 8 games played and less than 3 wins? | SELECT COUNT("Losses") FROM table_56333 WHERE "Games Played" < '8' AND "Wins" < '3' | wikisql |
CREATE TABLE table_49101 (
"Year" text,
"League Position" text,
"League" text,
"Domestic Cup" text,
"Cup Position" text
) | What year had a cup position of round 1 and a league position of 5/12? | SELECT "Year" FROM table_49101 WHERE "Cup Position" = 'round 1' AND "League Position" = '5/12' | wikisql |
CREATE TABLE table_name_81 (
position VARCHAR,
year VARCHAR,
player VARCHAR
) | What is Position, when Year is less than 2000, and when Player is 'Radek Dvorak Category:Articles with hCards'? | SELECT position FROM table_name_81 WHERE year < 2000 AND player = "radek dvorak category:articles with hcards" | 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... | 袁文栋这位参保人在0四年九月二十九日到二一年十月四日期间,单一种药品的最大购买次数有过几次 | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '袁文栋' AND t_kc22.STA_DATE BETWEEN '2004-09-29' AND '2021-10-04' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHE... | css |
CREATE TABLE table_58751 (
"South West DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the total number of wins that has byes less than 0? | SELECT COUNT("Wins") FROM table_58751 WHERE "Byes" < '0' | wikisql |
CREATE TABLE table_33506 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the away team when the home team scores 10.17 (77)? | SELECT "Away team" FROM table_33506 WHERE "Home team score" = '10.17 (77)' | wikisql |
CREATE TABLE table_2611 (
"#" text,
"Spacecraft" text,
"Spacewalkers" text,
"Start ( UTC )" text,
"End (UTC)" text,
"Duration" text
) | What is the end (UTC) for spacecraft STS-114 Eva 3? | SELECT "End (UTC)" FROM table_2611 WHERE "Spacecraft" = 'STS-114 EVA 3' | wikisql |
CREATE TABLE settlements (
settlement_id number,
claim_id number,
effective_date time,
settlement_amount number
)
CREATE TABLE available_policies (
policy_id number,
policy_type_code text,
customer_phone text
)
CREATE TABLE customers (
customer_id number,
customer_name text
)
CREA... | Find the maximum and minimum settlement amount. | SELECT MAX(settlement_amount), MIN(settlement_amount) FROM settlements | spider |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid ... | is there any microbiological test result in a month before for patient 61751's bile? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61751) AND microbiologyevents.spec_type_desc = 'bile' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 mon... | mimic_iii |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnon... | AWS Questions: Time until Answer. | SELECT Question.Id, MIN(Question.CreationDate) AS Question_date, MIN(Answer.CreationDate) AS Answer_date FROM Posts AS Question LEFT OUTER JOIN Posts AS Answer ON Question.Id = Answer.ParentId WHERE Question.PostTypeId = 1 AND Question.ClosedDate IS NULL AND (Question.Tags LIKE '%<amazon-%' OR Question.Tags LIKE '%<aws... | sede |
CREATE TABLE table_27069503_2 (
coach VARCHAR,
overall VARCHAR
) | Who was the coach of the Pandas when their overall record was 20-6-2? | SELECT coach FROM table_27069503_2 WHERE overall = "20-6-2" | sql_create_context |
CREATE TABLE table_name_72 (
country VARCHAR,
rank INTEGER
) | What country is ranked larger than 4? | SELECT country FROM table_name_72 WHERE rank > 4 | sql_create_context |
CREATE TABLE table_name_37 (
venue VARCHAR,
year VARCHAR
) | Which Venue has a Year of 2005? | SELECT venue FROM table_name_37 WHERE year = "2005" | sql_create_context |
CREATE TABLE table_39940 (
"singular" text,
"singular gender" text,
"plural" text,
"plural gender" text,
"meaning" text
) | What is the singular if the plural is xweer(a)du? | SELECT "singular" FROM table_39940 WHERE "plural" = 'xweer(a)du' | wikisql |
CREATE TABLE table_75593 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Stadium" text,
"Attendance" real,
"Record" text
) | What was the score of the game against the Braves with a record of 41 27? | SELECT "Score" FROM table_75593 WHERE "Opponent" = 'braves' AND "Record" = '41–27' | wikisql |
CREATE TABLE table_name_15 (
against INTEGER,
byes INTEGER
) | How many Against has Byes smaller than 2? | SELECT AVG(against) FROM table_name_15 WHERE byes < 2 | sql_create_context |
CREATE TABLE table_58436 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
) | What is the lowest reg gp of the player with a round # more than 2, a pick # of 80, and a PI GP larger than 0? | SELECT MIN("Reg GP") FROM table_58436 WHERE "Rd #" > '2' AND "Pick #" = '80' AND "Pl GP" > '0' | wikisql |
CREATE TABLE table_32638 (
"Player" text,
"Nationality" text,
"Position" text,
"From" text,
"School/Country" text
) | From what school was a player drafted in 1950? | SELECT "School/Country" FROM table_32638 WHERE "From" = '1950' | wikisql |
CREATE TABLE table_79703 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
) | What's Brazil's lane with a time less than 21.15? | SELECT MIN("Lane") FROM table_79703 WHERE "Nationality" = 'brazil' AND "Time" < '21.15' | wikisql |
CREATE TABLE table_name_84 (
report VARCHAR,
winning_driver VARCHAR,
date VARCHAR
) | What is the report for the race that Ayrton Senna won on 27 August? | SELECT report FROM table_name_84 WHERE winning_driver = "ayrton senna" AND date = "27 august" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | how many patients whose diagnoses short title is pure hyperglyceridemia and lab test fluid is pleural? | 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.short_title = "Pure hyperglyceridemia" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Count of posts where more than 10 comments. | SELECT Id FROM (SELECT p.Id, COUNT(*) AS CommentCount FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id GROUP BY p.Id, p.Title, p.CreationDate, CommentCount HAVING CommentCount > 100) AS t | sede |
CREATE TABLE table_920 (
"Num" real,
"Team" text,
"W" real,
"L" real,
"PCT" text,
"PF" real,
"PA" real,
"Last appearance" real,
"Last championship" text,
"HOME games" real,
"Home wins" real,
"Home losses" real,
"Home Win Pct." text,
"ROAD games" real,
"Road wi... | How many home wins occured win the road games are larger than 3.0 but road win percentage is .000? | SELECT "Home wins" FROM table_920 WHERE "Road Win Pct." = '.000' AND "ROAD games" > '3.0' | wikisql |
CREATE TABLE table_53250 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | What was Juan Manuel Fangio's reported pole position and the tire of C? | SELECT "Report" FROM table_53250 WHERE "Pole position" = 'juan manuel fangio' AND "Tyre" = 'c' | wikisql |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | Give me the comparison about ID over the meter_300 , and I want to display by the ID in asc. | SELECT meter_300, ID FROM swimmer ORDER BY ID | nvbench |
CREATE TABLE table_1342256_10 (
district VARCHAR,
first_elected VARCHAR
) | How many districts have an incumbent first elected in 1940? | SELECT COUNT(district) FROM table_1342256_10 WHERE first_elected = 1940 | sql_create_context |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | For each bed type, find the average room price Show bar chart, order X from low to high order. | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType | nvbench |
CREATE TABLE table_62433 (
"Year" real,
"Miss Universe Philippines" text,
"Binibining Pilipinas-World" text,
"Binibining Pilipinas-International" text,
"Binibining Pilipinas-Tourism" text,
"First runner-up" text,
"Second runner-up" text
) | Who won Miss Universe Philippines when Regina Hahn was second runner-up? | SELECT "Miss Universe Philippines" FROM table_62433 WHERE "Second runner-up" = 'regina hahn' | wikisql |
CREATE TABLE table_name_85 (
city___state VARCHAR,
race_title VARCHAR
) | What is the City/State of the Oran Park race? | SELECT city___state FROM table_name_85 WHERE race_title = "oran park" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE diagnosis (
diagn... | what are patient 002-39753's gender? | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '002-39753' | eicu |
CREATE TABLE table_39218 (
"Outcome" text,
"Event" text,
"Year" text,
"Venue" text,
"Partner" text
) | What was the outcome in 1982 with Kang Haeng-Suk as partner? | SELECT "Outcome" FROM table_39218 WHERE "Partner" = 'kang haeng-suk' AND "Year" = '1982' | wikisql |
CREATE TABLE table_name_78 (
circuit VARCHAR,
length VARCHAR,
date VARCHAR
) | Which circuit has a length of 45 minutes and is held on August 6? | SELECT circuit FROM table_name_78 WHERE length = "45 minutes" AND date = "august 6" | sql_create_context |
CREATE TABLE table_27713030_16 (
series VARCHAR,
score VARCHAR
) | Which series had a score of l 103 112 (ot)? | SELECT series FROM table_27713030_16 WHERE score = "L 103–112 (OT)" | sql_create_context |
CREATE TABLE table_14601528_2 (
class_aAAAA VARCHAR,
school_year VARCHAR
) | Name the number of class aaaaa for 1988-89 | SELECT COUNT(class_aAAAA) FROM table_14601528_2 WHERE school_year = "1988-89" | sql_create_context |
CREATE TABLE table_5727 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" real
) | What is the date of the Kmart greater greensboro open in North Carolina? | SELECT "Date" FROM table_5727 WHERE "Location" = 'north carolina' AND "Tournament" = 'kmart greater greensboro open' | wikisql |
CREATE TABLE table_43592 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is the Date of the game with a Score of 4 6, 4 6? | SELECT "Date" FROM table_43592 WHERE "Score" = '4–6, 4–6' | wikisql |
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 jyjgzbb (
BGDH text,
BGRQ tim... | 列出在08年4月2日到10年8月17日内患者云文石全部检验结果指标记录中的仪器名称以及编号都是什么啊? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j... | css |
CREATE TABLE table_name_94 (
time VARCHAR,
show_name VARCHAR
) | When does Classic Hits air? | SELECT time FROM table_name_94 WHERE show_name = "classic hits" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | how many hours have passed since patient 6170 has been admitted to the icu? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6170) AND icustays.outtime IS NULL | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.