context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_27487712_1 (
result VARCHAR,
district VARCHAR
) | What was the result of the election for georgia's 3rd district? | SELECT result FROM table_27487712_1 WHERE district = "Georgia's 3rd" | 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... | 医院5070509有多少科室在门诊就诊中开出不少于26张检验报告单在2012年3月19日到2015年7月19日期间内? | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '5070509' AND jybgb.BGRQ BETWEEN '2012-03-19' AND '2015-07-19' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 26 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb... | css |
CREATE TABLE table_58674 (
"Place (Posici\u00f3n)" real,
"Team (Equipo)" text,
"Played (PJ)" real,
"Won (PG)" real,
"Draw (PE)" real,
"Lost (PP)" real,
"Goals Scored (GF)" real,
"Goals Conceded (GC)" real,
"+/- (Dif.)" real,
"Points (Pts.)" real
) | What is the total number of pg won of the team with 64 goals conceded and more than 33 goals scored? | SELECT COUNT("Won (PG)") FROM table_58674 WHERE "Goals Conceded (GC)" = '64' AND "Goals Scored (GF)" > '33' | wikisql |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 在哪几次医疗记录中患者彭宏才被开出过金额不低于82.93元的药品?列出医疗就诊编号有哪些? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '彭宏才' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 82.93) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '彭宏才' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 82.93... | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
... | what are the four most commonly ordered procedures for patients who have received vitamin k during the same hospital visit previously since 2100? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'vitam... | eicu |
CREATE TABLE table_35354 (
"Game" real,
"April" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | How many Games have a Score of 3 3 ot? | SELECT COUNT("Game") FROM table_35354 WHERE "Score" = '3–3 ot' | wikisql |
CREATE TABLE table_15565 (
"Rank" real,
"Player" text,
"Club(s)" text,
"Year(s)" text,
"U-16 Caps" real
) | During what years was lvaro p rez the number 2 ranked player? | SELECT "Year(s)" FROM table_15565 WHERE "Rank" = '2' AND "Player" = 'álvaro pérez' | wikisql |
CREATE TABLE table_76588 (
"2006/ 07" text,
"2008/ 09" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
) | What is 2006/07, when 2011/12 is LQ, and when 2010/11 is LQ? | SELECT "2006/ 07" FROM table_76588 WHERE "2011/ 12" = 'lq' AND "2010/ 11" = 'lq' | wikisql |
CREATE TABLE mountain (
Country VARCHAR
) | List the countries that have more than one mountain. | SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1 | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | what is the maximum total hospital cost, that includes head & neck endarter nec in 2105? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'head & neck endarter nec')) AND STRFTIME('%y', cost.charg... | mimic_iii |
CREATE TABLE table_77275 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | What was the score for the game where the home team was Wycombe Wanderers? | SELECT "Score" FROM table_77275 WHERE "Home team" = 'wycombe wanderers' | wikisql |
CREATE TABLE table_204_866 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
) | what is the name on top of the list ? | SELECT "name" FROM table_204_866 WHERE id = 1 | squall |
CREATE TABLE table_40280 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the highest number of people in attendance in the game against the Buffalo Bills in a week later than 14? | SELECT MAX("Attendance") FROM table_40280 WHERE "Opponent" = 'buffalo bills' AND "Week" > '14' | wikisql |
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 gender is m and primary disease is pituitary bleed? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "PITUITARY BLEED" | mimicsql_data |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE author (
authorid i... | How many citation richard anderson has ? | SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'richard anderson' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
... | Return a bar chart on how many counties correspond to each police force?, and could you list by the y axis in descending? | SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_14656147_2 (
attendance VARCHAR,
opponent VARCHAR
) | type the attendance for playing with tampa bay buccaneers? | SELECT attendance FROM table_14656147_2 WHERE opponent = "Tampa Bay Buccaneers" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | when has patient 004-11006 first received a procedure since 2103? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-11006')) AND STRFTIME('%y', treatment.treatmenttime) >= '2103... | eicu |
CREATE TABLE table_2183 (
"No. overall" text,
"No. in series" real,
"Family/families" text,
"Location(s)" text,
"Original air date" text
) | How many series are there total? | SELECT MAX("No. in series") FROM table_2183 | wikisql |
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABL... | What is the relationship between author_tutor_ATB and gender_mf ? | SELECT author_tutor_ATB, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_name_43 (
winning_driver VARCHAR,
circuit VARCHAR
) | Which Winning Driver has a Circuit of circuit zandvoort? | SELECT winning_driver FROM table_name_43 WHERE circuit = "circuit zandvoort" | 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 fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fa... | i need a flight from PHILADELPHIA to DALLAS next wednesday in the morning | 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 = 'DALLAS' AND date_day.day_number = 23 AND date_day.month_number = 4 AND d... | atis |
CREATE TABLE table_name_84 (
engine_code VARCHAR,
displacement__cm³_ VARCHAR,
model_name VARCHAR
) | Which engine has a 2435 cm displacement and is named 2.4 (2001-2007)? | SELECT engine_code FROM table_name_84 WHERE displacement__cm³_ = 2435 AND model_name = "2.4 (2001-2007)" | sql_create_context |
CREATE TABLE table_name_89 (
total VARCHAR,
league INTEGER
) | what is the total when the league is less than 1? | SELECT total FROM table_name_89 WHERE league < 1 | sql_create_context |
CREATE TABLE table_name_2 (
revenue_per_capita VARCHAR,
state VARCHAR
) | What is the Revenue per capita for Vermont? | SELECT revenue_per_capita FROM table_name_2 WHERE state = "vermont" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
... | Top users from Ahmedabad, India. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%ahmedabad, gujarat, india%' OR UPPER(Location) LIKE '%AHMEDABAD, GUJARAT, INDIA%' OR Location LIKE '%Ahmedabad, Gujarat, India%' AND Reputation >= 1000 ORDER BY Reputation DESC | sede |
CREATE TABLE table_75107 (
"Conference" text,
"Division" text,
"Team" text,
"City" text,
"Home Arena" text
) | Which conference is in Portland, Oregon? | SELECT "Conference" FROM table_75107 WHERE "City" = 'portland, oregon' | wikisql |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | During the Fall and Winter term , how many 300 -level classes are you guys offering ? | SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_offering.semester... | advising |
CREATE TABLE table_train_150 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"hiv_infection" bool,
"hepatic_disease" bool,
"liver_disease" bool,
"abnormality" bool,
"triglyceride_tg" float,
"NOUSE" float
) | any relevant abnormality that would interfere with the efficacy or the safety assessments during study treatment administration. | SELECT * FROM table_train_150 WHERE abnormality = 1 | criteria2sql |
CREATE TABLE table_2985987_2 (
date VARCHAR,
race VARCHAR
) | What many times was the victoria derby raced? | SELECT COUNT(date) FROM table_2985987_2 WHERE race = "Victoria Derby" | sql_create_context |
CREATE TABLE table_61870 (
"Club" text,
"Played" 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
) | What is Played, when Points Against is '374'? | SELECT "Played" FROM table_61870 WHERE "Points against" = '374' | wikisql |
CREATE TABLE table_21504 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | In what game did Miami play Charlotte? | SELECT MAX("Game") FROM table_21504 WHERE "Team" = 'Charlotte' | wikisql |
CREATE TABLE table_58016 (
"Election" real,
"Candidate" text,
"Number of votes" text,
"Share of votes" text,
"Outcome of election" text
) | Which candidate lost the election that 770,046 people voted in? | SELECT "Candidate" FROM table_58016 WHERE "Outcome of election" = 'lost' AND "Number of votes" = '770,046' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | A bar chart about what are the average ages for male and female students? | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex | nvbench |
CREATE TABLE table_name_37 (
height INTEGER,
player VARCHAR
) | What is the lowest height for Rans Brempong? | SELECT MIN(height) FROM table_name_37 WHERE player = "rans brempong" | sql_create_context |
CREATE TABLE table_66756 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the country sergio garc a, who has a score of 69-70-67=206, is from? | SELECT "Country" FROM table_66756 WHERE "Score" = '69-70-67=206' AND "Player" = 'sergio garcía' | wikisql |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | since 2105 has nitroglycerin, meropenem or metoprolol tartrate been prescribed to patient 76332? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332) AND prescriptions.drug IN ('nitroglycerin', 'meropenem', 'metoprolol tartrate') AND STRFTIME('%y', prescriptions.startdate) >= '2105' | mimic_iii |
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 users from Minsk, Belarus. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%minsk%' OR UPPER(Location) LIKE '%MINSK%' OR Location LIKE '%Minsk%' AND Reputation >= 1000 ORDER BY Reputation DESC | sede |
CREATE TABLE table_26903 (
"Team" text,
"Slogan" text,
"Match1" real,
"Match2" real,
"Match3" real,
"Match4" real,
"Match5" real,
"Total" real
) | What is the lowest score of all games for match 2? | SELECT MIN("Match2") FROM table_26903 | wikisql |
CREATE TABLE table_name_65 (
irish_name VARCHAR,
province VARCHAR,
county VARCHAR
) | Province of leinster, and a County of fingal has which irish name? | SELECT irish_name FROM table_name_65 WHERE province = "leinster" AND county = "fingal" | sql_create_context |
CREATE TABLE table_14792 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What were the least points with a Coloni FC88 chassis? | SELECT MIN("Points") FROM table_14792 WHERE "Chassis" = 'coloni fc88' | wikisql |
CREATE TABLE table_name_60 (
result VARCHAR,
week VARCHAR,
opponent VARCHAR
) | What is the result when the week is greater than 7 and the Houston Oilers were the opponent? | SELECT result FROM table_name_60 WHERE week > 7 AND opponent = "houston oilers" | sql_create_context |
CREATE TABLE table_name_22 (
name VARCHAR,
delivered VARCHAR
) | What is the name where the delivered date is 1839/08? | SELECT name FROM table_name_22 WHERE delivered = "1839/08" | sql_create_context |
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... | 医疗就诊25516669958中退费结算的结算程序是不是都好了 | SELECT REF_SLT_FLG FROM t_kc24 WHERE MED_CLINIC_ID = '25516669958' | css |
CREATE TABLE table_name_11 (
team VARCHAR
) | Who was the team captain of tus koblenz? | SELECT team AS captain FROM table_name_11 WHERE team = "tus koblenz" | 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... | Return a bar chart about the distribution of All_Road and All_Games_Percent , order from low to high by the total number. | SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent | nvbench |
CREATE TABLE table_64549 (
"Country" text,
"Tourist arrivals (2011) (Millions)" real,
"Tourism receipts (2011) (Millions of US$)" real,
"Tourism receipts (2011) (US$ per arrival)" real,
"Tourism receipts (2011) (US$ per capita)" real,
"Tourism receipts (2003) (as % of GDP)" text,
"Tourism re... | What is the tourism competitiveness in 2011 of venezuela? | SELECT "Tourism competitiveness (2011) (TTCI)" FROM table_64549 WHERE "Country" = 'venezuela' | wikisql |
CREATE TABLE table_33380 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | For the game played at Windy Hill, who was the away team? | SELECT "Away team" FROM table_33380 WHERE "Venue" = 'windy hill' | 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, visualize a bar chart about the distribution of name and revenue , and group by attribute name. | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,... | 患者吕建茗所有检验报告单中的标本采集部位在2008年7月2日到2019年5月18日期间内都是那几个部位? | (SELECT jybgb.BBCJBW 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 j... | css |
CREATE TABLE table_25241 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | What driver achieved a 3:50:12 race time? | SELECT "Driver" FROM table_25241 WHERE "Race Time" = '3:50:12' | wikisql |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
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... | What is the easiest class I can take that will fulfill the ULCS requirement ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... | advising |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | calculate the amount of 7.7meq naacetate patient 7524 has taken on the last icu visit. | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7524) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND inputeve... | mimic_iii |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 共有多少科室在医院4217937的最短医疗住院时长超过3天? | SELECT COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '4217937' GROUP BY MED_ORG_DEPT_CD HAVING MIN(IN_HOSP_DAYS) > 3) AS T | css |
CREATE TABLE table_42194 (
"Name" text,
"Career" text,
"Apps" real,
"Goals" real,
"Average" real
) | What is the average number for goals less than 73? | SELECT COUNT("Average") FROM table_42194 WHERE "Goals" < '73' | wikisql |
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,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescription... | since 10/11/2104 what was patient 1784's last arterial bp mean? | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1784)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial b... | mimic_iii |
CREATE TABLE table_name_59 (
gold INTEGER,
silver VARCHAR,
bronze VARCHAR
) | What is the average Gold when silver is more than 2, and bronze is more than 1 | SELECT AVG(gold) FROM table_name_59 WHERE silver > 2 AND bronze > 1 | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Most popular StackOverflow tags until May 2014. | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS "2014Rank", ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsIn2014, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostI... | sede |
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... | 名叫袁秀筠的患者检测指标634250从09年10月15日到14年10月24日的情况如何? | 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.person_i... | css |
CREATE TABLE table_name_64 (
date VARCHAR,
away_team VARCHAR
) | When was the game that had Sydney Spirit as the away team? | SELECT date FROM table_name_64 WHERE away_team = "sydney spirit" | sql_create_context |
CREATE TABLE table_name_69 (
played INTEGER,
drawn VARCHAR,
lost VARCHAR,
team VARCHAR
) | What is the highest number played with more than 2 lost for Palmeiras and less than 1 draw? | SELECT MAX(played) FROM table_name_69 WHERE lost > 2 AND team = "palmeiras" AND drawn < 1 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | provide the number of patients whose marital status is single and procedure long title is cardiac mapping? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Cardiac mapping" | mimicsql_data |
CREATE TABLE table_59686 (
"Date" text,
"Race" text,
"Track" text,
"Location" text,
"Distance" text,
"Surface" text,
"Purse" text,
"Finish" text
) | What is the Purse on January 3, 2010? | SELECT "Purse" FROM table_59686 WHERE "Date" = 'january 3, 2010' | wikisql |
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
) | Visualize a scatter chart about the correlation between Body_Builder_ID and People_ID . | SELECT Body_Builder_ID, People_ID FROM body_builder | nvbench |
CREATE TABLE table_52921 (
"Animal Name" text,
"Species" text,
"Books" text,
"TV Series" text,
"Gender" text,
"TV Seasons" text,
"Mate" text,
"First Appearance" text,
"Last Appearance" text
) | What are the male Bounder books? | SELECT "Books" FROM table_52921 WHERE "Gender" = 'male' AND "Animal Name" = 'bounder' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | what were the four most common drugs that were prescribed to patients 20s in the same hospital encounter after being diagnosed with congestive heart failure until 2104? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'congestive hear... | 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... | what is the diagnosis icd9 code and diagnosis short title of subject id 43220? | SELECT diagnoses.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "43220" | mimicsql_data |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number... | when did patient 11688 get its last urine microbiology test in 11/last year? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11688) AND microbiologyevents.spec_type_desc = 'urine' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of... | mimic_iii |
CREATE TABLE table_203_610 (
id number,
"institution" text,
"location" text,
"nickname" text,
"founded" number,
"historical affiliation" text,
"enrollment" number,
"primary conference" text
) | which institution has the most enrollment ? | SELECT "institution" FROM table_203_610 ORDER BY "enrollment" DESC LIMIT 1 | squall |
CREATE TABLE table_64274 (
"Model number" text,
"sSpec number" text,
"Cores" text,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part number(s)" text,
... | What is the release price for the GPU frequency of standard power, embedded? | SELECT "Release price ( USD )" FROM table_64274 WHERE "GPU frequency" = 'standard power, embedded' | 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... | 患者凤英发哪些检验报告的结果指标全部正常?看看这些检验报告的单号 | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb 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.JZLSH_MZJZJLB WHERE person_info.XM = '凤... | css |
CREATE TABLE table_204_903 (
id number,
"title" text,
"character" text,
"broadcaster" text,
"episodes" number,
"date" number
) | how many titles have at least 5 episodes ? | SELECT COUNT("title") FROM table_204_903 WHERE "episodes" >= 5 | squall |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | Top 10 Gold Badges users. | SELECT UserId AS "user_link", COUNT(*) FROM Badges WHERE Name IN ('Copy Editor', 'Electorate', 'Famous Question', 'Fanatic', 'Great Answer', 'Great Question', 'Legendary', 'Marshal', 'Populist', 'Publicist', 'Reversal', 'Stellar Question', 'Steward', 'Unsung Hero') GROUP BY UserId ORDER BY COUNT(*) DESC LIMIT 10 | sede |
CREATE TABLE table_15886 (
"Season" real,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text,
"Draft Pick #" text,
"Draft Class" text,
"College" text
) | What college did the Rookie of the Year from the Columbus Crew attend? | SELECT "College" FROM table_15886 WHERE "Team" = 'Columbus Crew' | wikisql |
CREATE TABLE table_204_91 (
id number,
"year" number,
"original title" text,
"english title" text,
"role" text,
"notes" text
) | the most films henrick malberg appeared in in one year . | SELECT COUNT("original title") FROM table_204_91 GROUP BY "year" ORDER BY COUNT("original title") DESC LIMIT 1 | squall |
CREATE TABLE table_name_84 (
surface VARCHAR,
partner VARCHAR
) | Marty Riessen played as a partner during a match with what kind of surface? | SELECT surface FROM table_name_84 WHERE partner = "marty riessen" | sql_create_context |
CREATE TABLE table_202_240 (
id number,
"year" number,
"single" text,
"chart" text,
"position" number
) | how many different charts did run make ? | SELECT COUNT(DISTINCT "chart") FROM table_202_240 WHERE "single" = '"run"' | squall |
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE studen... | Show all the activity names and the number of faculty involved in each activity. | SELECT T1.activity_name, COUNT(*) FROM activity AS T1 JOIN faculty_participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid | spider |
CREATE TABLE table_name_85 (
played INTEGER,
draws VARCHAR,
scored VARCHAR,
position VARCHAR
) | Which Played has a Scored larger than 25 and a Position of 1, and Draws smaller than 5? | SELECT MAX(played) FROM table_name_85 WHERE scored > 25 AND position = 1 AND draws < 5 | sql_create_context |
CREATE TABLE table_name_41 (
player VARCHAR,
position VARCHAR,
caps VARCHAR
) | Which player has a Position of fly-half, and a Caps of 3? | SELECT player FROM table_name_41 WHERE position = "fly-half" AND caps = 3 | sql_create_context |
CREATE TABLE table_25120 (
"Details" text,
"Host Nation(s)" text,
"Final Venue" text,
"Winner" text,
"Result" text,
"Runner-up" text
) | If the winner is Hong Kong 207/6 (47.1 overs), what is the name of the hosting nation? | SELECT "Host Nation(s)" FROM table_25120 WHERE "Winner" = 'Hong Kong 207/6 (47.1 overs)' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
pat... | are respiration of patient 027-214052 last measured on the last intensive care unit visit greater than second to last measured on the last intensive care unit visit? | SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-214052') AND NOT patient.unitdischargetime ... | eicu |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | calculate the duration of patient 010-23252's last hospital stay. | SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '010-23252' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | In Fall 2001 what number of professors will teach ORALSURG 752 ? | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ORALSURG' AND course.number = 752 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o... | advising |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | Which patients were ordered a wbc lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "WBC" | mimicsql_data |
CREATE TABLE table_76055 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the lowest for top-25 with events smaller than 42 in a U.S. Open with a top-10 smaller than 5? | SELECT MIN("Top-25") FROM table_76055 WHERE "Events" < '42' AND "Tournament" = 'u.s. open' AND "Top-10" < '5' | wikisql |
CREATE TABLE fielding_postseason (
player_id text,
year number,
team_id text,
league_id text,
round text,
pos text,
g number,
gs number,
inn_outs number,
po number,
a number,
e number,
dp number,
tp number,
pb number,
sb number,
cs number
)
CREATE TAB... | List the first and last name for players who participated in all star game in 1998. | SELECT name_first, name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE year = 1998 | spider |
CREATE TABLE table_name_75 (
record VARCHAR,
loss VARCHAR
) | What is the record loss of R. Springer? | SELECT record FROM table_name_75 WHERE loss = "r. springer" | sql_create_context |
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
) | Bar chart x axis nominee y axis the total number | SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee | nvbench |
CREATE TABLE table_name_26 (
format VARCHAR,
catalogno VARCHAR
) | Whati s the format for the catalogno of st 491? | SELECT format FROM table_name_26 WHERE catalogno = "st 491" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 从08年5月22日起到08年11月21日患者54662739的所有检验结果指标记录中的检测方法可以提供一下吗? | SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH... | css |
CREATE TABLE table_22412 (
"Country" text,
"Tourist arrivals (2011) (Millions)" text,
"Tourism receipts (2011) (Millions of US$)" real,
"Tourism receipts (2011) (US$ per arrival)" real,
"Tourism receipts (2011) (US$ per capita)" real,
"Tourism receipts (2003) (as % of GDP)" text,
"Tourism re... | Name the tourism receipts 2003 for colombia | SELECT "Tourism receipts (2003) (as % of GDP)" FROM table_22412 WHERE "Country" = 'Colombia' | wikisql |
CREATE TABLE table_15887683_3 (
content VARCHAR,
n° VARCHAR
) | What's the content offered by the package number 204? | SELECT content FROM table_15887683_3 WHERE n° = 204 | sql_create_context |
CREATE TABLE table_23730973_5 (
rating VARCHAR,
viewers__millions_ VARCHAR
) | What was the rating for the episode that had 5.90 million viewers? | SELECT rating FROM table_23730973_5 WHERE viewers__millions_ = "5.90" | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | can you list all flights departing from TORONTO and landing in SAN DIEGO with a stopover in DENVER | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND CITY_2.... | atis |
CREATE TABLE table_53000 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | Who had the decision with boston at home? | SELECT "Decision" FROM table_53000 WHERE "Home" = 'boston' | wikisql |
CREATE TABLE table_name_88 (
date VARCHAR,
label VARCHAR
) | What date is associated with the label Village Records? | SELECT date FROM table_name_88 WHERE label = "village records" | sql_create_context |
CREATE TABLE table_772 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many incumbents were elected in the 1926 election? | SELECT COUNT("Incumbent") FROM table_772 WHERE "First elected" = '1926' | wikisql |
CREATE TABLE table_22794 (
"Year" real,
"Host" text,
"1st Place" text,
"2nd Place" text,
"3rd Place" text,
"4th Place" text,
"5th Place" text
) | What is the total number of 3rd placed teams when the host is University of Manitoba, Winnipeg, Manitoba? | SELECT COUNT("3rd Place") FROM table_22794 WHERE "Host" = 'University of Manitoba, Winnipeg, Manitoba' | wikisql |
CREATE TABLE table_62114 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Score, when Player is 'Vijay Singh'? | SELECT "Score" FROM table_62114 WHERE "Player" = 'vijay singh' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.