context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | 就诊状态代码以及名称在门诊就诊87790352071中是什么? | SELECT txmzjzjlb.JZZTDM, txmzjzjlb.JZZTMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '87790352071' UNION SELECT ftxmzjzjlb.JZZTDM, ftxmzjzjlb.JZZTMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '87790352071' | css |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
) | Please return me a bar chart show what are the total smallest rating of different movie title?, and list in ascending by the X. | SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY T2.title | nvbench |
CREATE TABLE table_48639 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
) | Saint-Jacques has what as the area km 2? | SELECT "Area km 2" FROM table_48639 WHERE "Official Name" = 'saint-jacques' | wikisql |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),... | How many departments for each building? Draw a bar chart, and show by the bar in ascending. | SELECT building, COUNT(building) FROM department GROUP BY building ORDER BY building | nvbench |
CREATE TABLE table_21312845_1 (
directed_by VARCHAR,
production_code VARCHAR,
written_by VARCHAR
) | Who directed the episode with a production code greater than 4301103.585233785 that was written by Curtis Kheel? | SELECT directed_by FROM table_21312845_1 WHERE production_code > 4301103.585233785 AND written_by = "Curtis Kheel" | sql_create_context |
CREATE TABLE table_1566852_6 (
date VARCHAR,
centerfold_model VARCHAR
) | How many times was Jillian Grace the centerfold model? | SELECT COUNT(date) FROM table_1566852_6 WHERE centerfold_model = "Jillian Grace" | 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... | Name the type and dosage of Phenazopyridine HCl. | SELECT prescriptions.drug_type, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Phenazopyridine HCl" | mimicsql_data |
CREATE TABLE table_name_54 (
name VARCHAR,
number VARCHAR
) | What name has 50 as the number? | SELECT name FROM table_name_54 WHERE number = "50" | sql_create_context |
CREATE TABLE table_name_99 (
Id VARCHAR
) | Which 2003 has a 2013 of 1r, and a 2007 of 2r? | SELECT 2003 FROM table_name_99 WHERE 2013 = "1r" AND 2007 = "2r" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | Compare the prices of each manufacturer's most expensive product with a bar chart, and list in descending by the price. | SELECT T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY MAX(T1.Price) DESC | nvbench |
CREATE TABLE table_name_96 (
socket VARCHAR,
sspec_number VARCHAR
) | What is the socket when the sSpec number is standard power? | SELECT socket FROM table_name_96 WHERE sspec_number = "standard power" | sql_create_context |
CREATE TABLE table_13258806_2 (
week INTEGER,
date VARCHAR
) | During what weak of the season was the game played on october 4, 1987? | SELECT MAX(week) FROM table_13258806_2 WHERE date = "October 4, 1987" | sql_create_context |
CREATE TABLE table_30679 (
"Couple" text,
"Style" text,
"Music" text,
"Trine Dehli Cleve" real,
"Tor Fl\u00f8ysvik" real,
"Karianne Gulliksen" real,
"Christer Tornell" real,
"Total" real
) | Which style led to a score given by Tor Floysvik of 8? | SELECT "Style" FROM table_30679 WHERE "Tor Fl\u00f8ysvik" = '8' | wikisql |
CREATE TABLE table_name_57 (
manner_of_departure VARCHAR,
team VARCHAR
) | What is Motherwell Team's manner of departure? | SELECT manner_of_departure FROM table_name_57 WHERE team = "motherwell" | sql_create_context |
CREATE TABLE table_77461 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the to par of player tom weiskopf, who has a 71-74=145 score? | SELECT "To par" FROM table_77461 WHERE "Score" = '71-74=145' AND "Player" = 'tom weiskopf' | wikisql |
CREATE TABLE procedures (
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 ... | how many patients whose admission location is clinic referral/premature and primary disease is newborn? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "NEWBORN" | mimicsql_data |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE status (
station_i... | Give me the dates when the max temperature was higher than 85, and count them by a line chart, order X in desc order. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY date ORDER BY date DESC | nvbench |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
pro... | list all flights going from BOSTON to ATLANTA on wednesday after 1800 o'clock pm on wednesday | 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 ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_77794 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | what is the time/retired when the laps is 52? | SELECT "Time/Retired" FROM table_77794 WHERE "Laps" = '52' | wikisql |
CREATE TABLE table_44202 (
"Publication" text,
"Country" text,
"Accolade" text,
"Year" real,
"Rank" real
) | What is the sum of Year, when Publication is 'VH1', and when Rank is greater than 11? | SELECT SUM("Year") FROM table_44202 WHERE "Publication" = 'vh1' AND "Rank" > '11' | wikisql |
CREATE TABLE table_2840500_6 (
pick VARCHAR,
player VARCHAR
) | Which pick did Michel Larocque receive? | SELECT pick FROM table_2840500_6 WHERE player = "Michel Larocque" | sql_create_context |
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... | 列出医疗费总额与医疗就诊70966424211相同的医疗就诊记录的ID、人员ID、公民身份号码、人员姓名、人员性别、人员年龄有什么? | SELECT t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '70966424211') | 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... | what is the number of patients whose days of hospital stay is greater than 11 and lab test name is potassium? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "11" AND lab.label = "Potassium" | mimicsql_data |
CREATE TABLE table_71006 (
"Language" text,
"Number" text,
"percentage (%)" text,
"males" text,
"females" text
) | Name the males for language of persons that didn't name their native language | SELECT "males" FROM table_71006 WHERE "Language" = 'persons that didn''t name their native language' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM ... | 号码为77162330250的门诊就诊的诊断编码和名称分别是什么? | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM mzjzjlb WHERE mzjzjlb.JZLSH = '77162330250' | css |
CREATE TABLE table_name_47 (
venue VARCHAR,
home_team VARCHAR
) | Which Venue has a Home team of essendon? | SELECT venue FROM table_name_47 WHERE home_team = "essendon" | sql_create_context |
CREATE TABLE table_name_16 (
time_retired VARCHAR,
team VARCHAR,
grid VARCHAR
) | What is Time/Retired, when Team is 'Team Vodafone', and when Grid is greater than 4? | SELECT time_retired FROM table_name_16 WHERE team = "team vodafone" AND grid > 4 | sql_create_context |
CREATE TABLE table_67800 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | On what date was the result Wi by 1 run? | SELECT "Date" FROM table_67800 WHERE "Result" = 'wi by 1 run' | wikisql |
CREATE TABLE table_46090 (
"Country" text,
"Population (July 2005 est.)" real,
"Land Area (km\u00b2)" real,
"% of arable land (2005 est.)" text,
"Arable Land (km\u00b2)" real,
"Population Density (pop per km\u00b2)" real
) | What is the total population of American Samoa (US) that has less than 16,280 km arable land, less than 240 km land area, and has a population density of more than 291? | SELECT COUNT("Population (July 2005 est.)") FROM table_46090 WHERE "Arable Land (km\u00b2)" < '16,280' AND "Land Area (km\u00b2)" < '240' AND "Country" = 'american samoa (us)' AND "Population Density (pop per km\u00b2)" > '291' | wikisql |
CREATE TABLE table_32124 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Name the location of ufc 98 | SELECT "Location" FROM table_32124 WHERE "Event" = 'ufc 98' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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,
... | what was the minimum daily number of patients diagnosed with bipol i currnt manic nos? | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'bipol i currnt manic nos') GROUP BY STRFTIME('%y-%m-%d', diagnoses_icd.charttime)) AS t1 | mimic_iii |
CREATE TABLE table_27176 (
"Player" text,
"Minutes" real,
"Field Goals" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | List the number of long range shors where the score is 171. | SELECT COUNT("Field Goals") FROM table_27176 WHERE "Points" = '171' | wikisql |
CREATE TABLE table_39026 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue #" text
) | Which country has Hydra Head Records on February 2005? | SELECT "Country" FROM table_39026 WHERE "Label" = 'hydra head records' AND "Date" = 'february 2005' | wikisql |
CREATE TABLE table_17584 (
"Rank" real,
"Peak" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Isolation (km)" real,
"Municipality" text,
"County" text
) | What county is in isolation of 29? | SELECT "County" FROM table_17584 WHERE "Isolation (km)" = '29' | wikisql |
CREATE TABLE table_50059 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" real,
"Avg. Finish" real,
"Winnings" text,
"Position" text,
"Team(s)" text
) | What was the highest number of starts in 2007 when the average start was over 17.6? | SELECT MAX("Starts") FROM table_50059 WHERE "Year" = '2007' AND "Avg. Start" > '17.6' | wikisql |
CREATE TABLE table_17279 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | what are the original air dates with a title of 'spare Parts | SELECT "Original air date" FROM table_17279 WHERE "Title" = 'Spare Parts' | wikisql |
CREATE TABLE table_name_42 (
crowd INTEGER,
away_team VARCHAR
) | When the Away team is melbourne, what's the lowest Crowd attended? | SELECT MIN(crowd) FROM table_name_42 WHERE away_team = "melbourne" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId... | What questions are marked as favorite by a user?. | SELECT Posts.OwnerUserId AS "user_link", Posts.Id AS "post_link" FROM Posts JOIN Votes ON Posts.Id = Votes.PostId WHERE Votes.VoteTypeId = 5 AND Posts.PostTypeId = 1 AND Votes.UserId = '##UserId##' | sede |
CREATE TABLE table_13619135_8 (
team VARCHAR,
record VARCHAR
) | Who did the Raptors play when their record was 45-36? | SELECT team FROM table_13619135_8 WHERE record = "45-36" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
H... | 想知道患者94188667在二00四年六月十四日到二0一九年六月二十九日期间被开出谷维素片的总次数是多少 | SELECT COUNT(*) 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_ID = '94188667' AND t_kc22.STA_DATE BETWEEN '2004-06-14' AND '2019-06-29' AND t_kc22.SOC_SRT_DIRE_NM = '谷维素片' | css |
CREATE TABLE table_27756474_2 (
game VARCHAR,
high_points VARCHAR
) | Which game did rudy gay (12) have the highest points? | SELECT game FROM table_27756474_2 WHERE high_points = "Rudy Gay (12)" | sql_create_context |
CREATE TABLE table_name_80 (
director VARCHAR,
title VARCHAR
) | Who's the director of Buddy of the Apes? | SELECT director FROM table_name_80 WHERE title = "buddy of the apes" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | tell me the amount of output patient 015-58787 has had today? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-58787')) AND intakeoutput.cellpath LIKE '%ou... | eicu |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what are the three most frequent drugs that were prescribed to the endocarditis - native valve female patients 50s during this year in the same month after being diagnosed with endocarditis - native valve? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'endocarditis - native valve' AND DATETIME(diagnosi... | eicu |
CREATE TABLE table_203_653 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is total number of bronze medals for slovakia ? | SELECT "bronze" FROM table_203_653 WHERE "nation" = 'slovakia' | squall |
CREATE TABLE table_50367 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Who was the home team when the record was 2-3? | SELECT "Home" FROM table_50367 WHERE "Record" = '2-3' | wikisql |
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, draw a bar chart about the distribution of name and the amount of name , and group by attribute name, and rank in ascending by the Y-axis. | SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name) | nvbench |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Find All_Neutral and Team_ID , and visualize them by a bar chart, list in ascending by the names. | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral | nvbench |
CREATE TABLE table_35669 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
) | What is the Class AAAAA when the Class AAA is Gonzales? | SELECT "Class AAAA" FROM table_35669 WHERE "Class AAA" = 'gonzales' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | Average views for a scored question. | SELECT AVG(CAST(p1.ViewCount AS FLOAT)) AS avgViews FROM Posts AS p1 WHERE p1.PostTypeId = 1 AND p1.Score > 0 | sede |
CREATE TABLE table_67226 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | Which Nationality has a Name of igor koleda? | SELECT "Nationality" FROM table_67226 WHERE "Name" = 'igor koleda' | wikisql |
CREATE TABLE table_17049 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
) | What's the position of the player from Germantown, TN? | SELECT "Position" FROM table_17049 WHERE "Hometown" = 'Germantown, TN' | 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... | 病患82459876开出的所有药品的编号、名称、数量、单价、金额列出在2000年5月9日到2017年10月31日期间的详细情况? | 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_ID = '82459876' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2000-05-09' AND '2017-10-31' | css |
CREATE TABLE table_name_57 (
candidate VARCHAR,
race VARCHAR
) | Who is the candidate in Race for State representative, hd18? | SELECT candidate FROM table_name_57 WHERE race = "state representative, hd18" | sql_create_context |
CREATE TABLE table_name_55 (
fa_cup_goals INTEGER,
league_cup_apps VARCHAR,
name VARCHAR
) | Which FA Cup Goals have League Cup Apps larger than 0, and a Name of trevor cherry? | SELECT MAX(fa_cup_goals) FROM table_name_55 WHERE league_cup_apps > 0 AND name = "trevor cherry" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | has patient 016-9636 since 08/2105 excreted any output (ml)-urethral catheter straight-tip 16 fr. | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput... | eicu |
CREATE TABLE table_36586 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | What happened in the Men's doubles that had a Men's singles of marco vasconcelos, and a Year larger than 2000, and a Mixed doubles of alexandre paix o filipa lamy, and a Women's singles of telma santos? | SELECT "Men's doubles" FROM table_36586 WHERE "Men's singles" = 'marco vasconcelos' AND "Year" > '2000' AND "Mixed doubles" = 'alexandre paixão filipa lamy' AND "Women's singles" = 'telma santos' | wikisql |
CREATE TABLE table_70324 (
"Player" text,
"Height" real,
"Position" text,
"Year born" real,
"Current Club" text
) | Name the position with height of 2.09 | SELECT "Position" FROM table_70324 WHERE "Height" = '2.09' | wikisql |
CREATE TABLE table_77 (
"Stadium" text,
"Capacity" real,
"City" text,
"Country" text,
"Tenant" text,
"Opening" real
) | When did the stadium where Bursaspor is the tenant open? | SELECT MIN("Opening") FROM table_77 WHERE "Tenant" = 'Bursaspor' | wikisql |
CREATE TABLE table_36014 (
"Rank" text,
"Stadium" text,
"Capacity" real,
"City" text,
"Country" text
) | Which Capacity has a City of london, and a Stadium of queen's club? | SELECT AVG("Capacity") FROM table_36014 WHERE "City" = 'london' AND "Stadium" = 'queen''s club' | wikisql |
CREATE TABLE table_10682862_68 (
last_title INTEGER
) | In what year was the last last title received, by any of the countries? | SELECT MAX(last_title) FROM table_10682862_68 | sql_create_context |
CREATE TABLE table_name_22 (
date VARCHAR,
visitor VARCHAR
) | What is the date of the game that had a visitor of Chicago? | SELECT date FROM table_name_22 WHERE visitor = "chicago" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | how many patients are with discharge location short term hospital and with procedure icd9 code 17? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.icd9_code = "17" | mimicsql_data |
CREATE TABLE table_41326 (
"Season" text,
"Division" text,
"Finish" text,
"Wins" text,
"Losses" text,
"Pct." text
) | What is the Finish of the Reno Bighorns Wins? | SELECT "Finish" FROM table_41326 WHERE "Wins" = 'reno bighorns' | wikisql |
CREATE TABLE table_62038 (
"Year" real,
"Result" text,
"Matches" real,
"Wins" real,
"Draws" real,
"Losses" real
) | What is the greatest Wins with Losses larger than 1? | SELECT MAX("Wins") FROM table_62038 WHERE "Losses" > '1' | wikisql |
CREATE TABLE mailshot_customers (
mailshot_id number,
customer_id number,
outcome_code text,
mailshot_customer_date time
)
CREATE TABLE products (
product_id number,
product_category text,
product_name text
)
CREATE TABLE customers (
customer_id number,
payment_method text,
cus... | Show the premise type and address type code for all customer addresses. | SELECT T2.premises_type, T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id | spider |
CREATE TABLE table_204_156 (
id number,
"year" number,
"crystal bicycle\n(best professional cyclist)" text,
"best young rider" text,
"best manager" text,
"crystal drop of sweat\n(best helper)" text
) | what is the average number of times johan museeuw starred ? | SELECT COUNT(*) FROM table_204_156 WHERE "crystal bicycle\n(best professional cyclist)" = 'johan museeuw' | squall |
CREATE TABLE code_description (
code varchar,
description text
)
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 time_inte... | what are the flights on 1 1 1992 from BOSTON to SAN FRANCISCO | 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 = 'SAN FRANCISCO' AND date_day.day_number = 1 AND date_day.month_number = 1 ... | atis |
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 number of patients with private insurance had the procedure titled transplant from cadaver? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Transplant from cadaver" | mimicsql_data |
CREATE TABLE table_name_90 (
place VARCHAR,
score VARCHAR
) | What place goes with the score of 70-66-65=201? | SELECT place FROM table_name_90 WHERE score = 70 - 66 - 65 = 201 | sql_create_context |
CREATE TABLE table_name_63 (
d_41 VARCHAR,
d_43 VARCHAR
) | Tell me the D 41 for D 43 of d 18 | SELECT d_41 FROM table_name_63 WHERE d_43 = "d 18" | sql_create_context |
CREATE TABLE table_name_55 (
name_in_malay VARCHAR,
foundation VARCHAR
) | What is the name for Malay with a foundation in Iptura? | SELECT name_in_malay FROM table_name_55 WHERE foundation = "iptura" | sql_create_context |
CREATE TABLE table_36992 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | Who was the opponents in the final on January 5, 2003, on a hard surface? | SELECT "Opponents in the final" FROM table_36992 WHERE "Surface" = 'hard' AND "Date" = 'january 5, 2003' | wikisql |
CREATE TABLE table_19049 (
"SUBJECT" text,
"FRESHMAN (Grade 7)" text,
"SOPHOMORE (Grade 8)" text,
"JUNIOR (3rd Year)" text,
"SENIOR (4th Year)" text
) | What is after intermediate algebra | SELECT "SENIOR (4th Year)" FROM table_19049 WHERE "SOPHOMORE (Grade 8)" = 'Intermediate Algebra' | wikisql |
CREATE TABLE mzb (
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... | 在病院3169811的76340683病人出院诊断疾病名号包括妊娠的医疗就诊记录编码是几号? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '76340683' AND qtb.MED_SER_ORG_NO = '3169811' AND qtb.OUT_DIAG_DIS_NM LIKE '%妊娠%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '76340683' AND gyb.MED_SER_ORG_NO = '3169811' AND gyb.OUT_DIAG_DIS_NM LIKE '%妊娠%' UNION SELECT zyb.MED_CLINIC_ID FROM zy... | css |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 列出所有检验指标在检验报告单95620130723里的名称、代码、结果定性与结果定量以及结果定量单位都是什么?参考值范围下限与上限都是什么? | SELECT jyjgzbb.JCZBDM, jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDX, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW, jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM jyjgzbb WHERE jyjgzbb.BGDH = '95620130723' | css |
CREATE TABLE table_name_8 (
location VARCHAR,
date VARCHAR
) | Where was the game played on January 23, 2008? | SELECT location FROM table_name_8 WHERE date = "january 23, 2008" | sql_create_context |
CREATE TABLE table_203_79 (
id number,
"year" number,
"film" text,
"publisher" text,
"director" text,
"distributor" text,
"worldwide gross" text,
"notes" text
) | how many films are under the publisher caliber comics ? | SELECT COUNT("film") FROM table_203_79 WHERE "publisher" = 'caliber comics' | squall |
CREATE TABLE table_25299 (
"Station" text,
"Extension" text,
"City/Neighborhood" text,
"Projected opening" text,
"Park and ride?" text,
"Funded by ST2 ?" text
) | What are all the City/Neighborhoods whose extension is East Link and proposed parking lot status is yes and whose proposed station is Overlake transit Center? | SELECT "City/Neighborhood" FROM table_25299 WHERE "Extension" = 'East Link' AND "Park and ride?" = 'Yes' AND "Station" = 'Overlake Transit Center' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | GIve the number of patients who died in or before the year 2112 and have the drug code sw100. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.formulary_drug_cd = "SW100" | mimicsql_data |
CREATE TABLE table_25721_3 (
total_viewers VARCHAR,
airdate VARCHAR
) | How many episodes aired on 25 october 2012? | SELECT COUNT(total_viewers) FROM table_25721_3 WHERE airdate = "25 October 2012" | sql_create_context |
CREATE TABLE table_54433 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | Which 2009 tournament was french open? | SELECT "2009" FROM table_54433 WHERE "Tournament" = 'french open' | wikisql |
CREATE TABLE table_12284476_8 (
denomination VARCHAR,
year VARCHAR,
reverse VARCHAR
) | what's the denomination with year being 2008 and reverse being football | SELECT denomination FROM table_12284476_8 WHERE year = 2008 AND reverse = "Football" | sql_create_context |
CREATE TABLE table_24991 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | Name the total number of race time for kevin harvick | SELECT COUNT("Race Time") FROM table_24991 WHERE "Driver" = 'Kevin Harvick' | wikisql |
CREATE TABLE table_name_29 (
country VARCHAR,
left_office VARCHAR
) | What is the country of the Representative that left office as incumbent? | SELECT country FROM table_name_29 WHERE left_office = "incumbent" | 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... | provide the number of patients whose admission location is clinic referral/premature and year of birth is less than 2117? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.dob_year < "2117" | mimicsql_data |
CREATE TABLE table_25285 (
"Constituency" text,
"Winner" text,
"Party" text,
"Margin" real,
"Runner-up a" text,
"Party a" text
) | What is the party where the constituency is 10. Tindivanam? | SELECT "Party" FROM table_25285 WHERE "Constituency" = '10. Tindivanam' | wikisql |
CREATE TABLE table_name_14 (
byes INTEGER,
geelong_dfl VARCHAR,
against VARCHAR
) | What is the highest Byes by Anakie who has an Against smaller than 2275? | SELECT MAX(byes) FROM table_name_14 WHERE geelong_dfl = "anakie" AND against < 2275 | sql_create_context |
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
)
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
) | Find the total revenue of companies of each founder. | SELECT SUM(revenue), founder FROM manufacturers GROUP BY founder | spider |
CREATE TABLE table_35732 (
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text,
"Streak" text
) | What is the Laker's record when they played against Kansas City Kings? | SELECT "Record" FROM table_35732 WHERE "Opponent" = 'kansas city kings' | wikisql |
CREATE TABLE procedures (
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 prescription... | how many asian patients are less than 67 years of age? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "67" | mimicsql_data |
CREATE TABLE table_72525 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | Name the most touchdowns for field goals being 1 | SELECT MAX("Touchdowns") FROM table_72525 WHERE "Field goals" = '1' | wikisql |
CREATE TABLE table_49491 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
) | What is the Original Title, when Director is 'Ting Shan-Si', and when Film Title Used In Nomination is 'The 800 Heroes'? | SELECT "Original title" FROM table_49491 WHERE "Director" = 'ting shan-si' AND "Film title used in nomination" = 'the 800 heroes' | wikisql |
CREATE TABLE table_46243 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the Score of the game with the New York Rangers Home team with a Record of 8 27 5? | SELECT "Score" FROM table_46243 WHERE "Home" = 'new york rangers' AND "Record" = '8–27–5' | wikisql |
CREATE TABLE table_name_59 (
home_team VARCHAR,
away_team VARCHAR
) | Who was the home team for the game where North Melbourne was the away team? | SELECT home_team FROM table_name_59 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE table_18169 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | Who's the incumbent in the district that first elected in 1969? | SELECT "Incumbent" FROM table_18169 WHERE "First elected" = '1969' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLO... | For all employees who have the letters D or S in their first name, show me about the correlation between employee_id and salary in a scatter chart. | SELECT EMPLOYEE_ID, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_43659 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the 2nd leg for Barcelona Team 2? | SELECT "2nd leg" FROM table_43659 WHERE "Team 2" = 'barcelona' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 从09年8月30日到12年10月24日这段时间内70984037号患者的所有检验报告单都在什么时间审核的? | SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info... | css |
CREATE TABLE table_43809 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | WHAT IS THE AWAY TEAM WITH HOME OF LEICESTER CITY? | SELECT "Away team" FROM table_43809 WHERE "Home team" = 'leicester city' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.