context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_26576 (
"Processor" text,
"Brand name" text,
"Model (list)" text,
"Cores" real,
"L2 Cache" text,
"Socket" text,
"TDP" text
) | When the socket is bga956 and processor is penryn-3m, what is the tdp? | SELECT "TDP" FROM table_26576 WHERE "Socket" = 'BGA956' AND "Processor" = 'Penryn-3M' | wikisql |
CREATE TABLE table_train_132 (
"id" int,
"loss_of_consciousness" bool,
"deep_venous_thrombosis" bool,
"unstable_angina" bool,
"thromboembolic_vascular_disease" bool,
"head_injury" bool,
"stroke" bool,
"cerebrovascular_disease" bool,
"mental_retardation" bool,
"psychiatric_disease... | significant systemic illness ( including uncontrolled hypertension ) or organ failure. | SELECT * FROM table_train_132 WHERE systemic_illness = 1 OR hypertension = 1 OR organ_failure = 1 | criteria2sql |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpape... | people working on query expansion | SELECT DISTINCT author.authorname FROM author, keyphrase, paperkeyphrase, writes WHERE keyphrase.keyphrasename LIKE 'query expansion' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid | scholar |
CREATE TABLE table_name_7 (
region VARCHAR,
date VARCHAR
) | From which region is the album with release date of 19 June 2007? | SELECT region FROM table_name_7 WHERE date = "19 june 2007" | sql_create_context |
CREATE TABLE table_name_51 (
package_option VARCHAR,
television_service VARCHAR
) | What package/option has sky arte hd as the television service? | SELECT package_option FROM table_name_51 WHERE television_service = "sky arte hd" | sql_create_context |
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... | 在门诊确诊为疾病K94.890的患者其检测指标397278的参考值范围下限和上限都是什么? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'K94.890' AND jyjgzbb.JCZBDM = '397278' | css |
CREATE TABLE table_29391888_1 (
production_code VARCHAR,
original_air_date VARCHAR
) | What is the production code for the episode whose original air date was May15,2000? | SELECT production_code FROM table_29391888_1 WHERE original_air_date = "May15,2000" | sql_create_context |
CREATE TABLE table_71251 (
"Romanized name" text,
"Name in Hangul" text,
"Name in Hanja" text,
"Gender" text,
"Birth year" real
) | What gender has Romanized name and kim yoon-yeong? | SELECT "Gender" FROM table_71251 WHERE "Romanized name" = 'kim yoon-yeong' | wikisql |
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_middle_initial text,
customer_last_name text,
gender text,
email_address text,
login_name text,
login_password text,
phone_number text,
town_city text,
state_county_province text,
country text... | How many invoices do we have? | SELECT COUNT(*) FROM invoices | spider |
CREATE TABLE table_27998 (
"Episode #" real,
"The W\u00f8rd" text,
"Guest" text,
"Introductory phrase" text,
"Original airdate" text,
"Production code" real
) | Who were the guests in the episode with production code 6021? | SELECT "Guest" FROM table_27998 WHERE "Production code" = '6021' | wikisql |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | 陶雅昶病患的身高和体重各是多少? | SELECT zzmzjzjlb.SG, zzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '陶雅昶' UNION SELECT fzzmzjzjlb.SG, fzzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN ... | css |
CREATE TABLE table_47748 (
"Elector" text,
"Nationality" text,
"Order and title" text,
"Elevated" text,
"Elevator" text
) | The Cardinal-Priest of S. Prassede order and title has who as the elevator? | SELECT "Elevator" FROM table_47748 WHERE "Order and title" = 'cardinal-priest of s. prassede' | wikisql |
CREATE TABLE table_21640 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | How many games with record 1-3-3 | SELECT COUNT("Game") FROM table_21640 WHERE "Record" = '1-3-3' | wikisql |
CREATE TABLE table_204_35 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | how many seasons did sd ponferradina b come in first place total ? | SELECT COUNT("season") FROM table_204_35 WHERE "place" = 1 | squall |
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... | provide the number of patients whose marital status is single and procedure long title is cardiopulmonary resuscitation, not otherwise specified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Cardiopulmonary resuscitation, not otherwise specified" | mimicsql_data |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
... | show me all the flights on NW from NEW YORK to MILWAUKEE to LOS ANGELES | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND CITY... | atis |
CREATE TABLE Customers (
customer_id INTEGER,
payment_method VARCHAR(15),
customer_name VARCHAR(80),
customer_phone VARCHAR(80),
customer_email VARCHAR(80),
customer_address VARCHAR(255),
customer_login VARCHAR(80),
customer_password VARCHAR(10)
)
CREATE TABLE Premises (
premise_id ... | Show the outcome code of mailshots along with the number of mailshots in each outcome code in a bar chart, and show y-axis in asc order. | SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_94 (
pick INTEGER,
name VARCHAR,
overall VARCHAR
) | What is the sum of the pick of darryl pounds, who has an overall greater than 68? | SELECT SUM(pick) FROM table_name_94 WHERE name = "darryl pounds" AND overall > 68 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | provide the number of patients whose diagnoses short title is wheelchair dependence and drug type is main? | 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 = "Wheelchair dependence" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_name_12 (
years_for_jazz VARCHAR,
position VARCHAR
) | What are the years on the Jazz for the player who is a combo forward? | SELECT years_for_jazz FROM table_name_12 WHERE position = "combo forward" | sql_create_context |
CREATE TABLE table_29730 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the high rebounds for wells fargo center 16,695 | SELECT "High rebounds" FROM table_29730 WHERE "Location Attendance" = 'Wells Fargo Center 16,695' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | How many of the patients receiving drug via sc route remained in the hospital for more than 23 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "23" AND prescriptions.route = "SC" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is the number of patients whose diagnoses short title is hx surgery to organs nec and drug route is iv drip? | 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 = "Hx surgery to organs NEC" AND prescriptions.route = "IV DRIP" | mimicsql_data |
CREATE TABLE table_name_43 (
origin_of_programming VARCHAR,
network VARCHAR
) | What is the Origin of Programming for the Network MTV India? | SELECT origin_of_programming FROM table_name_43 WHERE network = "mtv india" | sql_create_context |
CREATE TABLE table_78176 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the average grid that has over 8 laps, a Time/Retired of +2 laps, and peter gethin driving? | SELECT AVG("Grid") FROM table_78176 WHERE "Laps" > '8' AND "Time/Retired" = '+2 laps' AND "Driver" = 'peter gethin' | wikisql |
CREATE TABLE table_78751 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | When was the status test match with an opposing team of south africa? | SELECT "Date" FROM table_78751 WHERE "Status" = 'test match' AND "Opposing Teams" = 'south africa' | wikisql |
CREATE TABLE table_22496374_1 (
height VARCHAR,
high_school VARCHAR
) | How many height entries are there for players from bayside high school? | SELECT COUNT(height) FROM table_22496374_1 WHERE high_school = "Bayside" | sql_create_context |
CREATE TABLE table_71758 (
"Date" real,
"Category" text,
"Team" text,
"Rider 1" text,
"Rider 2" text
) | How many dates does the ladies category correspond to Rothaus-Cube? | SELECT COUNT("Date") FROM table_71758 WHERE "Category" = 'ladies' AND "Team" = 'rothaus-cube' | wikisql |
CREATE TABLE table_61626 (
"Tournament" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1998" text,
"2003" text,
"2004" text,
"2005" text,
"Career" text
) | What is the 2003 value with a 1r in 1998, a 14 in 1994, and a 7-12 career? | SELECT "2003" FROM table_61626 WHERE "1998" = '1r' AND "1994" = '1r' AND "Career" = '7-12' | wikisql |
CREATE TABLE table_train_221 (
"id" int,
"gender" string,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | male or female between 18 and 79 years of age. | SELECT * FROM table_train_221 WHERE (gender = 'male' OR gender = 'female') AND (age >= 18 AND age <= 79) | criteria2sql |
CREATE TABLE table_1341663_11 (
party VARCHAR,
district VARCHAR
) | In the Georgia 6 district, what is the elected party? | SELECT party FROM table_1341663_11 WHERE district = "Georgia 6" | sql_create_context |
CREATE TABLE table_18495 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the incumbent for 1932? | SELECT "Incumbent" FROM table_18495 WHERE "First elected" = '1932' | wikisql |
CREATE TABLE table_27756 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination Classification" text,
"Team classification" text
) | How many winners were there when the mountains classification was not awarded? | SELECT COUNT("Winner") FROM table_27756 WHERE "Mountains classification" = 'not awarded' | wikisql |
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... | 在2008年3月25日到2010年1月16日内列出患者14901191在医院1058628中被开出的所有药品编码和名称都是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '14901191' AND qtb.MED_SER_ORG_NO = '1058628' AND qtb.IN_HOSP_DATE BETWEEN '2008-03-25' AND '2010-01-16' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = ... | css |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Looking for voting activity of users below 125 rep. | SELECT Id, Reputation, UpVotes, DownVotes FROM Users WHERE Reputation <= 125 ORDER BY UpVotes DESC | sede |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | Count the number of patients less than 41 years old with coronary artery disease/coronary artery bypass graft (myomectomy/sda) as their primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND demographic.age < "41" | mimicsql_data |
CREATE TABLE table_27420 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original Canadian air date" text,
"Fox Int. Channels air date" text
) | How many times was episode 5 in the series aired on Fox int.? | SELECT COUNT("Fox Int. Channels air date") FROM table_27420 WHERE "Series #" = '5' | wikisql |
CREATE TABLE table_60845 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Rank has a Gold of 3, and a Bronze of 4, and a Total larger than 8? | SELECT MIN("Rank") FROM table_60845 WHERE "Gold" = '3' AND "Bronze" = '4' AND "Total" > '8' | wikisql |
CREATE TABLE table_76306 (
"Season" text,
"Series" text,
"Team Name" text,
"Races" real,
"Wins" real,
"Poles" real,
"F.L." real,
"Podiums" real,
"Points" text,
"Position" text
) | What is the average number of podiums in the 32nd position with less than 0 wins? | SELECT AVG("Podiums") FROM table_76306 WHERE "Position" = '32nd' AND "Wins" < '0' | wikisql |
CREATE TABLE table_17118657_10 (
record VARCHAR,
high_assists VARCHAR
) | If high assists are under Canty (6) how much would the record be? | SELECT record FROM table_17118657_10 WHERE high_assists = "Canty (6)" | sql_create_context |
CREATE TABLE table_name_45 (
university_of_dublin VARCHAR,
labour_panel INTEGER
) | What is the total University of Dublin value with a labour panel greater than 11? | SELECT COUNT(university_of_dublin) FROM table_name_45 WHERE labour_panel > 11 | sql_create_context |
CREATE TABLE table_name_33 (
played VARCHAR,
points_against VARCHAR
) | What is listed for Played that has Points against of 263? | SELECT played FROM table_name_33 WHERE points_against = "263" | sql_create_context |
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name... | Show me a bar chart for what are the ids and trade names of the medicine that can interact with at least 3 enzymes?, and I want to order from low to high by the x axis. | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name | nvbench |
CREATE TABLE table_name_18 (
home_team VARCHAR,
venue VARCHAR
) | What did the team score when playing at home in victoria park? | SELECT home_team AS score FROM table_name_18 WHERE venue = "victoria park" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
... | is the arterial bp [systolic] of patient 22204 last measured on the last icu visit greater than the value second to last measured on the last icu visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22204) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | mimic_iii |
CREATE TABLE player (
Team VARCHAR
) | What are the teams of the players, sorted in ascending alphabetical order? | SELECT Team FROM player ORDER BY Team | sql_create_context |
CREATE TABLE table_train_112 (
"id" int,
"systolic_blood_pressure_sbp" int,
"modified_geriatric_depression_scale_gds" int,
"diastolic_blood_pressure_dbp" int,
"rosen_modified_hachinski_ischemic_score" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"NOUSE" float
) | uncontrolled hypertension ( greater than 160 / 90 ) | SELECT * FROM table_train_112 WHERE hypertension = 1 OR systolic_blood_pressure_sbp >= 160 OR diastolic_blood_pressure_dbp >= 90 | criteria2sql |
CREATE TABLE Performers (
Performer_ID INTEGER,
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID INTEGER,
... | Give me a bar chart for how many actual delivery date of each actual delivery date, and rank total number in descending order. | SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Bookings ORDER BY COUNT(Actual_Delivery_Date) DESC | nvbench |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varcha... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find job_id and the sum of employee_id , and group by attribute job_id, and visualize them by a bar chart, and I want to sort y-axis from high to low order please. | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_46279 (
"Club" text,
"Champions" real,
"Runners-up" real,
"3rd-Place" real,
"4th-Place" real
) | What is the average Runners-Up, when 4th-Place is greater than 1, and when Champions is '2'? | SELECT AVG("Runners-up") FROM table_46279 WHERE "4th-Place" > '1' AND "Champions" = '2' | 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 patient (
... | what is the top three most frequently prescribed drugs that patients were prescribed in the same hospital encounter after being diagnosed with anuria since 2105? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anuria' AND STR... | eicu |
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 intakeoutput (
in... | how much of patient 007-7646's hct changes last measured on the last hospital visit compared to the first value measured on the last hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-7646' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit... | eicu |
CREATE TABLE table_14342480_7 (
points VARCHAR,
player VARCHAR
) | How many points were scored by Rolla Bigelow? | SELECT points FROM table_14342480_7 WHERE player = "Rolla Bigelow" | sql_create_context |
CREATE TABLE table_72155 (
"No." real,
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Where was the tournament dated nov 3, 2002? | SELECT "Tournament" FROM table_72155 WHERE "Date" = 'Nov 3, 2002' | wikisql |
CREATE TABLE table_19541 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Which colle/junior/club team did Michel Boudreau play for? | SELECT "College/junior/club team" FROM table_19541 WHERE "Player" = 'Michel Boudreau' | wikisql |
CREATE TABLE table_66387 (
"Title" text,
"Series" text,
"Director" text,
"Production Num." text,
"Release date" text
) | What director has lt as the series, with 6982 as the production num.? | SELECT "Director" FROM table_66387 WHERE "Series" = 'lt' AND "Production Num." = '6982' | wikisql |
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 rooms with a king bed. | SELECT COUNT(*) FROM rooms WHERE bedtype = "King" | spider |
CREATE TABLE table_50739 (
"Date" text,
"Result" text,
"Opponent" text,
"Venue" text,
"Location" text,
"Method" text,
"Round" real,
"Time" text,
"Record" text
) | The match that lasted 2:43 has what record? | SELECT "Record" FROM table_50739 WHERE "Time" = '2:43' | wikisql |
CREATE TABLE table_74470 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
) | What is the poor law union of the Ardacrow townland? | SELECT "Poor law union" FROM table_74470 WHERE "Townland" = 'Ardacrow' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Unanswered zero-score questions with pending close flags. | SELECT DISTINCT p.Id AS "post_link", p.CreationDate FROM Posts AS p JOIN PendingFlags AS pf ON p.Id = pf.PostId WHERE AnswerCount = 0 AND Score = 0 AND ClosedDate IS NULL ORDER BY CreationDate | sede |
CREATE TABLE table_12252 (
"Round" real,
"Date" text,
"Event" text,
"Circuit" text,
"Winning Driver" text,
"Winning Team" text
) | Which Winning Driver has a Circuit of circuit zandvoort? | SELECT "Winning Driver" FROM table_12252 WHERE "Circuit" = 'circuit zandvoort' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE cour... | For EECS 481 , what is the workload like ? | SELECT DISTINCT program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number = 481 AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_204_508 (
id number,
"no." number,
"race title" text,
"track" text,
"date" text,
"tv" text
) | how many races were there on the chart ? | SELECT COUNT("race title") FROM table_204_508 | squall |
CREATE TABLE table_204_461 (
id number,
"res." text,
"record" text,
"opponent" text,
"method" text,
"event" text,
"date" text,
"round" number,
"time" text,
"location" text,
"notes" text
) | are there more wins by submission , or tko ? | SELECT "method" FROM table_204_461 WHERE "res." = 'win' AND "method" IN ('submission', 'tko') GROUP BY "method" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE c... | how many patients received a impacted feces removal within 2 months after the diagnosis of dmii wo cmp nt st uncntr, until 1 year ago? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dmii wo cmp nt st ... | mimic_iii |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
pat... | how much is patient 027-153669's weight for the first time when they visited the hospital first time? | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-153669' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY ... | eicu |
CREATE TABLE table_77108 (
"Tournament" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"Career SR"... | What was the value in 1995 for A in 2000 at the Indian Wells tournament? | SELECT "1995" FROM table_77108 WHERE "2000" = 'a' AND "Tournament" = 'indian wells' | wikisql |
CREATE TABLE table_30312 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | Who played mens doubles for the 1999 kobe tour? | SELECT "Mens Doubles" FROM table_30312 WHERE "Year Location" = '1999 Kobe' | wikisql |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
do... | Display a bar chart for how many students are from each city, and which cities have more than one cities?, and list y-axis from high to low order. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_99 (
total INTEGER,
championship INTEGER
) | Which Championship total is over 13? | SELECT AVG(total) FROM table_name_99 WHERE championship > 13 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | tell me whether patient jerry deberry is married or not. | SELECT demographic.marital_status FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_name_18 (
base_fares VARCHAR,
fare_categories VARCHAR
) | What is the Base Fare in the senior/disabled category? | SELECT base_fares FROM table_name_18 WHERE fare_categories = "senior/disabled" | sql_create_context |
CREATE TABLE table_name_88 (
col__m_ INTEGER,
elevation__m_ INTEGER
) | Which Col (m) has an Elevation (m) smaller than 1,624? | SELECT MIN(col__m_) FROM table_name_88 WHERE elevation__m_ < 1 OFFSET 624 | sql_create_context |
CREATE TABLE table_42234 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How much gold when silver, bronze and total is smaller than 1? | SELECT MAX("Gold") FROM table_42234 WHERE "Silver" < '1' AND "Bronze" = '1' AND "Total" < '1' | wikisql |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | Return the average age of captains in each class, display by the names in descending. | SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY Class DESC | nvbench |
CREATE TABLE table_203_581 (
id number,
"club" text,
"chinese" text,
"city" text,
"home stadium" text,
"capacity" number,
"average attendance" number
) | what is the average attendance for all stadiums ? | SELECT "average attendance" FROM table_203_581 WHERE agg = 1 | squall |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Cr... | Web Frameworks Trends (# Questions per Tag per Month). | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... | sede |
CREATE TABLE table_36884 (
"Game" real,
"Date" text,
"Score" text,
"Location" text,
"Time" text,
"Attendance" real
) | Which Attendance has a Game smaller than 3, and a Date of october 31? | SELECT COUNT("Attendance") FROM table_36884 WHERE "Game" < '3' AND "Date" = 'october 31' | wikisql |
CREATE TABLE table_203_244 (
id number,
"pos" text,
"rider" text,
"manufacturer" text,
"time/retired" text,
"points" number
) | who has the most points ? | SELECT "rider" FROM table_203_244 ORDER BY "points" DESC LIMIT 1 | squall |
CREATE TABLE table_58559 (
"Athlete" text,
"Country" text,
"From" real,
"Gold" real,
"Silver" real,
"Total" real,
"Status" text
) | How many times does Switzerland have under 7 golds and less than 3 silvers? | SELECT COUNT("Total") FROM table_58559 WHERE "Country" = 'switzerland' AND "Gold" < '7' AND "Silver" < '3' | wikisql |
CREATE TABLE table_24086 (
"County" text,
"Won by" text,
"Walker %" real,
"Walker votes" real,
"Barrett %" real,
"Barrett votes" real
) | What percentage did Walker win in Calumet county? | SELECT "Walker %" FROM table_24086 WHERE "County" = 'Calumet' | wikisql |
CREATE TABLE table_1974443_1 (
enrollment VARCHAR,
institution VARCHAR
) | What is the enrollment for Lakeland College? | SELECT enrollment FROM table_1974443_1 WHERE institution = "Lakeland College" | sql_create_context |
CREATE TABLE table_14263158_3 (
opponent VARCHAR,
result VARCHAR
) | Who played in the series that resulted in matches with the following scores: 0 3 0 8 0 1 0 2 0 3 1 4 0 9 0 5? | SELECT opponent FROM table_14263158_3 WHERE result = "0–3 0–8 0–1 0–2 0–3 1–4 0–9 0–5" | 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,
... | what is the number of patients whose religion is episcopalian and lab test name is 24 hr protein? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "EPISCOPALIAN" AND lab.label = "24 hr Protein" | mimicsql_data |
CREATE TABLE table_58980 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What Surface has a Date of 15 february 1988? | SELECT "Surface" FROM table_58980 WHERE "Date" = '15 february 1988' | wikisql |
CREATE TABLE table_1499791_2 (
southern_lakota VARCHAR,
yankton_yanktonai VARCHAR
) | Name the southern lakota for wak ye a | SELECT southern_lakota FROM table_1499791_2 WHERE yankton_yanktonai = "wakȟáŋyeža" | sql_create_context |
CREATE TABLE table_1246 (
"No. in season" real,
"No. disc" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What is the original air date for the episode directed by Peter Woeste? | SELECT "Original air date" FROM table_1246 WHERE "Directed by" = 'Peter Woeste' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Visualize a bar chart about the distribution of Nationality and the sum of meter_100 , and group by attribute Nationality, sort by the Y-axis in asc. | SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_100) | nvbench |
CREATE TABLE table_74115 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | What was the manner of departure for the appointment date of 21 september 2010 | SELECT "Manner of departure" FROM table_74115 WHERE "Date of appointment" = '21 September 2010' | wikisql |
CREATE TABLE table_name_61 (
rank INTEGER,
name VARCHAR
) | What was St phan Perrot rank average? | SELECT AVG(rank) FROM table_name_61 WHERE name = "stéphan perrot" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of patients whose age is less than 76 and drug name is mycophenolate mofetil? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "76" AND prescriptions.drug = "Mycophenolate Mofetil" | mimicsql_data |
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,
... | 病号13405731在19年2月9日到20年11月19日内被开出过哪些检验报告单它们的检验报告单号都是啥? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON 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 = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ... | css |
CREATE TABLE table_58420 (
"Player" text,
"Date of Birth" text,
"Batting Style" text,
"Bowling Style" text,
"First Class Team" text
) | What batting style corresponds to a bowling style of right arm medium for Stuart Williams? | SELECT "Batting Style" FROM table_58420 WHERE "Bowling Style" = 'right arm medium' AND "Player" = 'stuart williams' | wikisql |
CREATE TABLE airport_aircraft (
ID int,
Airport_ID int,
Aircraft_ID int
)
CREATE TABLE airport (
Airport_ID int,
Airport_Name text,
Total_Passengers real,
%_Change_2007 text,
International_Passengers real,
Domestic_Passengers real,
Transit_Passengers real,
Aircraft_Movements... | What is the number of each winning aircraft? Visualize by bar chart, sort by the Aircraft in ascending. | SELECT Aircraft, COUNT(Aircraft) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY Aircraft ORDER BY Aircraft | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | Calculate the average age of white-russian ethnic background patients who were admitted to hospital in or after 2137. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear >= "2137" | mimicsql_data |
CREATE TABLE news_report (
journalist_id number,
event_id number,
work_type text
)
CREATE TABLE journalist (
journalist_id number,
name text,
nationality text,
age text,
years_working number
)
CREATE TABLE event (
event_id number,
date text,
venue text,
name text,
e... | Show the dates, places, and names of events in descending order of the attendance. | SELECT date, name, venue FROM event ORDER BY event_attendance DESC | spider |
CREATE TABLE table_19470 (
"Team" text,
"# appearances" real,
"years (won in bold)" text,
"# wins" real,
"# runner-up" real,
"Most recent final" text
) | What is the most recent final result for the years (won in bold) 1979? | SELECT "Most recent final" FROM table_19470 WHERE "years (won in bold)" = '1979' | wikisql |
CREATE TABLE table_27256 (
"Rank" real,
"WS Points" real,
"Name" text,
"Country" text,
"09-10 I/O best" real,
"09-10 GP/JGP best" real,
"09-10 GP/JGP 2nd" real,
"09-10 OI best" real,
"09-10 OI 2nd" real,
"08-09 I/O best" real,
"08-09 GP/JGP best" real,
"08-09 GP/JGP 2nd" ... | If the 08-09 gp/jgp 2nd is bigger than 227.0 and the 08-09 gp/jgp best is 252, what is the 08-09 oi best? | SELECT "08-09 OI best" FROM table_27256 WHERE "08-09 GP/JGP best" = '252' AND "08-09 GP/JGP 2nd" > '227.0' | wikisql |
CREATE TABLE table_name_68 (
torque VARCHAR,
engine VARCHAR
) | What Torque has an AMC Power Tech I6 Engine? | SELECT torque FROM table_name_68 WHERE engine = "amc power tech i6" | sql_create_context |
CREATE TABLE table_73448 (
"County" text,
"Population" real,
"Unemployment Rate" text,
"Market Income Per Capita" text,
"Poverty Rate" text,
"Status" text
) | What is the unemployment rate for the county with a market income per capita of $20,958? | SELECT COUNT("Unemployment Rate") FROM table_73448 WHERE "Market Income Per Capita" = '$20,958' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.