context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 69621807的团伙成员最常去看病的几位医生的排序看一下 | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '69621807' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,... | Marshals ordered by number of downvotes. | SELECT u.Id AS "user_link", u.DownVotes FROM Users AS u INNER JOIN Badges AS b ON u.Id = b.UserId WHERE b.Name = 'Marshal' ORDER BY u.DownVotes DESC | sede |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostHistoryTypes (
Id number,
Name te... | select count(*) from votes where UserId == null;. | SELECT COUNT(*) FROM Votes WHERE UserId IS NULL | sede |
CREATE TABLE table_11325 (
"Tournament" text,
"Wins" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the top-25 of the U.S. open, which has less than 7 events? | SELECT SUM("Top-25") FROM table_11325 WHERE "Tournament" = 'u.s. open' AND "Events" < '7' | wikisql |
CREATE TABLE table_169693_1 (
age_30_39 VARCHAR,
age_10_19 VARCHAR
) | Name the age 30-39 and age 10-19 380 | SELECT age_30_39 FROM table_169693_1 WHERE age_10_19 = 380 | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDis... | Find suggested duplicates that haven't led to question closure. Locate old dupe suggestions where the flag has timed out | SELECT p.Id AS "post_link", p.CreationDate FROM Comments AS c JOIN Posts AS p ON c.PostId = p.Id WHERE (p.Tags LIKE '%<email>%' OR p.Tags LIKE '%<spam>%') AND NOT p.ClosedDate IS NULL AND p.PostTypeId = 1 AND c.UserId = '##UserId##' ORDER BY p.CreationDate DESC | sede |
CREATE TABLE table_62497 (
"Year" real,
"Number of Examinees" real,
"Number of Passed Students" real,
"Pass Percentage" text,
"Obtained GPA-5" real
) | What number of examines after 2005 has a pass percentage of 78.35% with less than 297 students? | SELECT COUNT("Number of Examinees") FROM table_62497 WHERE "Year" > '2005' AND "Pass Percentage" = '78.35%' AND "Number of Passed Students" < '297' | wikisql |
CREATE TABLE table_name_6 (
halang VARCHAR,
rera VARCHAR
) | Which Halang has a Rera of o ? | SELECT halang FROM table_name_6 WHERE rera = "ʒo²" | sql_create_context |
CREATE TABLE table_55584 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In the match where fitzroy was the away team, where was the venue? | SELECT "Venue" FROM table_55584 WHERE "Away team" = 'fitzroy' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | in 04/this year, when was the first time patient 002-27661 was prescribed medication via sublingual route? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-27661')) AND medication.routeadmin = 'sublingual' AND DATE... | eicu |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
... | among the patients who were prescribed oxymetazoline hcl, what are the three most frequently ordered drugs at the same time since 2100? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'oxymetazoline hcl' AND STRFTIME('%y', prescriptions.startdate) >=... | mimic_iii |
CREATE TABLE table_name_93 (
player VARCHAR,
to_par VARCHAR
) | Which Player has a To par of 4? | SELECT player FROM table_name_93 WHERE to_par = "–4" | sql_create_context |
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... | my answers on question that have their users removed or dis-associated. | SELECT p.Id AS "post_link", q.OwnerDisplayName FROM Posts AS p INNER JOIN Posts AS q ON q.Id = p.ParentId WHERE p.PostTypeId = 2 AND p.OwnerUserId = 7812 AND q.OwnerUserId IS NULL | sede |
CREATE TABLE table_6150 (
"Medal" text,
"Name" text,
"Games" text,
"Sport" text,
"Event" text
) | What event did Pakistan get the bronze medal at the 1988 Seoul Games? | SELECT "Event" FROM table_6150 WHERE "Medal" = 'bronze' AND "Games" = '1988 seoul' | wikisql |
CREATE TABLE table_name_6 (
finish VARCHAR,
start VARCHAR,
year VARCHAR
) | WHAT WAS THE FINISH NUMBER WITH A START SMALLER THAN 20 IN 1969? | SELECT COUNT(finish) FROM table_name_6 WHERE start < 20 AND year = 1969 | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE 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,
... | 药品排序在团伙成员何欣欣最常开的中,有什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '何欣欣' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_54567 (
"Discipline" text,
"Season" real,
"Performance" text,
"Place" text,
"Date" text
) | How many seasons took place in santiago de chile, chile? | SELECT COUNT("Season") FROM table_54567 WHERE "Place" = 'santiago de chile, chile' | wikisql |
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
city text,
membership_amount text
)
CREATE TABLE purchase (
member_id number,
branch_id text,
year text,
total_pounds number
)
CREATE TABLE membership_register_branch (
member_id number,
... | Show all city with a branch opened in 2001 and a branch with more than 100 membership. | SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100 | spider |
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... | 在2015年3月27日开始2015年11月9日结束患者彭嘉怡被开出的所有药品的编码是多少?名称是什么?数量是多少?单价是多少?金额是多少? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '彭嘉怡' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2015-03-27' AND '2015-11-09' | css |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, give me the comparison about revenue over the name , and group by attribute name, I want to sort from high to low by the Y-axis. | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T2.Revenue DESC | nvbench |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 03652738号患者在02年3月6日到04月10月25日期间其所有检验结果指标记录中的检测方法是啥呢? | SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH W... | css |
CREATE TABLE table_204_488 (
id number,
"order in\nposition" number,
"president of\nthe republic" text,
"length of\nthe presidential\naction" text,
"rank by\nlength\nof term(s)" number,
"notes" text
) | how long was the longest presidential action by any president of finland ? | SELECT "length of\nthe presidential\naction" FROM table_204_488 ORDER BY "rank by\nlength\nof term(s)" LIMIT 1 | squall |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NA... | For those employees who did not have any job in the past, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday by a bar chart, rank y-axis in asc order. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_name_72 (
shipyard VARCHAR,
laid_down VARCHAR
) | Which shipyard has a fleet that was laid down on April 21, 1962? | SELECT shipyard FROM table_name_72 WHERE laid_down = "april 21, 1962" | sql_create_context |
CREATE TABLE table_name_5 (
record VARCHAR,
date VARCHAR
) | What is the record for April 8? | SELECT record FROM table_name_5 WHERE date = "april 8" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | count the number of times patient 030-56105 had been prescribed acetaminophen (tylenol) tablet 650 mg in 11/2104? | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-56105')) AND medication.drugname = 'acetaminophen (tylenol) tablet 650 mg'... | eicu |
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE student ... | What are the first names of all teachers who have taught a course and the corresponding descriptions? | SELECT T2.emp_fname, T3.crs_description FROM class AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code | spider |
CREATE TABLE table_name_29 (
start_date VARCHAR,
party VARCHAR,
end_date VARCHAR
) | Name the start date with lsap and end date of present day | SELECT start_date FROM table_name_29 WHERE party = "lsap" AND end_date = "present day" | sql_create_context |
CREATE TABLE table_name_65 (
american VARCHAR,
australian VARCHAR
) | What does American have if Australia has ? | SELECT american FROM table_name_65 WHERE australian = "əʉ" | sql_create_context |
CREATE TABLE table_18743 (
"Rank" real,
"Name" text,
"City" text,
"Region" text,
"Height (m)" real,
"Height (ft)" real,
"Floors" real,
"Estimated Completion" real
) | what's the height (ft) with name being 52-54 lime street | SELECT "Height (ft)" FROM table_18743 WHERE "Name" = '52-54 Lime Street' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | what was the drug that patient 022-67644 had been allergic to? | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-67644')) | eicu |
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_cit... | How many storms occured in each region Visualize by bar chart, and show bars from low to high order. | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY Region_name | nvbench |
CREATE TABLE table_18946749_4 (
col__m_ INTEGER,
island VARCHAR
) | What is the highest value for col(m) at North Island? | SELECT MAX(col__m_) FROM table_18946749_4 WHERE island = "North island" | sql_create_context |
CREATE TABLE table_79479 (
"Peak" text,
"Country" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
) | What is the Col (m) of Peak Mount Aragats with an Elevation (m) larger than 3,905 and Prominence smaller than 2,143? | SELECT MAX("Col (m)") FROM table_79479 WHERE "Elevation (m)" > '3,905' AND "Peak" = 'mount aragats' AND "Prominence (m)" < '2,143' | 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... | 看看编号为5878641的医院在零八年十月十四日到一五年十一月十五日的这段时间里,有多少医疗费总额不少于1815.95元的科室 | SELECT COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '5878641' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-10-14' AND '2015-11-15' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 1815.95) AS T | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many white patients had the drug route both eyes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "BOTH EYES" | mimicsql_data |
CREATE TABLE table_11212 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
) | When was the kickoff during a game with a record of 1-7? | SELECT "Kickoff [a ]" FROM table_11212 WHERE "Record" = '1-7' | wikisql |
CREATE TABLE table_13008 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Name the team with a tie number of 6. | SELECT "Date" FROM table_13008 WHERE "Tie no" = '6' | wikisql |
CREATE TABLE table_name_63 (
method VARCHAR,
time VARCHAR
) | Which method has a 1:46 time? | SELECT method FROM table_name_63 WHERE time = "1:46" | sql_create_context |
CREATE TABLE table_44453 (
"Season" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real
) | What is the sum of Poles, when Podiums is 0, and when Races is 17? | SELECT SUM("Poles") FROM table_44453 WHERE "Podiums" = '0' AND "Races" = '17' | wikisql |
CREATE TABLE table_55753 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the average number of laps when Gerhard Berger is the driver? | SELECT AVG("Laps") FROM table_55753 WHERE "Driver" = 'gerhard berger' | wikisql |
CREATE TABLE table_23896 (
"School" text,
"Location(s)" text,
"Control" text,
"Type" text,
"Enrollment (spring 2012)" real,
"Founded" real,
"Accreditation" text
) | Name the accrediatation for southeast technical institute | SELECT "Accreditation" FROM table_23896 WHERE "School" = 'Southeast Technical Institute' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodici... | what are the top five most prescribed drugs for patients who were prescribed cefazolin 2 gm in ns 100 ml ivpb (repackage) at the same time since 2104? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'cefazolin 2 gm in ns 100 ml ivpb (repackage)' AND S... | eicu |
CREATE TABLE table_12487 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | Which district has an incumbent of Sanford Bishop? | SELECT "District" FROM table_12487 WHERE "Incumbent" = 'sanford bishop' | wikisql |
CREATE TABLE table_57697 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
) | What is the sum of averages with a long value of 32? | SELECT SUM("Avg.") FROM table_57697 WHERE "Long" = '32' | wikisql |
CREATE TABLE table_name_49 (
time VARCHAR,
winner VARCHAR
) | What was the winning time for the winning horse, Kentucky ii? | SELECT time FROM table_name_49 WHERE winner = "kentucky ii" | sql_create_context |
CREATE TABLE table_19524523_1 (
champ_car_world_series__2004_2007_ INTEGER
) | What is the minimum number of wins possible for the Champ Car World Series among all the drivers? | SELECT MIN(champ_car_world_series__2004_2007_) FROM table_19524523_1 | sql_create_context |
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... | 自02年3月3日起,截止到06年2月9日,查一下患者72776229在医疗机构7840461的门诊看过几次病 | SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.... | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many patients aged below 41 had a lab test for triglycer? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.label = "Triglycer" | mimicsql_data |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | just show me the top three most common diagnosis since 2105? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2105' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE table_140968_1 (
copies_per_particle VARCHAR,
size___s_base_pair__ VARCHAR
) | How many copies per particle are there for the base pair that is size 1059? | SELECT COUNT(copies_per_particle) FROM table_140968_1 WHERE size___s_base_pair__ = 1059 | sql_create_context |
CREATE TABLE table_name_86 (
place VARCHAR,
score VARCHAR
) | What is the place of the player with a 66-68-70=204 score? | SELECT place FROM table_name_86 WHERE score = 66 - 68 - 70 = 204 | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare (
fare_id int,
from_airport va... | give me flights on AA from MILWAUKEE to PHOENIX | 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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHOENIX' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWA... | atis |
CREATE TABLE table_14025 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
) | What actor has goede tijden, slechte tijden, as the soap opera, 11 years as the duration, with rosa gonzalez as the character? | SELECT "Actor" FROM table_14025 WHERE "Soap Opera" = 'goede tijden, slechte tijden' AND "Duration" = '11 years' AND "Character" = 'rosa gonzalez' | wikisql |
CREATE TABLE table_48657 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
) | What was the earliest year that the result 21-17? | SELECT MIN("Year") FROM table_48657 WHERE "Result" = '21-17' | wikisql |
CREATE TABLE table_204_442 (
id number,
"institution" text,
"location" text,
"enrollment" number,
"nickname" text,
"varsity\nsports" number,
"rugby\nsince" text,
"head coach" text
) | how many schools in the acrl have at least 20 varsity sports ? | SELECT COUNT("institution") FROM table_204_442 WHERE "varsity\nsports" >= 20 | squall |
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 (... | find out the number of patients admitted before 2123 who were diagnosed with acute on chronic combined systolic and diastolic heart failure. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2123" AND diagnoses.long_title = "Acute on chronic combined systolic and diastolic heart failure" | mimicsql_data |
CREATE TABLE table_name_29 (
third VARCHAR,
second VARCHAR
) | Which Third has a Second of scott pfeifer? | SELECT third FROM table_name_29 WHERE second = "scott pfeifer" | sql_create_context |
CREATE TABLE table_name_88 (
date VARCHAR,
score VARCHAR,
year VARCHAR
) | What day was the score 3-0 after 2011? | SELECT date FROM table_name_88 WHERE score = "3-0" AND year = 2011 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose primary disease is s/p hanging and days of hospital stay is greater than 20? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.days_stay > "20" | mimicsql_data |
CREATE TABLE table_204_127 (
id number,
"outcome" text,
"no." number,
"date" text,
"tournament" text,
"surface" text,
"opponent" text,
"score" text
) | after 15 august , 2011 , where does the tournament take place next ? | SELECT "tournament" FROM table_204_127 WHERE "date" > (SELECT "date" FROM table_204_127 WHERE "date" = '15 august 2011') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_204_736 (
id number,
"party" text,
"candidate" text,
"votes" number
) | how many independent candidates were on the ballot for alderman in 1919 ? | SELECT COUNT("candidate") FROM table_204_736 WHERE "party" = 'independent' | squall |
CREATE TABLE table_77736 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When was a game played where the away team scored 10.19 (79)? | SELECT "Date" FROM table_77736 WHERE "Away team score" = '10.19 (79)' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TA... | what is the total schedule for DL 's flights to all airports | SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time FROM airport, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE FLIGHT_0.airline_code = 'DL' AND FLIGHT_0.flight_id = flight_leg.leg_flight AND FLIGHT_1.flight_id = flight_leg.flight_id AND FLIGHT_1.to_airport = airport.airport_code | atis |
CREATE TABLE table_name_44 (
english_translation VARCHAR,
articles VARCHAR
) | Can you tell me the English Translation that has the Articles of 24? | SELECT english_translation FROM table_name_44 WHERE articles = 24 | sql_create_context |
CREATE TABLE table_71144 (
"Team" text,
"Manager 1" text,
"Captain" text,
"Kit manufacturer" text,
"Shirt sponsor" text
) | Who is the captain of the team that has a kit manufacturer of Fox Leisure? | SELECT "Captain" FROM table_71144 WHERE "Kit manufacturer" = 'fox leisure' | wikisql |
CREATE TABLE table_204_339 (
id number,
"season" number,
"age" number,
"overall" number,
"slalom" number,
"giant\nslalom" number,
"super g" text,
"downhill" number,
"combined" text
) | who is the top in giant slalom | SELECT "season" FROM table_204_339 ORDER BY "giant\nslalom" LIMIT 1 | squall |
CREATE TABLE table_63231 (
"School" text,
"Location" text,
"Mascot" text,
"County" real,
"Enrollment" text,
"IHSAA Class" text,
"Year Joined" real,
"Previous Conference" text
) | What is the average year joined of the 277 county? | SELECT AVG("Year Joined") FROM table_63231 WHERE "County" = '277' | wikisql |
CREATE TABLE table_name_72 (
competition VARCHAR,
date VARCHAR,
venue VARCHAR
) | What is Competition, when Date is 'January 11, 1996', when Venue is 'San Diego , United States'? | SELECT competition FROM table_name_72 WHERE date = "january 11, 1996" AND venue = "san diego , united states" | sql_create_context |
CREATE TABLE table_203_40 (
id number,
"p.s. #" number,
"school name" text,
"neighborhood" text,
"low grade" text,
"high grade" number,
"year closed" text,
"building status" text
) | how many schools are vacant ? | SELECT COUNT("school name") FROM table_203_40 WHERE "building status" = 'vacant' | squall |
CREATE TABLE table_name_60 (
total_fat VARCHAR,
smoke_point VARCHAR,
saturated_fat VARCHAR
) | What is the total fat with a smoke point of c (), 25g of saturated fat? | SELECT total_fat FROM table_name_60 WHERE smoke_point = "°c ()" AND saturated_fat = "25g" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name t... | How many points have I earned from 'long-tail' questions and answers?. | SELECT * FROM Posts WHERE (PostTypeId = 1 OR PostTypeId = 2) AND OwnerUserId = 3195 | sede |
CREATE TABLE table_name_94 (
draw VARCHAR,
team VARCHAR
) | What is the Draw for the team tramwajarz d ? | SELECT draw FROM table_name_94 WHERE team = "tramwajarz łódź" | sql_create_context |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
R... | Show the name for regions and the number of storms for each region, and I want to rank by the y axis in desc please. | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_203_877 (
id number,
"year" number,
"single" text,
"us cashbox" number,
"us hot 100" number,
"uk singles" number
) | what is the total number of singles released ? | SELECT COUNT("single") FROM table_203_877 | squall |
CREATE TABLE table_1099 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | The los angeles kings drafted what player in the 7th round | SELECT "Player" FROM table_1099 WHERE "NHL team" = 'Los Angeles Kings' | wikisql |
CREATE TABLE table_70849 (
"Rider" text,
"Matches" real,
"Rides" real,
"Bonus Pts" real,
"Total Points" real
) | How many rides did it take Ray Day to get 274 points in total with less than 3 bonus points? | SELECT COUNT("Rides") FROM table_70849 WHERE "Total Points" < '274' AND "Rider" = 'ray day' AND "Bonus Pts" > '3' | wikisql |
CREATE TABLE table_14209455_1 (
wed_28_may VARCHAR,
mon_26_may VARCHAR
) | what tims is wed may 28 and mon may 26 is 17' 58.34 125.960mph? | SELECT wed_28_may FROM table_14209455_1 WHERE mon_26_may = "17' 58.34 125.960mph" | sql_create_context |
CREATE TABLE table_name_18 (
opponent VARCHAR,
time VARCHAR
) | Which Opponent has a Time of 0:38? | SELECT opponent FROM table_name_18 WHERE time = "0:38" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 门诊诊断为疾病Y80.333的病人的检测指标145181数值的平均值是多少?最值是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'Y80.333' AND jyjgzbb.JCZBDM = '... | css |
CREATE TABLE table_name_15 (
actual_title VARCHAR,
writer VARCHAR,
artist VARCHAR,
issue VARCHAR
) | What was the actual title of the show that had an issue number less than 508, was written by Desmond Devlin, and for which Tom Richmond was the artist? | SELECT actual_title FROM table_name_15 WHERE artist = "tom richmond" AND issue < 508 AND writer = "desmond devlin" | 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... | what is minimum days of hospital stay of patients whose age is greater than or equal to 51? | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "51" | mimicsql_data |
CREATE TABLE table_204_145 (
id number,
"representative" text,
"state" text,
"district(s)" text,
"served" text,
"party" text,
"date of birth" text,
"date of death" text,
"age" text
) | how many districts did charles goodell serve in ? | SELECT "district(s)" FROM table_204_145 WHERE "representative" = 'charles goodell' | squall |
CREATE TABLE table_name_19 (
call_sign VARCHAR,
branding VARCHAR
) | What is the Call sign of the Frequency 106.9 the X? | SELECT call_sign FROM table_name_19 WHERE branding = "106.9 the x" | sql_create_context |
CREATE TABLE table_name_77 (
Id VARCHAR
) | what is the average for 2005 when 1995 is more than 3, 1996 is less than 4, and 2011 is more than 5? | SELECT AVG(2005) FROM table_name_77 WHERE 1995 > 3 AND 1996 < 4 AND 2011 > 5 | sql_create_context |
CREATE TABLE table_54420 (
"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 score for Geelong, whereby the Away team has a score of 18.13 (121)? | SELECT "Home team score" FROM table_54420 WHERE "Away team score" = '18.13 (121)' | wikisql |
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 medication (
medi... | what was the last time patient 005-16601 received a rdw test, in their first hospital visit? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-16601' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala... | eicu |
CREATE TABLE table_2523809_1 (
coverage VARCHAR,
branding VARCHAR
) | Which area did estrella tv 62 provide coverage for? | SELECT coverage FROM table_2523809_1 WHERE branding = "Estrella TV 62" | sql_create_context |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | Return a bar chart on what is the average base price of rooms, for each bed type? | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType | nvbench |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE 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,
... | 在04年7月4日到08年4月7日内医院2206684门诊医疗记录的数量总共是多少呢? | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2206684' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-07-04' AND '2008-04-07' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2206684' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2004-07-04' AND '2008-04-07' AND fgwyjzb.CLINIC_TY... | css |
CREATE TABLE Apartment_Buildings (
building_description VARCHAR
) | Show all distinct building descriptions. | SELECT DISTINCT building_description FROM Apartment_Buildings | sql_create_context |
CREATE TABLE table_36206 (
"Date" text,
"Episode" real,
"Performer 1" text,
"Performer 2" text,
"Performer 3" text,
"Performer 4" text
) | Date of 8 july 1994 involves which performer 1? | SELECT "Performer 1" FROM table_36206 WHERE "Date" = '8 july 1994' | wikisql |
CREATE TABLE table_27712180_7 (
team VARCHAR,
date VARCHAR
) | Name the team for december 18 | SELECT team FROM table_27712180_7 WHERE date = "December 18" | sql_create_context |
CREATE TABLE table_13399573_4 (
points_for VARCHAR,
losing_bonus VARCHAR
) | In the 2008/2009 season one team had 1 losing bonus, How many points did that team score that year? | SELECT points_for FROM table_13399573_4 WHERE losing_bonus = "1" | sql_create_context |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 列出患者韦伟彦所有检验结果指标记录的检测人为郎霞姝的检验指标流水号有多少在在2009-11-03到2010-06-13内? | (SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM =... | css |
CREATE TABLE table_44466 (
"Competition" text,
"1970\u201371" text,
"1971\u201372" text,
"1972\u201373" text,
"1973\u201374" text,
"1974\u201375" text,
"1975\u201376" text,
"1976\u201377" text,
"1977\u201378" text,
"1978\u201379" text,
"1979\u201380" text,
"1980\u201381" ... | What is the 1997 98 answer when the 2003 04 shows grp? | SELECT "1997\u201398" FROM table_44466 WHERE "2003\u201304" = 'grp' | wikisql |
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... | i was wondering what patient 015-59552's minimum value of systemicmean on 03/09/2105 was? | SELECT MIN(vitalperiodic.systemicmean) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND NOT vitalperiodic.systemicmean I... | eicu |
CREATE TABLE table_4931 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"College" text
) | What player was drafted 252? | SELECT "Player" FROM table_4931 WHERE "Pick" = '252' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
sub... | how many patients have been treated with cont inv mec ven 96+ hrs in the same month after the previous insert endotracheal tube since 2104? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'insert endo... | mimic_iii |
CREATE TABLE table_train_105 (
"id" int,
"mini_mental_state_examination_mmse" int,
"systolic_blood_pressure_sbp" int,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"age" float,
"NOUSE" float
) | age is 65 through 89 years old. | SELECT * FROM table_train_105 WHERE age >= 65 AND age <= 89 | criteria2sql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.