context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_27983 (
"#" real,
"Airdate" text,
"No. of couples" real,
"1st couple" text,
"2nd couple" text,
"3rd couple" text,
"4th couple" text,
"Viewers (millions)" text,
"ITV1 weekly ranking" text
) | How many episode numbers are there on the show whose first couple was Stuart and Pegah>? | SELECT COUNT("#") FROM table_27983 WHERE "1st couple" = 'Stuart and Pegah' | wikisql |
CREATE TABLE sqlite_sequence (
name any,
seq any
)
CREATE TABLE Country (
id INTEGER,
name TEXT
)
CREATE TABLE Team_Attributes (
id INTEGER,
team_fifa_api_id INTEGER,
team_api_id INTEGER,
date TEXT,
buildUpPlaySpeed INTEGER,
buildUpPlaySpeedClass TEXT,
buildUpPlayDribbling ... | For the top five players in terms of potential, bin their birthday into weekday interval count them using a bar graph. | SELECT birthday, COUNT(birthday) FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5 | nvbench |
CREATE TABLE table_name_33 (
nationality VARCHAR,
player VARCHAR
) | What is the nationality when Claude Periard is the player? | SELECT nationality FROM table_name_33 WHERE player = "claude periard" | sql_create_context |
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 (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For all employees who have the letters D or S in their first name, show me about the change of commission_pct over hire_date in a line chart, could you display by the X in asc? | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_name_91 (
state VARCHAR,
name VARCHAR,
gnis_feature_id VARCHAR
) | Which state has a Name of diamond lake, and a GNIS Feature ID of 1579127? | SELECT state FROM table_name_91 WHERE name = "diamond lake" AND gnis_feature_id = 1579127 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | What is the date of birth and primary disease of David Trammell? | SELECT demographic.dob, demographic.diagnosis FROM demographic WHERE demographic.name = "David Trammell" | mimicsql_data |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
... | what is the drug that was prescribed for patient 15209 within 2 days after being diagnosed with rec depr psych-psychotic during this month? | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 15209 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'rec de... | mimic_iii |
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, and rank in descending by the how many aircraft. | SELECT Aircraft, COUNT(Aircraft) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY Aircraft ORDER BY COUNT(Aircraft) DESC | nvbench |
CREATE TABLE table_17288845_9 (
score VARCHAR,
game VARCHAR
) | Name the score for game 66 | SELECT score FROM table_17288845_9 WHERE game = 66 | sql_create_context |
CREATE TABLE table_40574 (
"Name" text,
"Rank" real,
"Out of" real,
"Source" text,
"Year" text
) | What is the lowest Rank for the Name, 'area of permanent crops', Out of a number smaller than 181? | SELECT MIN("Rank") FROM table_40574 WHERE "Name" = 'area of permanent crops' AND "Out of" < '181' | wikisql |
CREATE TABLE table_57748 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | If the Away team was carlton, what Date did they play? | SELECT "Date" FROM table_57748 WHERE "Away team" = 'carlton' | wikisql |
CREATE TABLE table_70201 (
"Disc" text,
"Title" text,
"Type" text,
"Length" text,
"Tracks" real
) | What is the length of disc 67? | SELECT "Length" FROM table_70201 WHERE "Disc" = '67' | wikisql |
CREATE TABLE player (
Player_ID int,
Sponsor_name text,
Player_name text,
Gender text,
Residence text,
Occupation text,
Votes int,
Rank text
)
CREATE TABLE player_coach (
Player_ID int,
Coach_ID int,
Starting_year int
)
CREATE TABLE coach (
Coach_ID int,
Coach_name ... | Show different occupations along with the number of players in each occupation Show bar chart, could you list Y-axis in ascending order please? | SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation ORDER BY COUNT(*) | nvbench |
CREATE TABLE PostHistoryTypes (
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,
Profi... | Deleted users with at least one post. | SELECT DISTINCT OwnerDisplayName FROM Posts WHERE OwnerUserId IS NULL ORDER BY OwnerDisplayName | sede |
CREATE TABLE table_32957 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the crowd size of the game where the away team scored 8.15 (63)? | SELECT SUM("Crowd") FROM table_32957 WHERE "Away team score" = '8.15 (63)' | wikisql |
CREATE TABLE table_1341663_14 (
first_elected INTEGER,
incumbent VARCHAR
) | What year was Frank Annunzio elected | SELECT MIN(first_elected) FROM table_1341663_14 WHERE incumbent = "Frank Annunzio" | sql_create_context |
CREATE TABLE table_20429 (
"Episode Number" real,
"Air Date" text,
"Guest Host" text,
"Musical Guest (Song performed)" text,
"Who knows the most about the guest host? Panelists" text,
"Coat Of Cash Wearing Celebrity" text
) | Who was the coat of cash celeb when Scott Mills and Sally Lindsay appeared? | SELECT "Coat Of Cash Wearing Celebrity" FROM table_20429 WHERE "Who knows the most about the guest host? Panelists" = 'Scott Mills and Sally Lindsay' | wikisql |
CREATE TABLE table_32556 (
"Week" text,
"Date" text,
"Location" text,
"Opponent" text,
"Result" text
) | Which week starts on December 28, 1997? | SELECT "Week" FROM table_32556 WHERE "Date" = 'december 28, 1997' | wikisql |
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... | 列出患者93496868就诊科室名称不包含产的所有门诊就诊记录的流水号是什么,在医院3314397中? | SELECT zzmzjzjlb.JZLSH FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '93496868' AND hz_info.YLJGDM = '3314397' AND NOT zzmzjzjlb.JZKSMC LIKE '%产%' UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOIN fzzmzjzjlb ON hz_info.Y... | css |
CREATE TABLE table_name_98 (
safari VARCHAR,
internet_explorer VARCHAR
) | What was the percentage of safari when internet explorer was 20.27%? | SELECT safari FROM table_name_98 WHERE internet_explorer = "20.27%" | sql_create_context |
CREATE TABLE table_name_66 (
top_division_titles INTEGER,
number_of_seasons_in_liga_mx VARCHAR,
club VARCHAR
) | How many top division titles does Club Guadalajara have, with more than 42 seasons in Liga MX? | SELECT SUM(top_division_titles) FROM table_name_66 WHERE number_of_seasons_in_liga_mx > 42 AND club = "guadalajara" | sql_create_context |
CREATE TABLE table_2647 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What were the US Open's final scores? | SELECT "Score in the final" FROM table_2647 WHERE "Championship" = 'US Open' | 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... | count the number of patients whose diagnosis icd9 code is 29690 and lab test abnormal status is abnormal. | 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 = "29690" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_4169 (
"Series #" real,
"Production Code" real,
"Title" text,
"Directed by" text,
"Written by" text,
"United States Original Airdate" text,
"Canada Original Airdate" text
) | What number episode in the series had and original United States air date of December 24, 2010? | SELECT MAX("Series #") FROM table_4169 WHERE "United States Original Airdate" = 'December 24, 2010' | wikisql |
CREATE TABLE table_name_32 (
date VARCHAR,
week VARCHAR
) | What's the game date for week 7? | SELECT date FROM table_name_32 WHERE week = 7 | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,... | Distribution of the VLQ review survivors by Log2 Reputation of the poster. | WITH Raw AS (SELECT CAST(LN(Users.Reputation) / LN(2) AS INT) AS Log2Rep FROM ReviewTasks, Posts, Users WHERE ReviewTaskTypeId = 3 AND ReviewTasks.PostId = Posts.Id AND Users.Id = Posts.OwnerUserId) SELECT Log2Rep, 100.0 * COUNT(*) / (SELECT COUNT(*) FROM Raw) AS Pct FROM Raw GROUP BY Log2Rep ORDER BY Log2Rep | sede |
CREATE TABLE table_name_38 (
rank VARCHAR
) | What is the 2006 sum with a rank 1 and more than 6758845 in 1996? | SELECT SUM(2006) FROM table_name_38 WHERE rank = 1 AND 1996 > 6758845 | sql_create_context |
CREATE TABLE table_name_59 (
home_team VARCHAR,
venue VARCHAR
) | What is glenferrie oval's home team? | SELECT home_team FROM table_name_59 WHERE venue = "glenferrie oval" | sql_create_context |
CREATE TABLE table_33643 (
"Season" real,
"Series Name" text,
"Champion" text,
"Races \u2020" text,
"Pole Positions" text,
"Wins" text,
"Podiums" text,
"Fastest Laps" text,
"Points" text,
"Margin (pts)" text
) | How many wins are there for the Races of 12/12? | SELECT "Wins" FROM table_33643 WHERE "Races \u2020" = '12/12' | wikisql |
CREATE TABLE publication (
Book_ID VARCHAR,
Price VARCHAR
)
CREATE TABLE book (
Title VARCHAR,
Book_ID VARCHAR
) | Show the titles of books in descending order of publication price. | SELECT T1.Title FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID ORDER BY T2.Price DESC | sql_create_context |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_... | how many days have there been since patient 52898 first received a prescription for famotidine during the current hospital visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'famotidine' ORDER BY prescriptions.startdate ... | mimic_iii |
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 admission type is elective and procedure long title is umbilical vein catheterization? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Umbilical vein catheterization" | mimicsql_data |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | Find the last name and age of the student who has allergy to both milk and cat Show a bar chart, and sort total number from high to low order. | SELECT LName, Age FROM Student WHERE StuID IN (SELECT StuID FROM Has_Allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_Allergy WHERE Allergy = "Cat") ORDER BY Age DESC | nvbench |
CREATE TABLE table_name_14 (
new_council VARCHAR,
previous_council VARCHAR,
seats_up_for_election VARCHAR
) | Which number of New Councils had a previous council number of 19 and the seats up for election were bigger than 6? | SELECT COUNT(new_council) FROM table_name_14 WHERE previous_council = 19 AND seats_up_for_election < 6 | sql_create_context |
CREATE TABLE table_name_52 (
total VARCHAR,
gold VARCHAR,
silver VARCHAR
) | What is the total number of medals when the gold is more than 2 and silver more than 2? | SELECT COUNT(total) FROM table_name_52 WHERE gold > 2 AND silver > 2 | 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... | provide the number of patients whose admission type is urgent and admission year is less than 2195? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear < "2195" | mimicsql_data |
CREATE TABLE table_name_74 (
team VARCHAR,
pick VARCHAR,
college VARCHAR
) | What team has a pick larger than 30, when the college is saginaw valley state? | SELECT team FROM table_name_74 WHERE pick > 30 AND college = "saginaw valley state" | sql_create_context |
CREATE TABLE table_name_98 (
total INTEGER,
to_par VARCHAR
) | How many totals have a To par of 1? | SELECT SUM(total) FROM table_name_98 WHERE to_par = "–1" | sql_create_context |
CREATE TABLE table_53290 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
) | What is the premiere rating for a Chinese title of , and a Peak smaller than 41? | SELECT SUM("Premiere") FROM table_53290 WHERE "Chinese title" = '野蠻奶奶大戰戈師奶' AND "Peak" < '41' | wikisql |
CREATE TABLE bdmzjzjlb (
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,
MZZYZDZ... | 门诊诊断患者为疾病C83.461的氨基末端B型利钠肽数值的平均值以及最值分别是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'C83.461' AND jyjgzbb.JCZBMC = '... | css |
CREATE TABLE table_15038373_1 (
software VARCHAR,
version VARCHAR
) | What is the software with version 1.2.2.0? | SELECT software FROM table_15038373_1 WHERE version = "1.2.2.0" | sql_create_context |
CREATE TABLE table_13625 (
"Year" real,
"Recipient" text,
"Award" text,
"Category" text,
"Result" text
) | Which award took place after 2009? | SELECT "Award" FROM table_13625 WHERE "Year" > '2009' | wikisql |
CREATE TABLE table_name_57 (
outgoing_manager VARCHAR,
date_of_appointment VARCHAR
) | I want the outgoing manager for 19 february | SELECT outgoing_manager FROM table_name_57 WHERE date_of_appointment = "19 february" | sql_create_context |
CREATE TABLE table_45980 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What is the score when Biron got the decision and Philadelphia was the visitor on March 1? | SELECT "Score" FROM table_45980 WHERE "Decision" = 'biron' AND "Visitor" = 'philadelphia' AND "Date" = 'march 1' | wikisql |
CREATE TABLE table_4732 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What team was the home team at the venue junction oval? | SELECT "Home team" FROM table_4732 WHERE "Venue" = 'junction oval' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
... | 10年8月23日-21年8月22日,这11年,患者90117993的956786指标情况 | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE table_name_14 (
points VARCHAR,
club VARCHAR
) | What is Points, when Club is Maesteg RFC? | SELECT points FROM table_name_14 WHERE club = "maesteg rfc" | sql_create_context |
CREATE TABLE Order_Deliveries (
location_code VARCHAR(10),
actual_order_id INTEGER,
delivery_status_code VARCHAR(10),
driver_employee_id INTEGER,
truck_id INTEGER,
delivery_date DATETIME
)
CREATE TABLE Regular_Order_Products (
regular_order_id INTEGER,
product_id INTEGER
)
CREATE TABLE... | List the state names and the number of customers living in each state. | SELECT state_province_county, COUNT(*) FROM Customer_Addresses AS t1 JOIN Addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county | nvbench |
CREATE TABLE table_71044 (
"Category" text,
"Film" text,
"Director(s)" text,
"Country" text,
"Nominating Festival" text
) | Name the nominating festival for director of 2004 | SELECT "Nominating Festival" FROM table_71044 WHERE "Director(s)" = '2004' | wikisql |
CREATE TABLE table_17839 (
"Colt model no." text,
"Name" text,
"Stock" text,
"Fire control" text,
"Rear sight" text,
"Forward assist" text,
"Case deflector" text,
"Barrel length" text,
"Barrel profile" text,
"Barrel twist" text,
"Hand guards" text,
"Bayonet Lug" text,
... | Name the barrel length for rear sight a2 for factory compensator | SELECT "Barrel length" FROM table_17839 WHERE "Rear sight" = 'A2' AND "Muzzle device" = 'Factory compensator' | wikisql |
CREATE TABLE table_77790 (
"Year" real,
"Division" real,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
) | How many years was there a team that was part of the usisl pro league? | SELECT COUNT("Year") FROM table_77790 WHERE "League" = 'usisl pro league' | wikisql |
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
... | List the number of games in each season with a line chart, and show x-axis in ascending order. | SELECT Season, COUNT(Season) FROM game ORDER BY Season | nvbench |
CREATE TABLE table_15458 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | Which Away captain has a Date of 2,3,4,5 january 1999? | SELECT "Away captain" FROM table_15458 WHERE "Date" = '2,3,4,5 january 1999' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id n... | had patient 27172 been admitted in 2105 in hospital? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 27172 AND STRFTIME('%y', admissions.admittime) = '2105' | mimic_iii |
CREATE TABLE table_78488 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | How many laps does roberto moreno have? | SELECT "Laps" FROM table_78488 WHERE "Driver" = 'roberto moreno' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | give me the number of patients whose year of death is less than or equal to 2155 and procedure icd9 code is 4632? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2155.0" AND procedures.icd9_code = "4632" | mimicsql_data |
CREATE TABLE table_name_86 (
date VARCHAR,
location VARCHAR,
time VARCHAR
) | Which Date has a Location of davos, and a Time of 45.7? | SELECT date FROM table_name_86 WHERE location = "davos" AND time = "45.7" | sql_create_context |
CREATE TABLE table_1341663_10 (
incumbent VARCHAR,
district VARCHAR
) | who is the incumbent where the district is florida 9? | SELECT incumbent FROM table_1341663_10 WHERE district = "Florida 9" | sql_create_context |
CREATE TABLE table_10360 (
"Catalogue Number" text,
"Artist" text,
"Tracks" text,
"Type" text,
"Year" real
) | What is the year of the disc with a catalogue number mash02? | SELECT "Year" FROM table_10360 WHERE "Catalogue Number" = 'mash02' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Delet... | Group all my answers by votes. | SELECT Votes, COUNT(*) AS AnswersCount FROM (SELECT Votes FROM (SELECT SUM(CASE WHEN VoteTypeId IS NULL THEN 0 ELSE ((CASE WHEN VoteTypeId = 2 THEN 1 ELSE ((CASE WHEN VoteTypeId = 3 THEN -1 ELSE NULL END)) END)) END) AS Votes FROM Posts LEFT JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.OwnerUserId = @UserId GROUP ... | sede |
CREATE TABLE table_name_20 (
day VARCHAR,
_date VARCHAR,
game VARCHAR
) | What is the day and date of game 2? | SELECT day, _date FROM table_name_20 WHERE game = "2" | sql_create_context |
CREATE TABLE table_name_69 (
opponent VARCHAR,
surface VARCHAR,
score VARCHAR
) | With the score of 6 3, 2 6, [10 8] and played on clay who was the opponent? | SELECT opponent FROM table_name_69 WHERE surface = "clay" AND score = "6–3, 2–6, [10–8]" | sql_create_context |
CREATE TABLE table_74584 (
"District" text,
"Name" text,
"Party" text,
"Residence" text,
"Assumed office" real,
"Next election" real
) | What is the name of the Senator in the O District who assumed office in 2013? | SELECT "Name" FROM table_74584 WHERE "Assumed office" = '2013' AND "District" = 'o' | wikisql |
CREATE TABLE table_name_91 (
record VARCHAR,
score VARCHAR,
points VARCHAR
) | Which Record has a Score of 4 4, and Points of 17? | SELECT record FROM table_name_91 WHERE score = "4–4" AND points = 17 | sql_create_context |
CREATE TABLE table_name_75 (
country VARCHAR,
score VARCHAR
) | what is the country when the score is 68-72-67=207? | SELECT country FROM table_name_75 WHERE score = 68 - 72 - 67 = 207 | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | when was patient 19427 for the first time prescribed a drug the last month? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19427) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_name_58 (
attendance INTEGER,
opponent VARCHAR,
week VARCHAR
) | What is the sum of the attendance during the game against the philadelphia eagles after week 9? | SELECT SUM(attendance) FROM table_name_58 WHERE opponent = "philadelphia eagles" AND week > 9 | sql_create_context |
CREATE TABLE table_name_3 (
home_team VARCHAR,
venue VARCHAR
) | Who is the home team that played at venue MCG? | SELECT home_team FROM table_name_3 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE table_16795394_3 (
points VARCHAR,
team__number2 VARCHAR
) | If team two is Lan s, what was the total number of points? | SELECT COUNT(points) FROM table_16795394_3 WHERE team__number2 = "Lanús" | sql_create_context |
CREATE TABLE table_43476 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game Site" text,
"Record" text,
"Attendance" text
) | What was the record for the Chargers on Week 10? | SELECT "Record" FROM table_43476 WHERE "Week" = '10' | wikisql |
CREATE TABLE Product_Suppliers (
product_id INTEGER,
supplier_id INTEGER,
date_supplied_from DATETIME,
date_supplied_to DATETIME,
total_amount_purchased VARCHAR(80),
total_value_purchased DECIMAL(19,4)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date... | Return the average price for each product type by a bar chart, and display X in desc order please. | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code DESC | nvbench |
CREATE TABLE table_2644 (
"Party Name" text,
"States contested" real,
"Seats contested" real,
"Seats won" real,
"No. of Votes" real,
"% of Votes" text,
"% in Seats contested" text,
"Forfeited in seats" real
) | What is the lowest number of votes in elections that had 34.39% of seats contested? | SELECT MIN("No. of Votes") FROM table_2644 WHERE "% in Seats contested" = '34.39%' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
... | i want a flight on saturday from MINNEAPOLIS to LONG BEACH | 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 = 'LONG BEACH' AND date_day.day_number = 26 AND date_day.month_number = 7 AN... | atis |
CREATE TABLE table_name_93 (
location VARCHAR,
winner VARCHAR
) | Where was the tournament won by Hale Irwin (19)? | SELECT location FROM table_name_93 WHERE winner = "hale irwin (19)" | sql_create_context |
CREATE TABLE table_20155 (
"Kinship" text,
"Proto-Austronesian" text,
"Proto-Malayo-Polynesian" text,
"Proto-Oceanic" text,
"Proto-Polynesian" text
) | Name the ptor-austronesian for father | SELECT "Proto-Austronesian" FROM table_20155 WHERE "Kinship" = 'father' | wikisql |
CREATE TABLE table_52572 (
"Player" text,
"Tries" text,
"Conv" text,
"Pens" text,
"Drop" text,
"Venue" text,
"Date" text
) | I want to know the pens with conv of 6 | SELECT "Pens" FROM table_52572 WHERE "Conv" = '6' | wikisql |
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... | 患者吕建茗所有检验报告单中的标本采集部位在2008年7月2日到2019年5月18日期间内都是那几个部位? | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND 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_MZJZJL... | css |
CREATE TABLE table_26532 (
"World record" text,
"Kenenisa Bekele ( ETH )" text,
"12:37.35" text,
"Hengelo , Netherlands" text,
"31 May 2004" text
) | What is the 12::37.35 when hengelo , netherlands is hengelo, netherlands? | SELECT "12:37.35" FROM table_26532 WHERE "Hengelo , Netherlands" = 'Hengelo, Netherlands' | wikisql |
CREATE TABLE table_name_60 (
home_town VARCHAR,
took_office VARCHAR,
district VARCHAR
) | Which Home Town has a Took Office of 1983, and a District larger than 15? | SELECT home_town FROM table_name_60 WHERE took_office = 1983 AND district > 15 | sql_create_context |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
) | Draw a bar chart of location versus how many location, I want to sort by the y-axis in descending please. | SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY COUNT(Location) DESC | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | tell me the average total hospital cost that includes colloid administration - hydroxyethylstarch until 2104? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'colloid administration - hydroxyethylstarch'... | eicu |
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... | Is the subject id 74032 married, find his religion ? | SELECT demographic.marital_status, demographic.religion FROM demographic WHERE demographic.subject_id = "74032" | mimicsql_data |
CREATE TABLE table_name_70 (
type VARCHAR,
date VARCHAR
) | What type has a date of 1 june? | SELECT type FROM table_name_70 WHERE date = "1 june" | sql_create_context |
CREATE TABLE table_name_58 (
year VARCHAR,
award VARCHAR
) | What is the year of the Premios Carlos Gardel 2009 award? | SELECT year FROM table_name_58 WHERE award = "premios carlos gardel 2009" | sql_create_context |
CREATE TABLE table_61290 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
) | Who is in week 4 if week 5 is [month ended] and week 2 is April Ireland? | SELECT "Week 4" FROM table_61290 WHERE "Week 5" = '[month ended]' AND "Week 2" = 'april ireland' | 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,
... | 门诊诊断患者许智鑫为疾病P13.012的二氧化碳的单位和结果定量分别是什么呢? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZ... | 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... | 在医院9057855中就诊科室名称包含男科的所有门诊中,患者64012281的就诊记录的流水号是哪些 | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj... | css |
CREATE TABLE table_name_81 (
runner_s__up VARCHAR,
winning_score VARCHAR
) | Who was the runner-up when the winning score was 28 (66-67-68-64-67=332)? | SELECT runner_s__up FROM table_name_81 WHERE winning_score = –28(66 - 67 - 68 - 64 - 67 = 332) | sql_create_context |
CREATE TABLE table_27007 (
"Artist/Band" text,
"Song" text,
"Disney affiliated" text,
"Released" real,
"US exclusive" text,
"EU exclusive" text
) | Name the most released for right here, right now | SELECT MAX("Released") FROM table_27007 WHERE "Song" = 'Right Here, Right Now' | wikisql |
CREATE TABLE table_204_384 (
id number,
"#" number,
"air date" text,
"timeslot (est)" text,
"season" text,
"rating" number,
"share" number,
"18-49 (rating/share)" text,
"viewers (m)" number,
"weekly rank (#)" number
) | what time slot did the show have for its first 6 episodes ? | SELECT "timeslot (est)" FROM table_204_384 WHERE "#" = 6 | 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... | how many patients with tietze's disease are insured by the government? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.long_title = "Tietze's disease" | mimicsql_data |
CREATE TABLE table_204_98 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | what was luis jesus ' quickest finish time ? | SELECT MIN("notes") FROM table_204_98 | squall |
CREATE TABLE table_name_33 (
date VARCHAR,
opposition VARCHAR,
round VARCHAR
) | When was the opposition sydney fc on round 19? | SELECT date FROM table_name_33 WHERE opposition = "sydney fc" AND round = "round 19" | sql_create_context |
CREATE TABLE table_name_49 (
fastest_lap VARCHAR,
winning_driver VARCHAR
) | What is the fastest lap for Seiji Ara? | SELECT fastest_lap FROM table_name_49 WHERE winning_driver = "seiji ara" | 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 admission type and primary disease of subject name cynthia gomez? | SELECT demographic.admission_type, demographic.diagnosis FROM demographic WHERE demographic.name = "Cynthia Gomez" | mimicsql_data |
CREATE TABLE table_name_80 (
year VARCHAR,
works_no VARCHAR
) | In what Year is the Works No. 2040-2049? | SELECT year FROM table_name_80 WHERE works_no = "2040-2049" | sql_create_context |
CREATE TABLE table_76652 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | WWhich rder had a vehicle manufactured by kr211v? | SELECT "Rider" FROM table_76652 WHERE "Manufacturer" = 'kr211v' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | what is the name of a drug that patient 033-250 has been prescribed for two times until 13 months ago? | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033... | eicu |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | what are the top three most frequent laboratory tests that followed in the same hospital visit for patients who took anticonvulsants - valproate in 2104? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'anticonvulsants -... | eicu |
CREATE TABLE table_159614_2 (
harris VARCHAR,
party VARCHAR
) | What is the percentage of the Labour Party on the Harris Poll | SELECT harris FROM table_159614_2 WHERE party = "Labour" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.