context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_50 (
year INTEGER,
actor VARCHAR
) | What is the latest Year with Marianne Jean-Baptiste as the Golden Globe Actor? | SELECT MAX(year) FROM table_name_50 WHERE actor = "marianne jean-baptiste" | sql_create_context |
CREATE TABLE table_67456 (
"State" text,
"Date" text,
"Yes vote" text,
"No vote" text,
"Vote outcome" text
) | How many positive votes for Tennessee in 2006? | SELECT "Yes vote" FROM table_67456 WHERE "Date" = '2006' AND "State" = 'tennessee' | wikisql |
CREATE TABLE table_26151 (
"Copper Age" text,
"Chalcolithic (4500 BC - 3300 BC)" text,
"Early Chalcolithic" text,
"4500 BC - 4000 BC" text,
"Ubaid period in Mesopotamia" text
) | When the second intermediate period of egypt is the ubaid period in mesopotamia how many early calcolithics are there? | SELECT COUNT("Early Chalcolithic") FROM table_26151 WHERE "Ubaid period in Mesopotamia" = 'Second Intermediate Period of Egypt' | wikisql |
CREATE TABLE table_22533 (
"Ethnic Group" text,
"2001 (%)" text,
"2001 (people)" text,
"2006 (%)" text,
"2006 (people)" real
) | What is the ethnic group that in 2001 had 117,513? | SELECT "Ethnic Group" FROM table_22533 WHERE "2001 (people)" = '117,513' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | what is the daily average of urine output of patient 025-51980 since 51 months ago? | SELECT AVG(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 = '025-51980')) AND intakeoutput.celllabel = 'urine... | eicu |
CREATE TABLE table_56823 (
"Chemical class" text,
"Group" text,
"Formula" text,
"Prefix" text,
"Suffix" text
) | Which group has the RNCS formula? | SELECT "Group" FROM table_56823 WHERE "Formula" = 'rncs' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Show me a bar chart for what are the total enrollments of universities of each affiliation type?, list Y-axis in desc order. | SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY SUM(Enrollment) DESC | nvbench |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id IN... | A bar chart for returning the number of the completion date for all the tests that have 'Fail' result, display Y from low to high order please. | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) | nvbench |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Does Political Sociology have only one teacher , Prof. Men ? | 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 '%Political Sociology%' AND NOT instructor.name LIKE '%Men%' AND offering_instructor.instructor_id = instru... | advising |
CREATE TABLE table_204_658 (
id number,
"week" number,
"date" text,
"kickoff" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"game site" text,
"attendance" number
) | what was the date of the first game ? | SELECT "date" FROM table_204_658 ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_name_69 (
construction VARCHAR,
name__wade_giles_ VARCHAR
) | which Construction is named heng-hai? | SELECT construction FROM table_name_69 WHERE name__wade_giles_ = "heng-hai" | sql_create_context |
CREATE TABLE table_15038373_1 (
version VARCHAR,
software VARCHAR
) | What is the version with sbagen software? | SELECT version FROM table_15038373_1 WHERE software = "SBaGen" | sql_create_context |
CREATE TABLE table_name_88 (
surface VARCHAR,
date VARCHAR
) | What surface was the April 24, 2003 match played on? | SELECT surface FROM table_name_88 WHERE date = "april 24, 2003" | 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,... | tell me the number of protestant quaker religious background patients who have been diagnosed with hydronephrosis. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND diagnoses.long_title = "Hydronephrosis" | mimicsql_data |
CREATE TABLE table_24837750_1 (
turbine_manufacturer VARCHAR,
date_in_service VARCHAR
) | Who was the turbine manufacturer of the wind farm that started service on 2005? | SELECT turbine_manufacturer FROM table_24837750_1 WHERE date_in_service = "2005" | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational... | Which are the classes that Dr. Megan Berkobien teaches next semester ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Megan Berkobien%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o... | advising |
CREATE TABLE table_name_50 (
react INTEGER,
lane VARCHAR
) | Can you tell me the lowest React that has the Lane of 5? | SELECT MIN(react) FROM table_name_50 WHERE lane = 5 | sql_create_context |
CREATE TABLE table_name_63 (
date VARCHAR,
score VARCHAR
) | Which Date has a Score of 102 113? | SELECT date FROM table_name_63 WHERE score = "102–113" | sql_create_context |
CREATE TABLE table_12113888_1 (
built VARCHAR,
number VARCHAR
) | What is the built data for number 34? | SELECT built FROM table_12113888_1 WHERE number = 34 | sql_create_context |
CREATE TABLE table_name_13 (
goals INTEGER,
apps VARCHAR,
rank VARCHAR
) | What is the average number of goals of the player with 234 apps and a rank above 8? | SELECT AVG(goals) FROM table_name_13 WHERE apps = 234 AND rank < 8 | sql_create_context |
CREATE TABLE table_name_97 (
date VARCHAR,
opponent VARCHAR
) | What date did the opponent George Khrikadze play? | SELECT date FROM table_name_97 WHERE opponent = "george khrikadze" | sql_create_context |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_co... | what airlines fly from NEW YORK to MILWAUKEE to LOS ANGELES | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGEL... | atis |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 有哪些医院给病人31149555开了阿立哌唑片 | SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '31149555' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '阿立哌唑片') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '31149555' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_... | css |
CREATE TABLE table_name_78 (
school VARCHAR,
location VARCHAR,
previous_conference VARCHAR,
year_joined VARCHAR
) | Which School has a Previous Conference of none (new school), and a Year Joined larger than 1960, and a Location of versailles? | SELECT school FROM table_name_78 WHERE previous_conference = "none (new school)" AND year_joined > 1960 AND location = "versailles" | sql_create_context |
CREATE TABLE table_26029 (
"#" real,
"Airdate" text,
"Episode" text,
"Rating" text,
"Share" real,
"Rating/Share (18\u201349)" text,
"Viewers (millions)" text,
"Rank (Timeslot)" real,
"Rank (Night)" real
) | How many rankings (timeslot) were there for the episode that aired on May 2, 2010? | SELECT COUNT("Rank (Timeslot)") FROM table_26029 WHERE "Airdate" = 'May 2, 2010' | wikisql |
CREATE TABLE table_name_17 (
competition VARCHAR,
played VARCHAR,
lost VARCHAR,
drew VARCHAR
) | What competition did they have 1 lost, 3 draws, and played 9 games? | SELECT competition FROM table_name_17 WHERE lost = "1" AND drew = "3" AND played = "9" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score num... | find unanswered question of users with reputation lower than 102. find unanswered question of users with reputation lower than 102 | SELECT q.Id, q.Title, 'https://math.stackexchange.com/questions/' + CAST(q.Id AS TEXT(16)), q.Tags FROM Posts AS q INNER JOIN Users AS u ON u.Id = q.OwnerUserId WHERE u.Reputation < 102 AND q.PostTypeId = 1 AND q.AcceptedAnswerId IS NULL ORDER BY q.LastEditDate DESC | sede |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | what test did patient 3403 go through for the first time since 04/2105? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3403) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-04' ORDER BY labevents.charttime LIMIT 1) | mimic_iii |
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, give me the comparison about the sum of revenue over the headquarter , and group by attribute headquarter. | SELECT Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
CREATE TABLE table_name_71 (
background VARCHAR,
hometown VARCHAR
) | What is the Background of the contestant with a Hometown listed as Los Angeles, California? | SELECT background FROM table_name_71 WHERE hometown = "los angeles, california" | sql_create_context |
CREATE TABLE table_4129 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Which pick has marko makinen as the player? | SELECT "Pick" FROM table_4129 WHERE "Player" = 'Marko Makinen' | wikisql |
CREATE TABLE table_2199290_2 (
outcome VARCHAR,
score_in_the_final VARCHAR
) | What was the outcome when the final score was 7 6(9), 7 6(1)? | SELECT outcome FROM table_2199290_2 WHERE score_in_the_final = "7–6(9), 7–6(1)" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 从2000年12月6日到2013年3月2日期间,列出患者58996582看病时给开出的所有药品的编码、名称、数量、单价、金额 | 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 = '58996582' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2000-12-06' AND '2013-03-02' | css |
CREATE TABLE table_name_66 (
record VARCHAR,
team VARCHAR
) | Which Record has a Team of philadelphia? | SELECT record FROM table_name_66 WHERE team = "philadelphia" | sql_create_context |
CREATE TABLE table_20963074_1 (
original_title VARCHAR,
film_title_used_in_nomination VARCHAR
) | Name the originl title for no stars in the jungle | SELECT original_title FROM table_20963074_1 WHERE film_title_used_in_nomination = "No Stars in the Jungle" | sql_create_context |
CREATE TABLE table_7236 (
"State or territory" text,
"Hillary Clinton" real,
"Barack Obama" real,
"Uncommitted" real,
"Unassigned" real,
"Total" real
) | What is the lowest number of uncommitted superdelegates for a state with more than 16 total and 2 for Hillary Clinton? | SELECT MIN("Uncommitted") FROM table_7236 WHERE "Total" > '16' AND "Hillary Clinton" = '2' | wikisql |
CREATE TABLE table_name_78 (
date VARCHAR,
score VARCHAR,
tie_no VARCHAR
) | What is the Date of Tie no 35 with a Score of 3 2? | SELECT date FROM table_name_78 WHERE score = "3–2" AND tie_no = "35" | sql_create_context |
CREATE TABLE table_65233 (
"Fish" text,
"Guernsey Record" text,
"Year" text,
"Location" text,
"British Record" text
) | What year was the Guernsey record of 2-3-12 set? | SELECT "Year" FROM table_65233 WHERE "Guernsey Record" = '2-3-12' | wikisql |
CREATE TABLE table_name_65 (
quantity_made VARCHAR,
quantity_preserved VARCHAR
) | What is the quantity made number for the quantity preserved 4-6-0 ooooo ten-wheeler? | SELECT quantity_made FROM table_name_65 WHERE quantity_preserved = "4-6-0 — ooooo — ten-wheeler" | 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, a bar chart shows the distribution of headquarter and the average of code , and group by attribute headquarter, sort Y-axis from high to low order. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC | nvbench |
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... | 列出医疗就诊记录中医疗费总额与医疗就诊18542009470相同的的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 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.... | css |
CREATE TABLE table_64298 (
"World record" text,
"Snatch" text,
"Sergey Filimonov ( KAZ )" text,
"173kg" text,
"Almaty , Kazakhstan" text
) | What is the snatch for the person holding the Olympic record, and 173kg of 172kg? | SELECT "Snatch" FROM table_64298 WHERE "World record" = 'olympic record' AND "173kg" = '172kg' | wikisql |
CREATE TABLE table_77772 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did the home team of essendon score? | SELECT "Home team score" FROM table_77772 WHERE "Home team" = 'essendon' | wikisql |
CREATE TABLE table_3209 (
"Region" text,
"Median income ( Intl.$ )" real,
"Below 40% of median income" text,
"Below 50% of median income" text,
"Below 60% of median income" text
) | In what region does 17.4% of the population make below 50% of the median income? | SELECT "Region" FROM table_3209 WHERE "Below 50% of median income" = '17.4%' | wikisql |
CREATE TABLE table_14836185_3 (
scoring_average VARCHAR
) | In the year where Angela Stanford had a scoring average of 71.62, how many times did she take second place? | SELECT COUNT(2 AS nd) FROM table_14836185_3 WHERE scoring_average = "71.62" | sql_create_context |
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,
... | since 6 years ago, what were the three most frequently performed procedures that the patients received after the diagnosis of acute bronchiolitis within 2 months? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'acute bronchiolitis' AND DATETIME(diagno... | eicu |
CREATE TABLE table_name_38 (
school VARCHAR,
team VARCHAR
) | The wildcats belong to what school? | SELECT school FROM table_name_38 WHERE team = "wildcats" | sql_create_context |
CREATE TABLE table_77671 (
"Season" text,
"Div." text,
"Pos." text,
"Pld." text,
"Pts." text,
"Play-offs" text,
"Trophy" text
) | During the play-off quarter-final which team scored position was the team that scored 56 points? | SELECT "Pos." FROM table_77671 WHERE "Play-offs" = 'quarter-final' AND "Pts." = '56' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 病患58930986在2002年8月30日到2016年7月24日内主要是想看什么病? | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '58930986' AND IN_HOSP_DATE BETWEEN '2002-08-30' AND '2016-07-24' GROUP BY IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_48671 (
"Party" text,
"Seats (dissol.)" real,
"Seats (2012)" real,
"Gains" real,
"Holds" real,
"Losses" real,
"Net change" text
) | Can you tell me the lowest Losses that has the Gains smaller than 0? | SELECT MIN("Losses") FROM table_48671 WHERE "Gains" < '0' | 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,
... | 从03年3月14日起到2009年1月3日为止病患柳飞星都进行了什么检测记录在检验结果指标记录里? | SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj... | css |
CREATE TABLE table_22219 (
"Year" real,
"Delegate" text,
"Hometown" text,
"Pageant" text,
"Result" text,
"Other awards" text
) | How many pageants were margaret ann awitan bayot the delegate of? | SELECT COUNT("Pageant") FROM table_22219 WHERE "Delegate" = 'Margaret Ann Awitan Bayot' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeou... | what are the genders of patient 007-7925? | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '007-7925' | eicu |
CREATE TABLE table_20878 (
"Player" text,
"VFL Games" real,
"VFL Club(s)" text,
"Rank held at time of death" text,
"Date of death" text,
"Location" text
) | What day did ARchie Roberts die? | SELECT "Date of death" FROM table_20878 WHERE "Player" = 'Archie Roberts' | wikisql |
CREATE TABLE table_name_81 (
office VARCHAR,
representative VARCHAR
) | Which Office has a Representative of scott pelath? | SELECT office FROM table_name_81 WHERE representative = "scott pelath" | sql_create_context |
CREATE TABLE table_name_56 (
lost VARCHAR
) | what team lost the most points | SELECT lost FROM table_name_56 WHERE "points" = "points" | sql_create_context |
CREATE TABLE table_35434 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Last match" text,
"Replaced by" text
) | What is the name of team with Palmeiras 4-2 portuguesa as the last match? | SELECT "Team" FROM table_35434 WHERE "Last match" = 'palmeiras 4-2 portuguesa' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | list the top five most frequent procedures that patients have received in the same hospital encounter after they have been diagnosed with oth/uns inf-cen ven cath since 2103. | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i... | mimic_iii |
CREATE TABLE table_25428629_1 (
date VARCHAR,
stadium VARCHAR
) | If the stadium name is the Thuwunna Stadium, what is the date? | SELECT date FROM table_25428629_1 WHERE stadium = "Thuwunna stadium" | sql_create_context |
CREATE TABLE table_name_85 (
position VARCHAR,
league VARCHAR,
year VARCHAR
) | What is the position when the League is the malaysian super league, and a Year of 2011? | SELECT position FROM table_name_85 WHERE league = "malaysian super league" AND year = "2011" | sql_create_context |
CREATE TABLE table_204_173 (
id number,
"rank" number,
"group" text,
"name" text,
"nationality" text,
"2.05" text,
"2.15" text,
"2.19" text,
"2.23" text,
"2.26" text,
"result" text,
"notes" text
) | who is the only high jumper to have a result of 2.05 ? | SELECT "name" FROM table_204_173 WHERE "rank" = '2.05' | squall |
CREATE TABLE table_8569 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | How many games did team iurbentia bilbao have with rebounds higher than 212? | SELECT SUM("Games") FROM table_8569 WHERE "Team" = 'iurbentia bilbao' AND "Rebounds" > '212' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | what was the last intake given to patient 031-16123. | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND intakeoutput.cellpath LIKE '%intake%' ORDER... | eicu |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For all employees who have the letters D or S in their first name, show me the trend about salary over hire_date with a line chart, order from low to high by the X-axis. | SELECT HIRE_DATE, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_58228 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Total" text,
"Report" text
) | What date had a time of 20:10? | SELECT "Date" FROM table_58228 WHERE "Time" = '20:10' | 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 days have elapsed since patient 006-2586's first cl flush: coated catheter, pressure/power inj ij r intake on the current intensive care unit visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
CREATE TABLE table_name_70 (
transfer_fee VARCHAR,
transfer_window VARCHAR,
name VARCHAR
) | What is the transfer fee of assoumani, who has a summer transfer window? | SELECT transfer_fee FROM table_name_70 WHERE transfer_window = "summer" AND name = "assoumani" | sql_create_context |
CREATE TABLE table_name_66 (
game INTEGER,
date VARCHAR
) | What is the lowest game on February 10? | SELECT MIN(game) FROM table_name_66 WHERE date = "february 10" | sql_create_context |
CREATE TABLE table_name_77 (
category_3 VARCHAR,
category_1 VARCHAR
) | If category 1 is 0.05, what is category 3? | SELECT category_3 FROM table_name_77 WHERE category_1 = 0.05 | sql_create_context |
CREATE TABLE table_12584173_1 (
population__glengallan_ VARCHAR,
population__region_total_ VARCHAR
) | How many population figures are given for Glengallen for the year when the region's total is 30554? | SELECT COUNT(population__glengallan_) FROM table_12584173_1 WHERE population__region_total_ = 30554 | sql_create_context |
CREATE TABLE table_204_453 (
id number,
"#" number,
"date" text,
"venue" text,
"opponents" text,
"score" text,
"comp" text,
"denmark scorers" text
) | what was the difference in score between the two teams in the last game ? | SELECT ABS("score" - "score") FROM table_204_453 ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE table_197286_4 (
direction VARCHAR,
further_cities VARCHAR
) | Name the number of direction for debrecen | SELECT COUNT(direction) FROM table_197286_4 WHERE further_cities = "Debrecen" | sql_create_context |
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... | Give me the comparison about the average of Team_ID over the ACC_Road , and group by attribute ACC_Road by a bar chart, and display by the y-axis in asc. | SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_ID) | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | what were the four most common diagnoses for patients who were aged 50s since 1 year ago? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 yea... | eicu |
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... | 柳娟秀这个病人的检验报告单结果指标均异常的有哪些?看看检验报告的单号 | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '柳娟秀' AND NOT ... | css |
CREATE TABLE table_6672 (
"Mission" text,
"Resident Country" text,
"Local Location" text,
"Local Mission" text,
"Local Position" text
) | What is the local location that has senegal as the resident county, and a mission of mali? | SELECT "Local Location" FROM table_6672 WHERE "Resident Country" = 'senegal' AND "Mission" = 'mali' | wikisql |
CREATE TABLE table_55128 (
"Name" text,
"Actual version" text,
"System" text,
"Platform" text,
"License" text
) | Which License has a System of amiga, and a Name of pocketuae? | SELECT "License" FROM table_55128 WHERE "System" = 'amiga' AND "Name" = 'pocketuae' | wikisql |
CREATE TABLE table_20972 (
"Runs" text,
"Wicket" text,
"Batting partners" text,
"Batting team" text,
"Fielding team" text,
"Venue" text,
"Season" text
) | What batting partners played in sydney? | SELECT "Batting partners" FROM table_20972 WHERE "Venue" = 'Sydney' | wikisql |
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE songs (
songid number,
title text
)
CREATE TABLE instruments (
songid number,
bandmateid number,
instrument text
)
CREATE TABLE band (
id number,
firstname text,
lastname text
)
C... | Find all the songs that do not have a back vocal. | SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE type = "back" | spider |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TA... | Give me the times and numbers of all trains that go to Chennai, ordered by time. Show bar chart. | SELECT time, train_number FROM train WHERE destination = 'Chennai' ORDER BY time | nvbench |
CREATE TABLE table_6553 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | What is the road team of the game with Philadelphia as the home team with a result of 105-102? | SELECT "Road Team" FROM table_6553 WHERE "Home Team" = 'philadelphia' AND "Result" = '105-102' | wikisql |
CREATE TABLE table_52212 (
"Year" real,
"Theme" text,
"Artist" text,
"Mintage" text,
"Issue Price" text
) | What is the issue price of a Year 2000 coin by artist John Mardon of the Included in Steam Buggy mintage. | SELECT "Issue Price" FROM table_52212 WHERE "Artist" = 'john mardon' AND "Year" = '2000' AND "Mintage" = 'included in steam buggy' | wikisql |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE View_Unit_Status (
apt_id INTEG... | Show me a bar chart for how many bookings does each booking status have? List the booking status code and the number of corresponding bookings. | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code | nvbench |
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 death status is 1 and days of hospital stay is greater than 2? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.days_stay > "2" | mimicsql_data |
CREATE TABLE table_name_7 (
_number_of_bids INTEGER,
win__percentage VARCHAR,
conference VARCHAR
) | How many bids were there for the .500 win percentage in the Ohio Valley conference? | SELECT SUM(_number_of_bids) FROM table_name_7 WHERE win__percentage = ".500" AND conference = "ohio valley" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 查一下彭雅蕊这位参保人产生的住院费用是整数金额的次数 | SELECT COUNT(*) FROM t_kc21 WHERE PERSON_NM = '彭雅蕊' AND CLINIC_TYPE = '住院' AND MOD(MED_AMOUT, 1) = 0 | css |
CREATE TABLE table_43569 (
"landsv\u00e6\u00f0i" text,
"(English)" text,
"Population 2011-01-01" text,
"Area (km\u00b2)" text,
"Pop./ km\u00b2" real
) | What area has less than 0.97 mil in population and is on the east? | SELECT "Area (km\u00b2)" FROM table_43569 WHERE "Pop./ km\u00b2" < '0.97' AND "(English)" = 'east' | wikisql |
CREATE TABLE table_name_33 (
venue VARCHAR,
result VARCHAR
) | What was the venue where the result was 2-1? | SELECT venue FROM table_name_33 WHERE result = "2-1" | sql_create_context |
CREATE TABLE zzmzjzjlb (
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... | 名叫喻英朗的患者他的身高和体重是多少? | SELECT zzmzjzjlb.SG, zzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '喻英朗' UNION SELECT fzzmzjzjlb.SG, fzzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN ... | css |
CREATE TABLE 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,
... | which patients had operations on chordae tendineae? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Chordae tendineae ops" | mimicsql_data |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | tag wiki exerpts longer than 300 characters. | SELECT LENGTH(twe.Body), t.TagName, twe.Body FROM Posts AS twe JOIN Tags AS t ON twe.Id = t.ExcerptPostId WHERE twe.PostTypeId = 4 AND LENGTH(twe.Body) > 300 ORDER BY 1 DESC | sede |
CREATE TABLE table_name_32 (
overall INTEGER,
round VARCHAR,
college VARCHAR
) | What is the average overall value for a round less than 4 associated with the College of Georgia? | SELECT AVG(overall) FROM table_name_32 WHERE round < 4 AND college = "georgia" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayNa... | Total upvote downvote ratio vs reputation. | SELECT SUM(UpVotes), SUM(DownVotes) FROM Users WHERE Reputation >= 100 AND Reputation < 10000 GROUP BY Reputation / 50 * 50 ORDER BY Reputation / 50 * 50 | sede |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | stats about a user's answers. | SELECT OwnerUserId, OwnerDisplayName, Id, PostTypeId, AnswerCount, CommentCount, Score, ViewCount, FavoriteCount FROM Posts WHERE OwnerUserId IN (12960) AND PostTypeId = 1 | sede |
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 item id is 51466 and lab test abnormal status is delta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51466" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | give the minimum age of patients with rash who stayed in the hospital for 14 days. | SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "RASH" AND demographic.days_stay = "14" | mimicsql_data |
CREATE TABLE table_40290 (
"Week of" text,
"Tier" text,
"Winner" text,
"Runner-up" text,
"Semi finalists" text
) | What is the Runner-up with the tier was tier ii, and a Winner of gigi fern ndez natalia zvereva 5 7, 6 1, 6 4? | SELECT "Runner-up" FROM table_40290 WHERE "Tier" = 'tier ii' AND "Winner" = 'gigi fernández natalia zvereva 5–7, 6–1, 6–4' | 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,
... | what is drug type of drug name lidocaine 1%? | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Lidocaine 1%" | mimicsql_data |
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
... | What are the names and average salaries for departments with average salary higher than 42000 Plot them as bar chart, display y axis in descending order. | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC | nvbench |
CREATE TABLE table_58181 (
"Nationality" text,
"Position" text,
"Tottenham Hotspur career" text,
"Club Apps" text,
"Goals" text
) | What is the position of the player from England with 62 goals? | SELECT "Position" FROM table_58181 WHERE "Nationality" = 'england' AND "Goals" = '62' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.