context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_18 (
location VARCHAR,
floors VARCHAR
) | Which Location has a Floors of 03.0 n/a? | SELECT location FROM table_name_18 WHERE floors = "03.0 n/a" | sql_create_context |
CREATE TABLE table_name_84 (
byes VARCHAR,
against VARCHAR,
draws VARCHAR
) | What was the total number of Byes for the team that had 1136 Against and fewer than 0 Draws? | SELECT COUNT(byes) FROM table_name_84 WHERE against = 1136 AND draws < 0 | 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... | count the number of patients whose age is less than 30 and procedure long title is other electric countershock of heart? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "30" AND procedures.long_title = "Other electric countershock of heart" | mimicsql_data |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | how many days has passed since patient 92788 was given a ptt laboratory test for the first time in this hospital visit? | SELECT 1 * (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 = 'ptt') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788 AND admissions.disc... | mimic_iii |
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,
... | 病患22945235在2001-12-09以前做过的检验报告在哪些门诊?列出这些门诊就诊的流水编码 | SELECT txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '22945235' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2001-12-09') UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOI... | css |
CREATE TABLE table_24910733_1 (
title VARCHAR,
us_viewers__millions_ VARCHAR
) | How many titles are listed with 8.44 million viewers? | SELECT COUNT(title) FROM table_24910733_1 WHERE us_viewers__millions_ = "8.44" | sql_create_context |
CREATE TABLE table_65462 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
) | What college was the quarterback from? | SELECT "College" FROM table_65462 WHERE "Position" = 'quarterback' | wikisql |
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,... | provide the number of patients whose diagnoses icd9 code is 7756 and lab test category is blood gas? | 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.icd9_code = "7756" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_name_30 (
chassis VARCHAR,
driver VARCHAR
) | What kind of chassis does Ricardo Zonta have? | SELECT chassis FROM table_name_30 WHERE driver = "ricardo zonta" | sql_create_context |
CREATE TABLE table_13680 (
"Name" text,
"Ceremony" text,
"Year" text,
"Academy Award" text,
"Film" text
) | What is the Academy Award for the Film Educating Peter? | SELECT "Academy Award" FROM table_13680 WHERE "Film" = 'educating peter' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
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,
ProfileImage... | Posts that link to other sites. | SELECT p.Id, p.PostTypeId, p.Score FROM Posts AS p WHERE p.Score > 1 AND p.PostTypeId = 1 AND p.Body LIKE '%judaism%' | sede |
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,
... | 列出患者20499920在10年5月11日到20年4月9日内被开出的所有检验报告单的检验报告单号是多少? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '20499920' AND jybgb.BGRQ BETWEEN '2010-05-11' AND '2020-04-09' UNION... | css |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0... | For those employees who was hired before 2002-06-21, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_9 (
name VARCHAR,
state VARCHAR,
opened__closing_date_if_defunct_ VARCHAR,
length VARCHAR
) | What is the Name with an Opened (closing date if defunct) of 1995 and has a Length of miles (m), in Illinois? | SELECT name FROM table_name_9 WHERE opened__closing_date_if_defunct_ = "1995" AND length = "miles (m)" AND state = "illinois" | sql_create_context |
CREATE TABLE Movie (
director VARCHAR
) | What are the names of the directors who made exactly one movie? | SELECT director FROM Movie GROUP BY director HAVING COUNT(*) = 1 | 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 whose ethnicity is black/african american and days of hospital stay is greater than 1? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.days_stay > "1" | mimicsql_data |
CREATE TABLE table_40723 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) | Mike Miller played for what school/club team? | SELECT "School/Club Team" FROM table_40723 WHERE "Player" = 'mike miller' | wikisql |
CREATE TABLE table_42182 (
"Round" real,
"Pick" real,
"Name" text,
"Position" text,
"College" text
) | What's the lowest round Justin Forsett was drafted in, with a draft pick larger than 233? | SELECT MIN("Round") FROM table_42182 WHERE "Name" = 'justin forsett' AND "Pick" > '233' | wikisql |
CREATE TABLE table_name_98 (
nationality VARCHAR,
round INTEGER
) | Which Nationality has a Round smaller than 3? | SELECT nationality FROM table_name_98 WHERE round < 3 | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
... | In the Spring-Summer term , what BIOSTAT courses are being taught ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'BIOSTAT' AND semester.semester = 'Spring-Summer' | advising |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients had an urgent admission type with a sc drug route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "SC" | mimicsql_data |
CREATE TABLE table_29766 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the record for the date november 19? | SELECT "Record" FROM table_29766 WHERE "Date" = 'November 19' | wikisql |
CREATE TABLE table_19197 (
"Chassis Manufacturer" text,
"Chassis Model" text,
"Body Model" text,
"Number in Fleet" real,
"Fleet Numbers" text
) | what is smallest number in fleet for chassis manufacturer Scania and fleet numbers is 3230? | SELECT MIN("Number in Fleet") FROM table_19197 WHERE "Chassis Manufacturer" = 'Scania' AND "Fleet Numbers" = '3230' | wikisql |
CREATE TABLE table_73407 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | Name the reason for change pennsylvania 13th | SELECT "Reason for change" FROM table_73407 WHERE "District" = 'Pennsylvania 13th' | wikisql |
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE appellations (
no numbe... | What are the average price and score of wines for each appelation? | SELECT AVG(price), AVG(score), appelation FROM wine GROUP BY appelation | spider |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Which Polish Context classes handle the PreMajor requirement ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Polish Context%' OR course.description LIKE '%Polish Context%' OR course.name LIKE '%Polish Cont... | advising |
CREATE TABLE table_name_87 (
points_against VARCHAR,
club VARCHAR
) | Name the points against for porthcawl rfc | SELECT points_against FROM table_name_87 WHERE club = "porthcawl rfc" | sql_create_context |
CREATE TABLE table_63531 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the lowest against when the draws are more than 0 and the losses are less than 3? | SELECT MIN("Against") FROM table_63531 WHERE "Losses" < '3' AND "Draws" > '0' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | how many patients got prescriptions for quinidine gluconate e.r. until 3 years ago? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'quinidine gluconate e.r.' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year')) | mimic_iii |
CREATE TABLE degrees (
Id VARCHAR
)
CREATE TABLE campuses (
Id VARCHAR
) | What are the degrees conferred in 'San Francisco State University' in 2001. | SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.Id = t2.campus WHERE t1.campus = "San Francisco State University" AND t2.year = 2001 | sql_create_context |
CREATE TABLE table_5613 (
"Rank" real,
"Airline" text,
"2012" real,
"2011" real,
"2010" real,
"2009" real
) | avg passengers in 2012 for 2009 more than 104.5 and 2010 less than 162.6 and 2011 less than 141.8 is what? | SELECT AVG("2012") FROM table_5613 WHERE "2009" > '104.5' AND "2010" < '162.6' AND "2011" < '141.8' | 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 lab (
labid numbe... | when was the last time patient 022-130563 was prescribed medicine via inh 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 = '022-130563')) AND medication.routeadmin = 'inh' ORDER BY medic... | eicu |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | flight from DALLAS to BOSTON tomorrow | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 20 AND date_day.month_number = 1 AND da... | atis |
CREATE TABLE table_79157 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | How much Drawn has Goals Against of 81, and a Lost larger than 23? | SELECT COUNT("Drawn") FROM table_79157 WHERE "Goals Against" = '81' AND "Lost" > '23' | wikisql |
CREATE TABLE table_77866 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
) | what is the cerclis ID when the site was proposed on 12/30/1982 and was partially deleted on 05/01/2003? | SELECT "CERCLIS ID" FROM table_77866 WHERE "Proposed" = '12/30/1982' AND "Partially deleted" = '05/01/2003' | wikisql |
CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
) | For each type, what is the average tonnage? | SELECT type, AVG(tonnage) FROM ship GROUP BY type | spider |
CREATE TABLE table_11447995_2 (
bello VARCHAR,
ben_tahir VARCHAR
) | What is the Bello when Ben-Tahir is 296? | SELECT bello FROM table_11447995_2 WHERE ben_tahir = "296" | 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 prescriptions (
subject_id text,
hadm_id... | what is date of birth and admission type of subject name james sloan? | SELECT demographic.dob, demographic.admission_type FROM demographic WHERE demographic.name = "James Sloan" | mimicsql_data |
CREATE TABLE table_25980 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | How many races in 2012 season have 0 podiums? | SELECT COUNT("Races") FROM table_25980 WHERE "Season" = '2012' AND "Podiums" = '0' | wikisql |
CREATE TABLE table_26686908_2 (
city___state VARCHAR,
date VARCHAR
) | What was the location for the date 7 10 october? | SELECT city___state FROM table_26686908_2 WHERE date = "7–10 October" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_... | list the patient identifications of patients who have been diagnosed with cannabis abuse-unspec since 2 years ago. | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cannabis abuse-unspec') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(... | 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... | 患者78177381在03年4月7日到19年5月26日期间被开出苯巴比妥片共有多少次啊? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '78177381' AND t_kc22.STA_DATE BETWEEN '2003-04-07' AND '2019-05-26' AND t_kc22.SOC_SRT_DIRE_NM = '苯巴比妥片' | css |
CREATE TABLE table_name_48 (
Id VARCHAR
) | What is the 2005 value with a q2 in 2011, a q1 in 2012, and 1r in 2003? | SELECT 2005 FROM table_name_48 WHERE 2011 = "q2" AND 2012 = "q1" AND 2003 = "1r" | sql_create_context |
CREATE TABLE company (
company_id number,
rank number,
company text,
headquarters text,
main_industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value number
)
CREATE TABLE station_company (
station_id number,
company_id number,
ran... | What are the companies and main industries of all companies that are not headquartered in the United States? | SELECT company, main_industry FROM company WHERE headquarters <> 'USA' | spider |
CREATE TABLE table_47893 (
"Year" real,
"Album" text,
"Release type" text,
"Label" text,
"Hungarian top 40 album charts" text
) | What was the name of the album that was a demo release? | SELECT "Album" FROM table_47893 WHERE "Release type" = 'demo' | wikisql |
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
... | Find the last and first name of students who are playing Football or Lacrosse. | SELECT T2.lname, T2.fname FROM sportsinfo AS T1 JOIN student AS T2 ON T1.stuid = T2.stuid WHERE T1.sportname = "Football" OR T1.sportname = "Lacrosse" | spider |
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... | (Possibly) suspended users with Supporter badge. | SELECT u.CreationDate, u.Id AS "user_link" FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Name = 'Nice Question' AND u.Reputation <= 1 GROUP BY u.Id, u.CreationDate ORDER BY u.CreationDate | sede |
CREATE TABLE table_53369 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/retired" text,
"Grid" real
) | Tell me the highest laps for time/retired of +2 laps and driver of felice bonetto | SELECT MAX("Laps") FROM table_53369 WHERE "Time/retired" = '+2 laps' AND "Driver" = 'felice bonetto' | wikisql |
CREATE TABLE table_67363 (
"Name" text,
"Species Authority" text,
"Order" text,
"Family" text,
"Red List" real
) | What is the name for the species Authority of sigmodon hispidus say & ord, 1825? | SELECT "Name" FROM table_67363 WHERE "Species Authority" = 'sigmodon hispidus say & ord, 1825' | wikisql |
CREATE TABLE table_37255 (
"Rank" real,
"Stadium" text,
"Capacity" real,
"City" text,
"Country" text
) | Which City has a Country of spain, and a Stadium of palacio de deportes de santander? | SELECT "City" FROM table_37255 WHERE "Country" = 'spain' AND "Stadium" = 'palacio de deportes de santander' | wikisql |
CREATE TABLE table_42003 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"Liberal ticket" text,
"Conservative ticket" text,
"Socialist Workers ticket" text,
"Socialist Labor ticket" text
) | What was the office up for election when Sylvia Weinstein ran under the Socialist Workers ticket? | SELECT "Office" FROM table_42003 WHERE "Socialist Workers ticket" = 'sylvia weinstein' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | tell me the number of patients on main drug type prescription who were diagnosed with cardiac complications, not elsewhere classified. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Surg compl-heart" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_15451122_2 (
assembled VARCHAR,
first_member VARCHAR
) | What date was parliament assembled when John rudhale was first member? | SELECT assembled FROM table_15451122_2 WHERE first_member = "John Rudhale" | sql_create_context |
CREATE TABLE table_75760 (
"Information" text,
"Altade\u00f1a" text,
"Aprende" text,
"Centennial" text,
"Kyrene MS" text,
"del Pueblo" text
) | What kind of Altade a has del Pueblo of maroon/gray? | SELECT "Altade\u00f1a" FROM table_75760 WHERE "del Pueblo" = 'maroon/gray' | wikisql |
CREATE TABLE table_name_60 (
time_retired VARCHAR,
grid VARCHAR
) | What is the time/retired of the one with grid of 16? | SELECT time_retired FROM table_name_60 WHERE grid = 16 | sql_create_context |
CREATE TABLE zyb (
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... | 统计年龄不低于20岁的患者医疗记录的平均医疗费总共花销是多少? | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE >= 20 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE >= 20 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE >= 20 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PER... | css |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type... | Bar graph to show age from different name, display by the x-axis from high to low please. | SELECT Name, Age FROM driver ORDER BY Name DESC | nvbench |
CREATE TABLE table_38138 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Series" text
) | Which Score has a Series of flyers lead 3 2? | SELECT "Score" FROM table_38138 WHERE "Series" = 'flyers lead 3–2' | wikisql |
CREATE TABLE customer_policies (
policy_id number,
customer_id number,
policy_type_code text,
start_date time,
end_date time
)
CREATE TABLE claims (
claim_id number,
policy_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number... | How many settlements does each claim correspond to? List the claim id and the number of settlements. | SELECT T1.claim_id, COUNT(*) FROM claims AS T1 JOIN settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id | spider |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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,
... | what's the price of quantitative g6pd. | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'quantitative g6pd')) | mimic_iii |
CREATE TABLE table_45219 (
"Tournament" text,
"2002" text,
"2004" text,
"2005" text,
"2006" text
) | What shows for 2002 when the 2004 is A, and the 2005 is 1r? | SELECT "2002" FROM table_45219 WHERE "2004" = 'a' AND "2005" = '1r' | wikisql |
CREATE TABLE table_73934 (
"Represents" text,
"Contestant" text,
"Age" real,
"Height (cm)" text,
"Height (ft)" text,
"Hometown" text
) | Name the total number of represents for clary sermina delgado cid | SELECT COUNT("Represents") FROM table_73934 WHERE "Contestant" = 'Clary Sermina Delgado Cid' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | In Strategy of Sport Organizations what courses satisfy the PreMajor requirement ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Strategy of Sport Organizations%' OR course.description LIKE '%Strategy of Sport Organizations%'... | advising |
CREATE TABLE table_30073089_2 (
position VARCHAR,
fis_points VARCHAR
) | Name the position for fis points being 3495 | SELECT position FROM table_30073089_2 WHERE fis_points = 3495 | sql_create_context |
CREATE TABLE table_name_20 (
rank INTEGER,
name VARCHAR
) | What is sun yang's lowest rank? | SELECT MIN(rank) FROM table_name_20 WHERE name = "sun yang" | sql_create_context |
CREATE TABLE table_969 (
"Season" text,
"Oberliga Bayern" text,
"Oberliga Hessen" text,
"Oberliga Baden-W\u00fcrttemberg" text,
"Oberliga S\u00fcdwest" text
) | Name the season for spvgg bayreuth and fsv salmrohr | SELECT "Season" FROM table_969 WHERE "Oberliga Bayern" = 'SpVgg Bayreuth' AND "Oberliga S\u00fcdwest" = 'FSV Salmrohr' | wikisql |
CREATE TABLE table_1212189_1 (
torque__nm__rpm VARCHAR,
model_engine VARCHAR
) | The 1.6 Duratec model/engine has how many torque formulas? | SELECT COUNT(torque__nm__rpm) FROM table_1212189_1 WHERE model_engine = "1.6 Duratec" | sql_create_context |
CREATE TABLE table_6320 (
"Competition" text,
"Played" real,
"Blackpool" real,
"Draw" real,
"Preston North End" real
) | How much Preston North End has a Blackpool smaller than 0? | SELECT COUNT("Preston North End") FROM table_6320 WHERE "Blackpool" < '0' | wikisql |
CREATE TABLE table_13005 (
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"% Won" real
) | What is the Lost with Against smaller than 25, and Played smaller than 1? | SELECT AVG("Lost") FROM table_13005 WHERE "Against" < '25' AND "Played" < '1' | wikisql |
CREATE TABLE table_50190 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | On what Surface was the match against Malek Jaziri played? | SELECT "Surface" FROM table_50190 WHERE "Opponent" = 'malek jaziri' | wikisql |
CREATE TABLE table_name_67 (
record VARCHAR,
time___et__ VARCHAR,
result VARCHAR
) | Time ( ET ) of 1:00pm, and a Result of w 34 14 has what record? | SELECT record FROM table_name_67 WHERE time___et__ = "1:00pm" AND result = "w 34–14" | sql_create_context |
CREATE TABLE table_name_27 (
pick INTEGER,
nfl_club VARCHAR,
round VARCHAR
) | What is the largest pick by the Baltimore Colts in a round later than 10? | SELECT MAX(pick) FROM table_name_27 WHERE nfl_club = "baltimore colts" AND round > 10 | 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... | 沈雅懿患者的检验报告单对应的检验结果指标均异常都是哪些?列出对应的检验报告单号都是啥? | SELECT jyjgzbb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | count the number of patients who were admitted via emergency hospital room and diagnosed with pneumonia in aspergillosis. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.long_title = "Pneumonia in aspergillosis" | mimicsql_data |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Cou... | Find posts with specific text. | SELECT p.CreationDate AS "Date", u.Id AS "User ID", u.DisplayName AS "User Name", p.Id AS "post_link" FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.Body LIKE '%##SpecifiedText##%' | sede |
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... | 查查编号为59839403的病患被开出过药品金额超过2930.76元的医疗记录,看看这些医疗就诊的编码 | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '59839403' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2930.76) | css |
CREATE TABLE table_19031 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | who is the the mens singles with mens doubles being kaj lindfors kaj osterberg | SELECT "Mens singles" FROM table_19031 WHERE "Mens doubles" = 'Kaj Lindfors Kaj Osterberg' | wikisql |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_... | ATLANTA to PITTSBURGH | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSB... | atis |
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... | 列出医疗记录中对于10674984患者医疗费总额不少于3779.26元的出院诊断疾病编码和名称分别是什么? | SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '10674984' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 3779.26) | css |
CREATE TABLE table_name_35 (
player VARCHAR,
score VARCHAR,
country VARCHAR
) | Which player has 68 as the score and canada as the country? | SELECT player FROM table_name_35 WHERE score = 68 AND country = "canada" | sql_create_context |
CREATE TABLE table_25518547_4 (
player VARCHAR,
affiliation VARCHAR
) | How many players are affiliated with indiana university? | SELECT COUNT(player) FROM table_25518547_4 WHERE affiliation = "Indiana University" | sql_create_context |
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
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,
Nu... | For all storms with at least 1 death, show me the name and the total number of deaths with a bar chart, show Y-axis from high to low order. | SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths DESC | nvbench |
CREATE TABLE table_2190 (
"Year(s)" real,
"Commentator" text,
"Dual Commentator" text,
"Spokesperson" text,
"Channel" text
) | how many spokesperson where in 2004 | SELECT COUNT("Spokesperson") FROM table_2190 WHERE "Year(s)" = '2004' | wikisql |
CREATE TABLE table_32816 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did the home team score 18.17 (125)? | SELECT "Venue" FROM table_32816 WHERE "Home team score" = '18.17 (125)' | wikisql |
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,
... | 在99842963848住院治疗结束出院时其状态代码是什么? | SELECT zyjzjlb.CYZTDM FROM zyjzjlb WHERE zyjzjlb.JZLSH = '99842963848' | css |
CREATE TABLE table_name_64 (
points INTEGER,
performer VARCHAR
) | What is the sum of Points, when the Performer is fe-mail? | SELECT SUM(points) FROM table_name_64 WHERE performer = "fe-mail" | sql_create_context |
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,
... | 患者葛秀洁在二00八年三月二十一日到二0一二年七月十八日期间,刷医保卡的医疗费总额有多少 | SELECT SUM(t_kc24.MED_AMOUT) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '葛秀洁' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-03-21' AND '2012-07-18' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PE... | css |
CREATE TABLE zyb (
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... | 在06年6月14日到07年3月9日这一年内,医疗机构7349327的患者平均住院时长是多久? | SELECT AVG(qtb.IN_HOSP_DAYS) FROM qtb WHERE qtb.MED_SER_ORG_NO = '7349327' AND qtb.IN_HOSP_DATE BETWEEN '2006-06-14' AND '2007-03-09' UNION SELECT AVG(gyb.IN_HOSP_DAYS) FROM gyb WHERE gyb.MED_SER_ORG_NO = '7349327' AND gyb.IN_HOSP_DATE BETWEEN '2006-06-14' AND '2007-03-09' UNION SELECT AVG(zyb.IN_HOSP_DAYS) FROM zyb WH... | css |
CREATE TABLE table_name_47 (
venue VARCHAR,
away_team VARCHAR
) | In the match where fitzroy was the away team, where was the venue? | SELECT venue FROM table_name_47 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE table_name_61 (
date VARCHAR,
tournament VARCHAR
) | What is the date of the U.S. Women's open? | SELECT date FROM table_name_61 WHERE tournament = "u.s. women's open" | sql_create_context |
CREATE TABLE table_8573 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | On what date was the format of ed remaster cd? | SELECT "Date" FROM table_8573 WHERE "Format" = 'ed remaster cd' | wikisql |
CREATE TABLE table_name_66 (
opponent VARCHAR,
date VARCHAR
) | What team was the opponent on October 15, 1967? | SELECT opponent FROM table_name_66 WHERE date = "october 15, 1967" | sql_create_context |
CREATE TABLE table_name_11 (
floors INTEGER,
height VARCHAR,
building VARCHAR
) | What is the largest amount of floors in the 70m (233ft) Tupper building (educational)? | SELECT MAX(floors) FROM table_name_11 WHERE height = "70m (233ft)" AND building = "tupper building (educational)" | sql_create_context |
CREATE TABLE table_train_72 (
"id" int,
"extracorporeal_membrane_oxygenation_ecmo_cannulation" bool,
"heart_disease" bool,
"meningitis_or_encephalitis" bool,
"sepsis" bool,
"cancer" bool,
"prisoners" bool,
"NOUSE" float
) | history of cardiac arrest. | SELECT * FROM table_train_72 WHERE prisoners = 1 | criteria2sql |
CREATE TABLE table_204_514 (
id number,
"date" text,
"sub" number,
"flight" text,
"dead" number,
"hurt" number,
"pax." number,
"type" text,
"perpetrator" text,
"description" text
) | which airliner attack on the list had the most dead ? | SELECT "flight" FROM table_204_514 ORDER BY "dead" DESC LIMIT 1 | squall |
CREATE TABLE table_name_30 (
total_viewers VARCHAR,
bbc_one_weekly_ranking VARCHAR,
episode_no VARCHAR
) | What was the total viewership for BBC One weekly rankings larger than 7, before episode 4? | SELECT total_viewers FROM table_name_30 WHERE bbc_one_weekly_ranking > 7 AND episode_no < 4 | sql_create_context |
CREATE TABLE table_14323 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the highest number of cuts made in a tournament with 0 wins and 0 top 5 placings? | SELECT MAX("Cuts made") FROM table_14323 WHERE "Top-5" = '0' AND "Wins" < '0' | wikisql |
CREATE TABLE table_name_36 (
event VARCHAR,
time VARCHAR
) | What event of this season had a time of 2:43? | SELECT event FROM table_name_36 WHERE time = "2:43" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Count of posts edited by two users. | SELECT Week, '22', '17163', '17702', '13438' FROM (SELECT DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0) AS "week", c.UserId, COUNT(*) AS Count FROM Comments AS c WHERE c.UserId IN (22, 17163, 17702, 13438) AND YEAR(c.CreationDate) >= 2016 GROUP BY DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0), c.UserId) AS src ... | sede |
CREATE TABLE table_name_86 (
total__kg_ VARCHAR,
snatch VARCHAR
) | What's the Total (kg) of a Snatch of 132.5? | SELECT total__kg_ FROM table_name_86 WHERE snatch = 132.5 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.