context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_18974269_1 (
gender VARCHAR,
original_season VARCHAR
) | What was the gender of the contestant on RR: South Pacific season? | SELECT gender FROM table_18974269_1 WHERE original_season = "RR: South Pacific" | sql_create_context |
CREATE TABLE table_1341577_10 (
party VARCHAR,
result VARCHAR
) | what's party with result being retired to run for u. s. senate republican hold | SELECT party FROM table_1341577_10 WHERE result = "Retired to run for U. S. Senate Republican hold" | sql_create_context |
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge... | Give me a bar chart, that group by location and count them, list Y in descending order. | SELECT Location, COUNT(Location) FROM party GROUP BY Location ORDER BY COUNT(Location) DESC | nvbench |
CREATE TABLE table_34405 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | Which Position has a Player of steve nemeth? | SELECT "Position" FROM table_34405 WHERE "Player" = 'steve nemeth' | wikisql |
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 patient (
uniquep... | let's count the number of times patient 027-41381 has had a cl flush: coated catheter, pressure/power inj ij r intake during the last hospital visit. | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-41381' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.... | eicu |
CREATE TABLE table_name_39 (
host_team VARCHAR,
date VARCHAR
) | What was the name of the host team dated December 16? | SELECT host_team FROM table_name_39 WHERE date = "december 16" | sql_create_context |
CREATE TABLE table_204_330 (
id number,
"finished" text,
"horse" text,
"jockey" text,
"trainer" text,
"owner" text,
"time / behind" text
) | name the horse that finished three spots before outbound . | SELECT "horse" FROM table_204_330 WHERE "finished" = (SELECT "finished" FROM table_204_330 WHERE "horse" = 'outbound') - 3 | squall |
CREATE TABLE table_dev_52 (
"id" int,
"anemia" bool,
"gender" string,
"prediabetes" bool,
"systolic_blood_pressure_sbp" int,
"metabolic_syndrome" bool,
"hemoglobin_a1c_hba1c" float,
"dyslipidemia" bool,
"dsp" int,
"renal_disease" bool,
"hepatic_disease" bool,
"elevated_tr... | dyslipidemia, including triglycerides > 800 mg / dl and ldl > 200 mg / dl | SELECT * FROM table_dev_52 WHERE dyslipidemia = 1 OR (triglyceride_tg > 800 AND ldl > 200) | criteria2sql |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE keyphr... | papers written by emina torlak within the last 10 years | SELECT DISTINCT writes.paperid FROM author, paper, writes WHERE author.authorname = 'emina torlak' AND paper.year >= YEAR(CURDATE()) - 10 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_13805432_2 (
highest_position VARCHAR,
artist VARCHAR
) | what's the highest position with artbeingt being frankie avalon | SELECT highest_position FROM table_13805432_2 WHERE artist = "Frankie Avalon" | sql_create_context |
CREATE TABLE table_30816 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What player was picked by the New York Rangers? | SELECT "Player" FROM table_30816 WHERE "NHL team" = 'New York Rangers' | wikisql |
CREATE TABLE table_name_60 (
left_team VARCHAR,
name VARCHAR
) | Tell me the left team for josh vanlandingham | SELECT left_team FROM table_name_60 WHERE name = "josh vanlandingham" | sql_create_context |
CREATE TABLE table_50556 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What was the overall draft pick of the player who was a db and attended college in iowa? | SELECT "Overall" FROM table_50556 WHERE "College" = 'iowa' AND "Position" = 'db' | wikisql |
CREATE TABLE table_7408 (
"Position" text,
"Name" text,
"Birthdate" text,
"Birthplace" text,
"Team" text
) | What is the Name when the team is the st. paul a.c., with a Birthdate of 3 august 1890? | SELECT "Name" FROM table_7408 WHERE "Team" = 'st. paul a.c.' AND "Birthdate" = '3 august 1890' | wikisql |
CREATE TABLE table_72077 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
) | What school/club team is Trey Johnson on? | SELECT "School/Club Team" FROM table_72077 WHERE "Player" = 'Trey Johnson' | wikisql |
CREATE TABLE table_name_17 (
fa_cup INTEGER,
premier_league VARCHAR,
league_cup VARCHAR,
total VARCHAR
) | What is the lowest FA cup with 1 league cup, less than 12 total and 1 premier league? | SELECT MIN(fa_cup) FROM table_name_17 WHERE league_cup = 1 AND total < 12 AND premier_league = 1 | sql_create_context |
CREATE TABLE table_name_70 (
total INTEGER,
bronze VARCHAR,
nation VARCHAR,
gold VARCHAR,
rank VARCHAR
) | What is the average Total that has a Gold of 0, when the rank is less than 16, the nation is Georgia and there is more than 2 for Bronze? | SELECT AVG(total) FROM table_name_70 WHERE gold = 0 AND rank < 16 AND nation = "georgia" AND bronze > 2 | sql_create_context |
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... | 从2000年9月28日到2007年1月25日这段时间内患者奚霞辉所有检验结果指标记录中的仪器编号以及名称都是啥? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb... | css |
CREATE TABLE STUDENT (
Major VARCHAR,
Sex VARCHAR
) | What are the majors of male (sex is M) students? | SELECT Major FROM STUDENT WHERE Sex = "M" | sql_create_context |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
R... | How many storms occured in each region Visualize by bar chart, sort from high to low by the X-axis. | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY Region_name DESC | nvbench |
CREATE TABLE table_40943 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the highest number of top-25s for events with 0 wins? | SELECT MAX("Top-25") FROM table_40943 WHERE "Wins" < '0' | wikisql |
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
) | Bar graph to show the total number from different team, and list in ascending by the bar. | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY Team | nvbench |
CREATE TABLE table_14655985_1 (
college VARCHAR,
position VARCHAR
) | what's the college with position being placekicker | SELECT college FROM table_14655985_1 WHERE position = "Placekicker" | sql_create_context |
CREATE TABLE table_name_39 (
position VARCHAR,
total_apps VARCHAR
) | Which position has 5 total apps? | SELECT position FROM table_name_39 WHERE total_apps = "5" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | calculate the maximum age of married patients who have angioedema primary disease. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "ANGIOEDEMA" | mimicsql_data |
CREATE TABLE table_22702 (
"Album#" text,
"English Title" text,
"Chinese (Traditional)" text,
"Chinese (Simplified)" text,
"Release date" text,
"Label" text
) | Name the english title for album # 2nd | SELECT "English Title" FROM table_22702 WHERE "Album#" = '2nd' | wikisql |
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 food_service (
meal_code text,
meal_number int,
compartment text,
meal_description... | show me flights from MILWAUKEE to ORLANDO on wednesday night or thursday 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 ((((flight.departure_time <= 2359 AND flight.departure_time >= 1800) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year... | atis |
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Transac... | Return the lot details, group the lot details, and compute the number of each lot details. | SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepi... | what are the five most frequent specimen tests that patients had within 2 months after they had been diagnosed with hyperglycemia - suspected since 1 year ago? | SELECT t3.culturesite FROM (SELECT t2.culturesite, 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 = 'hyperglycemia - suspected' AND DATETIME(diag... | eicu |
CREATE TABLE table_name_5 (
result VARCHAR,
competition VARCHAR
) | What is the result when the competition is 1982 president's cup? | SELECT result FROM table_name_5 WHERE competition = "1982 president's cup" | sql_create_context |
CREATE TABLE table_71704 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the Blue Jays' record when they played the Royals with an attendance larger than 50,522? | SELECT "Record" FROM table_71704 WHERE "Attendance" > '50,522' AND "Opponent" = 'royals' | wikisql |
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 Posts ... | Relevant Python and Java posts in 2020 with information about author. | SELECT p.Title, p.Body, p.CreationDate, p.Id AS "post_link", p.Tags, p.Score, u.AboutMe FROM Posts AS p LEFT JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId IN (1) AND p.CreationDate > '2020-01-01' AND p.CreationDate < '2020-12-31' AND p.Tags LIKE ('%python%') AND p.Score >= 15 AND u.AboutMe != '' ORDER BY p... | sede |
CREATE TABLE table_78066 (
"Theatre" text,
"Current show" text,
"Classification" text,
"Capacity" real,
"Opening date" text,
"Closing date" text
) | What opening date has a capacity of 100? | SELECT "Opening date" FROM table_78066 WHERE "Capacity" = '100' | wikisql |
CREATE TABLE table_name_97 (
venue VARCHAR,
competition VARCHAR
) | What's the venue of the 1995 Southeast Asian Games? | SELECT venue FROM table_name_97 WHERE competition = "1995 southeast asian games" | sql_create_context |
CREATE TABLE table_15417439_1 (
common_name VARCHAR,
accession_number VARCHAR
) | What kind of animal corresponds to the accession number xp_852505.1? | SELECT common_name FROM table_15417439_1 WHERE accession_number = "XP_852505.1" | sql_create_context |
CREATE TABLE table_11323532_2 (
premiere VARCHAR,
languages VARCHAR
) | Which premiere had languages in danish? | SELECT premiere FROM table_11323532_2 WHERE languages = "Danish" | sql_create_context |
CREATE TABLE table_name_24 (
result VARCHAR,
week VARCHAR
) | What is week 15's result? | SELECT result FROM table_name_24 WHERE week = 15 | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 在04年8月25日到2016年7月12日内病患彭天瑞曾在医院就诊的次数有几次? | SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '彭天瑞' AND mzjzjlb.JZKSRQ BETWEEN '2004-08-25' AND '2016-07-12') + (SELECT COUNT(*) FROM person_info J... | css |
CREATE TABLE table_6696 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | Which 2011 has a 2010 of 1r, and a 2009 of 1r? | SELECT "2011" FROM table_6696 WHERE "2010" = '1r' AND "2009" = '1r' | 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... | How many of the patients belonging to black/cape verdean ethnic origin were born before 2080? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.dob_year < "2080" | mimicsql_data |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId numb... | Tag wikis with old PHP links. | SELECT DISTINCT Tags.Id, Tags.TagName, 'site://tags/' + Tags.TagName + '/info|Url' AS Url, LENGTH(Posts.Body) FROM Tags LEFT JOIN Posts ON Posts.Id = Tags.WikiPostId OR Posts.Id = Tags.ExcerptPostId WHERE (LOWER(Posts.Body) LIKE '%http://php.net%' OR LOWER(Posts.Body) LIKE '%http://__.php.net%' OR LOWER(Posts.Body) LIK... | sede |
CREATE TABLE table_43664 (
"Player" text,
"Position" text,
"Round" real,
"Pick" real,
"NFL Club" text
) | What is the NFL club of the cornerback player with a pick greater than 63? | SELECT "NFL Club" FROM table_43664 WHERE "Pick" > '63' AND "Position" = 'cornerback' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | Search by any two keywords, after selected date. | SELECT c.CreationDate, c.Text, c.Id AS "comment_link", c.PostId AS "post_link" FROM Comments AS c WHERE c.CreationDate > '##yyyy##' + '-' + '##mm##' + '-' + '##dd##' + 'T00:00:00.000' AND (Text LIKE '%##SearchOnKeyword1##%' OR Text LIKE '%##SearchOnKeyword2##%') LIMIT 100 | sede |
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,
... | what is maximum age of patients whose marital status is divorced and primary disease is ventricular tachycardia? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA" | mimicsql_data |
CREATE TABLE table_name_72 (
full_professors VARCHAR,
head VARCHAR,
lecturers VARCHAR
) | How many full professors work under Hartmut Kliemt with more than 0 lecturers? | SELECT COUNT(full_professors) FROM table_name_72 WHERE head = "hartmut kliemt" AND lecturers > 0 | sql_create_context |
CREATE TABLE table_203_186 (
id number,
"painter" text,
"composition" number,
"drawing" number,
"color" number,
"expression" number
) | name one of the painters that was last in rank for color . | SELECT "painter" FROM table_203_186 ORDER BY "color" LIMIT 1 | squall |
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... | What upper-level PORTUG courses are available this Spring-Summer ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PORTUG' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spri... | advising |
CREATE TABLE table_28531 (
"Rd." real,
"Grand Prix" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
) | What are all the report for the Belgian Grand Prix? | SELECT "Report" FROM table_28531 WHERE "Grand Prix" = 'Belgian Grand Prix' | wikisql |
CREATE TABLE table_14859 (
"Round" text,
"Track" text,
"Race 1" text,
"Race 2" text,
"Race 3" text
) | What Race 3 is Round 5? | SELECT "Race 3" FROM table_14859 WHERE "Round" = 'round 5' | wikisql |
CREATE TABLE table_32027 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What day was the game that had an attendance of more than 46,551 people and had a week number of less than 4? | SELECT "Date" FROM table_32027 WHERE "Attendance" > '46,551' AND "Week" < '4' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For those employees who did not have any job in the past, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_9526 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | How much is the money ($) when the score is 67-71-72-72=282? | SELECT COUNT("Money ( $ )") FROM table_9526 WHERE "Score" = '67-71-72-72=282' | wikisql |
CREATE TABLE Products (
Product_Price VARCHAR,
Product_Name VARCHAR
) | Show the prices of the products named 'Dining' or 'Trading Policy'. | SELECT Product_Price FROM Products WHERE Product_Name = "Dining" OR Product_Name = "Trading Policy" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | count the number of medicines that were prescribed to patient 012-27355 on the last hospital encounter. | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-27355' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hosp... | eicu |
CREATE TABLE table_71692 (
"Year" real,
"Class" text,
"Vehicle" text,
"Position" text,
"Stages won" text
) | What is the class that that won 2 stages and has a position of DNF? | SELECT "Class" FROM table_71692 WHERE "Stages won" = '2' AND "Position" = 'dnf' | wikisql |
CREATE TABLE table_78962 (
"Date" text,
"Ship Name" text,
"Tonnage" text,
"Ship Type" text,
"Location" text,
"Disposition of Ship" text
) | With a tonnage of 225 what is the ship type? | SELECT "Ship Type" FROM table_78962 WHERE "Tonnage" = '225' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | when had patient 006-10390 first had colostomy output today? | SELECT 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 = '006-10390')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
CREATE TABLE table_7687 (
"Player" text,
"Att." real,
"Yards" real,
"Avg." real,
"Long" real
) | Which Yards has a Long smaller than 3? | SELECT AVG("Yards") FROM table_7687 WHERE "Long" < '3' | wikisql |
CREATE TABLE table_name_1 (
t_wyka VARCHAR,
precincts VARCHAR
) | Name the T. Wyka has a Precincts of 51/55? | SELECT t_wyka FROM table_name_1 WHERE precincts = "51/55" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
la... | count the number of patients who are dead after being diagnosed with copd - no limitations in the same month in 2102. | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'copd - no limitations') AS t1 GROUP BY t1.uniquepid HAVING MIN(t... | eicu |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number... | what is the name of the drug which patient 14467 was prescribed within 2 days after having received a oth extraoc mus-tend op procedure? | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 14467 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ... | mimic_iii |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
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 TABL... | Show me the easiest class available for me to fulfill the Other requirement . | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c... | advising |
CREATE TABLE table_17955 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real
) | What's the name of the county where 48.3% voted for Bush? | SELECT "County" FROM table_17955 WHERE "Bush%" = '48.3%' | wikisql |
CREATE TABLE table_78556 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | Which Losses have a Goal Difference of -16, and less than 8 wins? | SELECT MIN("Losses") FROM table_78556 WHERE "Goal Difference" = '-16' AND "Wins" < '8' | wikisql |
CREATE TABLE table_name_63 (
definition VARCHAR,
rank VARCHAR,
town VARCHAR
) | Which Definition has a Rank smaller than 12, and a Town of tadcaster? | SELECT definition FROM table_name_63 WHERE rank < 12 AND town = "tadcaster" | sql_create_context |
CREATE TABLE table_66252 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Manufacturer" text,
"Serial numbers" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
) | What year made has a Quantity made of 4? | SELECT "Year made" FROM table_66252 WHERE "Quantity made" = '4' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_cour... | Which teachers offer courses that fulfill a Other program requirement ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = course_offering.course_id INN... | advising |
CREATE TABLE table_41702 (
"Album title" text,
"Format" text,
"Year" real,
"Original label" text,
"Chart positions" text
) | The album titled I had what chart positions? | SELECT "Chart positions" FROM table_41702 WHERE "Album title" = 'i' | wikisql |
CREATE TABLE table_name_13 (
region VARCHAR,
label VARCHAR,
catalog VARCHAR
) | What region has the Chrysalis label, and a Catalog of chr 1047? | SELECT region FROM table_name_13 WHERE label = "chrysalis" AND catalog = "chr 1047" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of patients whose admission type is urgent and procedure short title is closed bronchial biopsy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Closed bronchial biopsy" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | specify the admission type of patient with patient id 2560. | SELECT demographic.admission_type FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is the number of patients whose diagnoses long title is mitral valve disorders? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Mitral valve disorders" | mimicsql_data |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
... | What is the number of booking end dates of the apartments with type code 'Duplex' in each year? Return a bar chart, could you show from low to high by the Y-axis? | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE table_24852001_2 (
team_record VARCHAR,
opponent VARCHAR
) | What was the team record after the Frankfurt Galaxy matchup? | SELECT team_record FROM table_24852001_2 WHERE opponent = "Frankfurt Galaxy" | sql_create_context |
CREATE TABLE table_2102782_1 (
broadcast_date VARCHAR,
viewers__in_millions_ VARCHAR
) | Name the broadcast date for 7.4 viewers | SELECT broadcast_date FROM table_2102782_1 WHERE viewers__in_millions_ = "7.4" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId nu... | SELECT nvarch FROM Users. | SELECT MIN(Id) FROM Users | sede |
CREATE TABLE table_name_51 (
bronze INTEGER,
nation VARCHAR
) | How many bronzes have west germany as the nation? | SELECT SUM(bronze) FROM table_name_51 WHERE nation = "west germany" | sql_create_context |
CREATE TABLE table_203_378 (
id number,
"against" text,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"win %" text
) | which country have they played against the most ? | SELECT "against" FROM table_203_378 ORDER BY "played" DESC LIMIT 1 | squall |
CREATE TABLE table_22665117_1 (
county VARCHAR,
district_name VARCHAR
) | If the name of the district is the Charyl Stockwell Academy, what is the county name? | SELECT county FROM table_22665117_1 WHERE district_name = "Charyl Stockwell Academy" | sql_create_context |
CREATE TABLE table_name_51 (
wins INTEGER,
byes VARCHAR,
against VARCHAR,
losses VARCHAR
) | What is the average Wins, when Against is less than 1786, when Losses is less than 4, and when Byes is less than 2? | SELECT AVG(wins) FROM table_name_51 WHERE against < 1786 AND losses < 4 AND byes < 2 | sql_create_context |
CREATE TABLE table_34604 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | after 1987 and entrant of first racing what is the highest points? | SELECT MAX("Points") FROM table_34604 WHERE "Entrant" = 'first racing' AND "Year" > '1987' | wikisql |
CREATE TABLE table_name_47 (
venue VARCHAR,
home_team VARCHAR
) | What venue features collingwood as the home side? | SELECT venue FROM table_name_47 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE table_name_41 (
year VARCHAR,
arena VARCHAR
) | In what year was the competition at the Pepsi Arena? | SELECT year FROM table_name_41 WHERE arena = "pepsi arena" | sql_create_context |
CREATE TABLE table_name_73 (
station VARCHAR,
owned_since VARCHAR,
channel___tv___rf__ VARCHAR
) | What station was owned since 2011, and a channel (tv/rf) of 27? | SELECT station FROM table_name_73 WHERE owned_since = 2011 AND channel___tv___rf__ = "27" | sql_create_context |
CREATE TABLE table_name_1 (
score_in_the_final VARCHAR,
opponents_in_the_final VARCHAR,
outcome VARCHAR,
surface VARCHAR
) | Name the score in the final for runner-up and hard surface with opponents being micha l llodra nenad zimonji | SELECT score_in_the_final FROM table_name_1 WHERE outcome = "runner-up" AND surface = "hard" AND opponents_in_the_final = "michaël llodra nenad zimonjić" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number... | Database integration test: list of votes created before their post. Looks this inconsistency is the result of question merges | SELECT @a | sede |
CREATE TABLE table_name_27 (
coach VARCHAR,
losses VARCHAR
) | Which Notre Dame coach lost 15 games? | SELECT coach FROM table_name_27 WHERE losses = 15 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | what was the drug patient 18457 had been prescribed since 08/2102 two or more times. | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18457) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2102-08' GROUP BY prescriptions.drug) AS t1 WHERE t1.c... | mimic_iii |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | Give me a histogram for how old is each gender, on average? | SELECT gender, AVG(age) FROM Person GROUP BY gender | nvbench |
CREATE TABLE device (
Software_Platform VARCHAR
) | Please show the software platforms of devices in descending order of the count. | SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC | sql_create_context |
CREATE TABLE table_name_87 (
to_par VARCHAR,
player VARCHAR
) | What is the to par of player hunter mahan? | SELECT to_par FROM table_name_87 WHERE player = "hunter mahan" | sql_create_context |
CREATE TABLE table_name_56 (
inductee_s_ VARCHAR,
venue VARCHAR
) | What is the name of the inductee for the ecw arena? | SELECT inductee_s_ FROM table_name_56 WHERE venue = "ecw arena" | sql_create_context |
CREATE TABLE table_name_56 (
matches INTEGER,
year VARCHAR,
wins VARCHAR,
losses VARCHAR
) | What is the number of matches when the wins are less than 8, and losses of 7, in 2011? | SELECT SUM(matches) FROM table_name_56 WHERE wins < 8 AND losses = 7 AND year = "2011" | sql_create_context |
CREATE TABLE table_name_6 (
receptions VARCHAR,
receiving_yards VARCHAR,
rushing_tds VARCHAR
) | How many receptions were smaller than 161 receiving yards but also had less than 14 rushing TDs? | SELECT COUNT(receptions) FROM table_name_6 WHERE receiving_yards < 161 AND rushing_tds < 14 | sql_create_context |
CREATE TABLE table_72866 (
"Fin. Pos" real,
"Car No." real,
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Laps Led" real,
"Points" text
) | Name the team of darren manning | SELECT "Team" FROM table_72866 WHERE "Driver" = 'Darren Manning' | wikisql |
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is text,
rating number,
languages text,
releasedate time,
resolution number
)
CREATE TABLE genre (
g_name text,
rating text,
most_popular_in text
)
CREATE TABLE files (
f_id numbe... | What is the name of the artist, for each language, that has the most songs with a higher resolution than 500? | SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE VoteTypes (
Id number,
Name text
)
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 ReviewT... | Top Questions with answer by tag order by score, poster reputation. | SELECT question.Id AS "post_link", poster.Reputation, question.Tags FROM Posts AS question INNER JOIN Users AS poster ON question.OwnerUserId = poster.Id AND question.Tags LIKE '%##TagName1##%' AND poster.Reputation > '##minreputation:int##' ORDER BY question.Score DESC LIMIT 10 | sede |
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE sta... | List the number of games for each home team and group by away team in a stacked bar chart The x-axis is home team, and I want to list x-axis in descending order. | SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Away_team, Home_team ORDER BY Home_team DESC | nvbench |
CREATE TABLE table_25303 (
"Country" text,
"Type of Protection" text,
"Maximum Term" text,
"PCT route available" text,
"Conversion from Patent Application" text
) | For small patent type of protections, what type of PCT route is available? | SELECT "PCT route available" FROM table_25303 WHERE "Type of Protection" = 'small patent' | wikisql |
CREATE TABLE table_name_55 (
goals_against INTEGER,
played INTEGER
) | What is the average goals against when there are more than 42 played? | SELECT AVG(goals_against) FROM table_name_55 WHERE played > 42 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.