context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_2771237_1 (
overall_attendance VARCHAR,
average_attendance VARCHAR
) | How many times was the overall attendance 17807? | SELECT COUNT(overall_attendance) FROM table_2771237_1 WHERE average_attendance = 17807 | sql_create_context |
CREATE TABLE table_69121 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
) | What is the total value for Lost, when the value for Points is greater than 21, and when the value for Draw is 2? | SELECT SUM("Lost") FROM table_69121 WHERE "Points" > '21' AND "Draw" = '2' | wikisql |
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 those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of first_name and employee_id , and order FIRST_NAME in descending order. | SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC | nvbench |
CREATE TABLE table_name_73 (
score VARCHAR,
date VARCHAR
) | On the Date of 15 June 1992 what is the Score that is listed? | SELECT score FROM table_name_73 WHERE date = "15 june 1992" | sql_create_context |
CREATE TABLE table_73257 (
"Name" text,
"Nationality" text,
"from" real,
"to" text,
"League Apps" real,
"League Goals" real,
"Finals Apps" real,
"Finals Goals" real,
"Position" text
) | Name the mosst finals apps | SELECT MAX("Finals Apps") FROM table_73257 | wikisql |
CREATE TABLE table_75059 (
"Team" text,
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text,
"Week 6" text,
"Week 7" text,
"Week 8 Final" text
) | Name the week 3 with week 6 of 31+40=71 | SELECT "Week 3" FROM table_75059 WHERE "Week 6" = '31+40=71' | wikisql |
CREATE TABLE table_name_30 (
record VARCHAR,
res VARCHAR,
event VARCHAR
) | Which Record has the Res of win with the Event of extreme fighting 1? | SELECT record FROM table_name_30 WHERE res = "win" AND event = "extreme fighting 1" | 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
) | For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of headquarter and the amount of headquarter , and group by attribute headquarter, and list in descending by the y axis. | SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY COUNT(Headquarter) DESC | nvbench |
CREATE TABLE club (
club_id number,
name text,
region text,
start_year text
)
CREATE TABLE competition (
competition_id number,
year number,
competition_type text,
country text
)
CREATE TABLE club_rank (
rank number,
club_id number,
gold number,
silver number,
bronz... | List all club names in ascending order of start year. | SELECT name FROM club ORDER BY start_year | spider |
CREATE TABLE table_17211 (
"Round" real,
"Overall" text,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
) | What is the position of player Tobias Lindberg? | SELECT "Position" FROM table_17211 WHERE "Player" = 'Tobias Lindberg' | wikisql |
CREATE TABLE table_name_65 (
lost INTEGER,
points VARCHAR,
played VARCHAR
) | What is the highest lost number of the team with less than 14 points and less than 18 played? | SELECT MAX(lost) FROM table_name_65 WHERE points < 14 AND played < 18 | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 从二零零四年八月二十九日到二零一四年五月二十二日这段时间里,患者苗慧捷的哪些药品自付比例低于0.71的,把数量提供出来 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '苗慧捷' AND t_kc22.STA_DATE BETWEEN '2004-08-29' AND '2014-05-22' AND t_kc22.SELF_PAY_PRO < 0.71 | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the admisson type and diagnosis for patient name francis baseler? | SELECT demographic.admission_type, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Francis Baseler" | mimicsql_data |
CREATE TABLE table_80055 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | Which Catalog was formated as a CD under the label Alfa Records? | SELECT "Catalog" FROM table_80055 WHERE "Label" = 'alfa records' AND "Format" = 'cd' | wikisql |
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
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, and order y-axis in descending order. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer DESC | nvbench |
CREATE TABLE table_17110 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | Where did Darius Hamilton go? | SELECT "School" FROM table_17110 WHERE "Player" = 'Darius Hamilton' | wikisql |
CREATE TABLE table_38728 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which opponent has a time of 2:35? | SELECT "Opponent" FROM table_38728 WHERE "Time" = '2:35' | wikisql |
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,
... | how many hours have passed since first time on this hospital encounter patient 032-24135 stayed in the ward 1068? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '032-24135' AND patient.wardid = 1068 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_name_12 (
british VARCHAR,
examples VARCHAR
) | What is British, when Examples is 'November, rotunda, colossus, proscenium'? | SELECT british FROM table_name_12 WHERE examples = "november, rotunda, colossus, proscenium" | sql_create_context |
CREATE TABLE table_name_38 (
country VARCHAR,
score VARCHAR
) | What was the nationality of the player with a score of 72-72-67=211? | SELECT country FROM table_name_38 WHERE score = 72 - 72 - 67 = 211 | sql_create_context |
CREATE TABLE table_name_21 (
round VARCHAR,
college VARCHAR
) | Which round goes to Stanford college? | SELECT round FROM table_name_21 WHERE college = "stanford" | sql_create_context |
CREATE TABLE table_20592988_1 (
platelet_count VARCHAR,
prothrombin_time VARCHAR,
partial_thromboplastin_time VARCHAR
) | What are the statuses of the platelet counts for the conditions where the prothrombin time and partial thromboblastin time is unaffected? | SELECT platelet_count FROM table_20592988_1 WHERE prothrombin_time = "Unaffected" AND partial_thromboplastin_time = "Unaffected" | sql_create_context |
CREATE TABLE table_30272 (
"Represent" real,
"Contestant" text,
"Age" real,
"Height" text,
"Hometown" text,
"Sponsor" text
) | What was the height of representative #6? | SELECT "Height" FROM table_30272 WHERE "Represent" = '6' | 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 demographic (
subject_id text,
hadm_id t... | how many patients have stayed in the hospital for more than 2 days with additive drug type? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "2" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_40437 (
"Band" text,
"Value" text,
"Ratio" text,
"Ratio as %" text,
"Average" text
) | Which Value has a Ratio as % of 100%? | SELECT "Value" FROM table_40437 WHERE "Ratio as %" = '100%' | wikisql |
CREATE TABLE table_26041144_16 (
rank VARCHAR,
catches VARCHAR
) | If the catches is 131, what is the rank total number? | SELECT COUNT(rank) FROM table_26041144_16 WHERE catches = 131 | sql_create_context |
CREATE TABLE ref_attraction_types (
attraction_type_code text,
attraction_type_description text
)
CREATE TABLE theme_parks (
theme_park_id number,
theme_park_details text
)
CREATE TABLE museums (
museum_id number,
museum_details text
)
CREATE TABLE staff (
staff_id number,
tourist_att... | Show the names and details of all the staff members. | SELECT name, other_details FROM staff | spider |
CREATE TABLE table_name_3 (
year INTEGER,
result VARCHAR,
venue VARCHAR
) | When was the first year he placed 2nd in Izmir, Turkey? | SELECT MIN(year) FROM table_name_3 WHERE result = "2nd" AND venue = "izmir, turkey" | sql_create_context |
CREATE TABLE table_name_8 (
Final VARCHAR,
week_1 VARCHAR,
week_3 VARCHAR
) | What was the week 12 standing for the housemate that nominated Deepak P Rahul in week 1 and Amit Carol in week 3? | SELECT Final AS week_12 FROM table_name_8 WHERE week_1 = "deepak p rahul" AND week_3 = "amit carol" | sql_create_context |
CREATE TABLE table_24919137_2 (
broadcaster VARCHAR,
opposition VARCHAR
) | Which network broadcast the game when the Western Bulldogs played melbourne? | SELECT broadcaster FROM table_24919137_2 WHERE opposition = "Melbourne" | sql_create_context |
CREATE TABLE table_27729 (
"Number" real,
"Name" text,
"Vertices" text,
"Hypotenuse 0 c" text,
"Vertical 0 b" text,
"Horizontal 0 a" text
) | Name the horizontal 0 for tong | SELECT "Horizontal 0 a" FROM table_27729 WHERE "Name" = '通 TONG' | wikisql |
CREATE TABLE table_1752 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | With the given points of 667, what was the number of tries against? | SELECT "Tries against" FROM table_1752 WHERE "Points for" = '667' | wikisql |
CREATE TABLE table_25664518_3 (
itv1_weekly_ranking INTEGER
) | What is the maximum ITV1 weekly ranking? | SELECT MAX(itv1_weekly_ranking) FROM table_25664518_3 | sql_create_context |
CREATE TABLE table_name_91 (
score VARCHAR,
home VARCHAR,
date VARCHAR
) | What is the Score on November 23, 1946 with Washington Capitols Home team? | SELECT score FROM table_name_91 WHERE home = "washington capitols" AND date = "november 23, 1946" | sql_create_context |
CREATE TABLE table_64743 (
"Rank" real,
"Name" text,
"Height ft ( m )" text,
"Floors" real,
"Year" real
) | What is the lowest rank for El Paso Natural Gas Company Building? | SELECT MIN("Rank") FROM table_64743 WHERE "Name" = 'el paso natural gas company building' | wikisql |
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 PostTags (
PostId number,
TagId number
)
CREATE TABLE R... | Search Comments for String by User. | SELECT Id AS "comment_link", Score, CreationDate, PostId AS "post_link" FROM Comments WHERE UserId = '##UserID##' AND UPPER(Text) LIKE '%' + @pattern + '%' ORDER BY CreationDate DESC | sede |
CREATE TABLE table_name_8 (
record VARCHAR,
date VARCHAR
) | What was the Record for the game on October 30? | SELECT record FROM table_name_8 WHERE date = "october 30" | sql_create_context |
CREATE TABLE table_27615520_1 (
storage_medium VARCHAR,
product_name VARCHAR
) | List the number of ramsan-720 hard drives? | SELECT COUNT(storage_medium) FROM table_27615520_1 WHERE product_name = "RamSan-720" | sql_create_context |
CREATE TABLE table_25737761_3 (
no VARCHAR,
viewing_figure VARCHAR
) | What was the episode number that had 797000 viewers? | SELECT no FROM table_25737761_3 WHERE viewing_figure = 797000 | sql_create_context |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type... | Create a bar chart showing the total number across party | SELECT Party, COUNT(*) FROM driver GROUP BY Party | nvbench |
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... | Top 50 question askers in MSE. | SELECT OwnerUserId AS "user_link", COUNT(*) AS QuestionsCount FROM Posts WHERE NOT OwnerUserId IS NULL AND OwnerUserId != -1 GROUP BY OwnerUserId ORDER BY COUNT(*) DESC LIMIT 50 | sede |
CREATE TABLE table_name_29 (
game INTEGER,
date VARCHAR
) | What was the number of the game played on February 24? | SELECT SUM(game) FROM table_name_29 WHERE date = "february 24" | sql_create_context |
CREATE TABLE head (
head_id number,
name text,
born_state text,
age number
)
CREATE TABLE management (
department_id number,
head_id number,
temporary_acting text
)
CREATE TABLE department (
department_id number,
name text,
creation text,
ranking number,
budget_in_billi... | How many acting statuses are there? | SELECT COUNT(DISTINCT temporary_acting) FROM management | spider |
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... | 患者28348727的检验结果指标均异常的检验报告单号是什么 | SELECT jybgb.BGDH 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 station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE trip (
id INTEGER,
d... | A bar chart for what are the number of the dates that have an average sea level pressure between 30.3 and 31? | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 | nvbench |
CREATE TABLE table_25341765_1 (
title VARCHAR,
written_by VARCHAR
) | What was the name of the episode Alan Yang wrote? | SELECT title FROM table_25341765_1 WHERE written_by = "Alan Yang" | sql_create_context |
CREATE TABLE table_name_6 (
score VARCHAR,
record VARCHAR
) | Name the score with record of 17-27 | SELECT score FROM table_name_6 WHERE record = "17-27" | sql_create_context |
CREATE TABLE table_4979 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2012" text,
"2013" text
) | What is the value in 2008 when 1R is 2009 and 3R? | SELECT "2008" FROM table_4979 WHERE "2009" = '1r' AND "2006" = '3r' | wikisql |
CREATE TABLE table_55603 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | What was the location and attendance on the May 22 game? | SELECT "Location Attendance" FROM table_55603 WHERE "Date" = 'may 22' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 47178546840那个门诊在哪年哪月的哪一天结束就诊 | SELECT mzjzjlb.JZJSSJ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '47178546840' | css |
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... | 医疗就诊88444088371在出院时担当其诊断医生是谁编号是什么? | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '88444088371' | css |
CREATE TABLE table_68733 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Series" text
) | Name the total number of attendance for october 8 | SELECT COUNT("Attendance") FROM table_68733 WHERE "Date" = 'october 8' | wikisql |
CREATE TABLE dorm (
Id VARCHAR
) | How many dorms are there? | SELECT COUNT(*) FROM dorm | 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,... | count the number of patients whose ethnicity is black/cape verdean and age is less than 68. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "68" | mimicsql_data |
CREATE TABLE table_name_95 (
county VARCHAR,
median_family_income VARCHAR
) | What county has a Median family income of $37,667? | SELECT county FROM table_name_95 WHERE median_family_income = "$37,667" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the number of patients whose admission type is emergency and with lab test name lymphocytes percent? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Lymphocytes, Percent" | mimicsql_data |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges... | RU SO questions without body. | SELECT * FROM Posts WHERE (SELECT COUNT(*) FROM PostHistory WHERE PostId = Posts.Id AND (PostHistoryTypeId = 2 OR PostHistoryTypeId = 5)) = 0 AND Body = Title | sede |
CREATE TABLE table_name_79 (
page__number VARCHAR,
word__number VARCHAR,
bits VARCHAR
) | What is the page count and word count greater than 5 with Bits of 18 22? | SELECT page__number FROM table_name_79 WHERE word__number > 5 AND bits = "18–22" | sql_create_context |
CREATE TABLE table_20653 (
"Name of county" text,
"County seat" text,
"Area (km\u00b2)" real,
"Population" real,
"Population density" real,
"Towns/ villages" real
) | Name the towns/villages for budapest | SELECT "Towns/ villages" FROM table_20653 WHERE "County seat" = 'Budapest' | wikisql |
CREATE TABLE table_26614365_1 (
central VARCHAR,
english VARCHAR
) | What is the central word for 'robbers'? | SELECT central FROM table_26614365_1 WHERE english = "robbers" | sql_create_context |
CREATE TABLE table_24557 (
"Municipality" text,
"Type" text,
"District" text,
"Area (km\u00b2)" text,
"Population (2010)" real,
"Pop. Density (per km\u00b2)" text,
"No. of Barangays" real,
"Municipal Mayor" text
) | How many people per km2 are there in the municipality whose mayor is Boy Quiat? | SELECT "Pop. Density (per km\u00b2)" FROM table_24557 WHERE "Municipal Mayor" = 'Boy Quiat' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Is MUSICOL 566 offered every semester ? | SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'MUSICOL' AND COURSEalias0.numbe... | advising |
CREATE TABLE table_name_19 (
gdp__percentage_of_eu__2012_ VARCHAR,
gdp_in_s_billion_of_usd__2012_ VARCHAR
) | What is the GDP % of EU in 2012 of the country with a GDP in billions of USD in 2012 of 256.3? | SELECT gdp__percentage_of_eu__2012_ FROM table_name_19 WHERE gdp_in_s_billion_of_usd__2012_ = 256.3 | sql_create_context |
CREATE TABLE table_18278508_2 (
main_contestant VARCHAR,
co_contestant__yaar_vs_pyaar_ VARCHAR
) | Who performed with Tina Parekh? | SELECT main_contestant FROM table_18278508_2 WHERE co_contestant__yaar_vs_pyaar_ = "Tina Parekh" | sql_create_context |
CREATE TABLE table_name_86 (
place VARCHAR,
country VARCHAR,
player VARCHAR
) | Player Craig Parry of Australia is in what place number? | SELECT place FROM table_name_86 WHERE country = "australia" AND player = "craig parry" | sql_create_context |
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... | Ranking de usuarios en Per. | SELECT t.RANK, t."user", t.Location, t.Reputation FROM (SELECT Id, ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "rank", DisplayName AS "user", 'location', 'reputation' FROM Users WHERE LOWER(Location) LIKE '%peru%') AS t WHERE t.Id = 78168 | sede |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId num... | Distribution of Flagged Posts by Time (Hours) to first flag. | SELECT diff1, COUNT(*) FROM (SELECT d1, d2, TIME_TO_STR(d1, '%y-%m') AS "d1f", (12 + CAST((JULIANDAY(d2) - JULIANDAY(d1)) * 24.0 AS INT)) AS "diff1" FROM (SELECT p.Id, MIN(p.CreationDate) AS d1, MIN(r.CreationDate) AS d2 FROM Posts AS p INNER JOIN ReviewTasks AS r ON r.PostId = p.Id WHERE p.PostTypeId = 1 OR p.PostType... | sede |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | when was the first time that patient 015-12842 on the last icu visit had a heartrate that was less than 58.0? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-12842') AND NOT patient.unitdischargetime IS NU... | eicu |
CREATE TABLE table_64440 (
"Match" real,
"Date" text,
"Competition or tour" text,
"Ground" text,
"Opponent" text,
"Score1" text
) | On what date is there a score1 of 2 - 4 with the opponent Chelsea under 18s? | SELECT "Date" FROM table_64440 WHERE "Score1" = '2 - 4' AND "Opponent" = 'chelsea under 18s' | wikisql |
CREATE TABLE table_2618152_1 (
production_code VARCHAR,
original_air_date VARCHAR
) | The episode with the original air date January 6, 1999, has what production code? | SELECT production_code FROM table_2618152_1 WHERE original_air_date = "January 6, 1999" | sql_create_context |
CREATE TABLE table_64967 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | What is the earliest year when action was the genre? | SELECT MIN("Year") FROM table_64967 WHERE "Genre" = 'action' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | what is the number of patients whose year of death is less than or equal to 2111 and lab test fluid is urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_name_38 (
stories INTEGER,
height__m_ VARCHAR,
location VARCHAR,
year_of_completion VARCHAR
) | What is the largest number of stories in Recife completed later than 2007 with a height less than 135 meters? | SELECT MAX(stories) FROM table_name_38 WHERE location = "recife" AND year_of_completion > 2007 AND height__m_ < 135 | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREA... | what are all of the flights into and out of ATLANTA 's airport | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (flight.to_airport = AIRPORT_SERVICE_0.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA') OR (flight.from_airport ... | atis |
CREATE TABLE table_name_40 (
description VARCHAR,
reserve VARCHAR
) | What is the description when the reserve is Half Moon Caye? | SELECT description FROM table_name_40 WHERE reserve = "half moon caye" | sql_create_context |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
... | show me the airlines between BOSTON and DENVER | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na... | atis |
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,
... | how many patients whose diagnoses long title is anemia in chronic kidney disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Anemia in chronic kidney disease" | mimicsql_data |
CREATE TABLE table_203_823 (
id number,
"model name" text,
"date" text,
"type" text,
"thrust (kg) / power (eshp)" text,
"fitted to" text
) | what model names were dated after 1960 ? | SELECT "model name" FROM table_203_823 WHERE "date" > 1960 | squall |
CREATE TABLE table_26166836_2 (
country VARCHAR,
road_race VARCHAR
) | What's the whole range of united states where road race is ottawa marathon | SELECT COUNT(country) FROM table_26166836_2 WHERE road_race = "Ottawa Marathon" | sql_create_context |
CREATE TABLE table_2199290_2 (
year INTEGER,
partner VARCHAR
) | In what year was the partner Wesley Moodie? | SELECT MAX(year) FROM table_2199290_2 WHERE partner = "Wesley Moodie" | sql_create_context |
CREATE TABLE table_77836 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which Crowd has an Away team score of 8.6 (54)? | SELECT AVG("Crowd") FROM table_77836 WHERE "Away team score" = '8.6 (54)' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
ni... | what flights leave PITTSBURGH for DENVER on monday night | SELECT DISTINCT flight_id FROM flight WHERE (((((departure_time <= 2400 AND departure_time >= 1800) AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0... | atis |
CREATE TABLE table_name_58 (
player VARCHAR,
round VARCHAR,
pick VARCHAR
) | Who is the player from a round less than 13 and has a pick of 74? | SELECT player FROM table_name_58 WHERE round < 13 AND pick = 74 | sql_create_context |
CREATE TABLE table_name_4 (
rank INTEGER,
react VARCHAR,
time VARCHAR
) | What is the highest rank for the react of 0.198, and the time more than 20.42? | SELECT MAX(rank) FROM table_name_4 WHERE react = 0.198 AND time > 20.42 | sql_create_context |
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 diagnosis (
diagn... | what is the maximum hospital cost for a procedure that involves sedative agent - propofol until 3 years ago? | SELECT MAX(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 = 'sedative agent - propofol')) AND DATETIME(co... | eicu |
CREATE TABLE table_train_252 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"fasting_plasma_glucose_fpg" float,
"hemoglobin_a1c_hba1c" float,
"hba1c" float,
"serum_creatinine" float,
"metformin" bool,
"age" float,
"NOUSE" float
) | for subjects treated with metformin: serum creatinine >= 1.5 mg / dl ( 133 umol / l ) for male or >= 1.4 mg / dl ( 124 umol ) for female | SELECT * FROM table_train_252 WHERE metformin = 1 OR ((serum_creatinine >= 1.5 AND gender = 'male') OR (serum_creatinine >= 1.4 AND gender = 'female')) | criteria2sql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | when the last time patient 43959 was prescribed a medicine via ed route? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 43959) AND prescriptions.route = 'ed' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar... | Is Prof. Bodova the only professor available for Senior Creative Writing Tutorial ? | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Senior Creative Writing Tutorial%' AND NOT instructor.name LIKE '%Bodova%' AND offering_instructor.instru... | advising |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | Calculate the number of patients who have a primary disease acidosis and underwent contrast aortogram procedure. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ACIDOSIS" AND procedures.short_title = "Contrast aortogram" | mimicsql_data |
CREATE TABLE table_name_72 (
notes VARCHAR,
result VARCHAR,
method VARCHAR,
event VARCHAR
) | Tell me the notes with method of points and event of adcc 2001 absolute with result of loss | SELECT notes FROM table_name_72 WHERE method = "points" AND event = "adcc 2001 absolute" AND result = "loss" | sql_create_context |
CREATE TABLE table_name_93 (
team VARCHAR,
college VARCHAR
) | What is the team of the player from ohio state? | SELECT team FROM table_name_93 WHERE college = "ohio state" | sql_create_context |
CREATE TABLE table_name_84 (
reg_gp INTEGER,
pick__number INTEGER
) | What average Reg GP has a pick # larger than 210? | SELECT AVG(reg_gp) FROM table_name_84 WHERE pick__number > 210 | sql_create_context |
CREATE TABLE procedures_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,
... | retrieve the identification of those patients, who have been diagnosed with atherosclerosis nec since 2102. | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'atherosclerosis nec') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2102... | mimic_iii |
CREATE TABLE table_176521_2 (
status VARCHAR,
area_km_2 VARCHAR
) | What is the status(es) of the place with an area of 304.06 km2? | SELECT status FROM table_176521_2 WHERE area_km_2 = "304.06" | sql_create_context |
CREATE TABLE STUDENT (
Major VARCHAR,
major VARCHAR,
Sex VARCHAR
) | What is the most common major among female (sex is F) students? | SELECT major FROM STUDENT WHERE Sex = "F" GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_17 (
goals INTEGER,
name VARCHAR
) | Which Goals have a Name of lee dong-gook? | SELECT MAX(goals) FROM table_name_17 WHERE name = "lee dong-gook" | sql_create_context |
CREATE TABLE table_name_54 (
work VARCHAR,
category VARCHAR
) | What was nominated for the Best Movie category? | SELECT work FROM table_name_54 WHERE category = "best movie" | sql_create_context |
CREATE TABLE table_name_75 (
surface VARCHAR,
score VARCHAR
) | What is the Surface when the score was 4 6, 6 3, 6 7 (5 7)? | SELECT surface FROM table_name_75 WHERE score = "4–6, 6–3, 6–7 (5–7)" | sql_create_context |
CREATE TABLE table_43967 (
"Pilot" text,
"Date" text,
"Place" text,
"Weapon" text,
"Effect" text
) | What is Date, when Effect is 'Shot Down', and when Place is 'South of Stanley Airport'? | SELECT "Date" FROM table_43967 WHERE "Effect" = 'shot down' AND "Place" = 'south of stanley airport' | wikisql |
CREATE TABLE table_name_66 (
opponent VARCHAR,
date VARCHAR
) | Who is the opponent of the game played on November 20, 1995? | SELECT opponent FROM table_name_66 WHERE date = "november 20, 1995" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.