context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_7680 ( "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text )
Who was the Driver, when the Chassis was Bugatti T51, and when the Entrant was Automobiles Ettore Bugatti?
SELECT "Driver" FROM table_7680 WHERE "Chassis" = 'bugatti t51' AND "Entrant" = 'automobiles ettore bugatti'
wikisql
CREATE TABLE table_46542 ( "Wicket" text, "Runs" real, "Batting partners" text, "Batting team" text, "Fielding team" text, "Venue" text, "Season" text )
What venue did mahela jayawardene and thilan samaraweera play at?
SELECT "Venue" FROM table_46542 WHERE "Batting partners" = 'mahela jayawardene and thilan samaraweera'
wikisql
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area...
List the grape and winery of the wines whose price is bigger than 100, the x-axis is winery and group the grape, and y-axis is the number of wineries, order x axis in asc order.
SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Grape, Winery ORDER BY Winery
nvbench
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
Return a bar chart on how many rooms have king beds? Report the number for each decor type, could you list x-axis from high to low order?
SELECT decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor ORDER BY decor DESC
nvbench
CREATE TABLE table_2781227_2 ( player VARCHAR, nhl_team VARCHAR )
What player belongs to the Chicago Blackhawks?
SELECT player FROM table_2781227_2 WHERE nhl_team = "Chicago Blackhawks"
sql_create_context
CREATE TABLE table_10205 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who played a home game at Princes Park with a crowd larger than 14,150?
SELECT "Home team" FROM table_10205 WHERE "Crowd" > '14,150' AND "Venue" = 'princes park'
wikisql
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...
89956655081的患者卡号以及卡类型在门诊就诊里分别是什么?
SELECT wdmzjzjlb.KH, wdmzjzjlb.KLX FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '89956655081' UNION SELECT bdmzjzjlb.KH, bdmzjzjlb.KLX FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '89956655081'
css
CREATE TABLE table_31724 ( "Number" real, "Origin" text, "Final destination" text, "Frequency" text, "Distance" text )
What is the frequency of number 161?
SELECT "Frequency" FROM table_31724 WHERE "Number" = '161'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid tex...
has patient 009-5001 been having any allergy this month?
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001')) AND DATETIME(allergy.allergytime, 'start of month') = DATETIME(CURRE...
eicu
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS va...
Group and count the city attribute of the location table to visualize a bar chart, rank by the how many city in desc.
SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY ORDER BY COUNT(CITY) DESC
nvbench
CREATE TABLE courses ( course_id text, course_name text, course_description text, other_details text ) CREATE TABLE candidates ( candidate_id number, candidate_details text ) CREATE TABLE students ( student_id number, student_details text ) CREATE TABLE people ( person_id number, ...
What are the cell phone numbers of the candidates that received an assessment code of 'Fail'?
SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = "Fail"
spider
CREATE TABLE table_204_707 ( id number, "year" number, "english title" text, "chinese title" text, "director" text, "role" text )
what was the next movie zhao dan starred in after crossroads ?
SELECT "english title" FROM table_204_707 WHERE "year" > (SELECT "year" FROM table_204_707 WHERE "english title" = 'crossroads') ORDER BY "year" LIMIT 1
squall
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...
名为任凌霜的病人有哪些检验报告单的检验结果指标均正常?列出这些检验报告的单号
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_19576091_1 ( venue VARCHAR, date VARCHAR )
How many venues were there for the match on November 6?
SELECT COUNT(venue) FROM table_19576091_1 WHERE date = "November 6"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE food_service ( mea...
what flights from ATLANTA to ST. LOUIS on tuesday arriving around 230pm
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.arrival_time <= 1500 AND flight.arrival_time >= 1400) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 19...
atis
CREATE TABLE sqlite_sequence ( name any, seq any ) CREATE TABLE albums ( id INTEGER, title VARCHAR(160), artist_id INTEGER ) CREATE TABLE tracks ( id INTEGER, name VARCHAR(200), album_id INTEGER, media_type_id INTEGER, genre_id INTEGER, composer VARCHAR(220), millisecon...
A bar chart for listing the number of the name of all playlist.
SELECT name, COUNT(name) FROM playlists GROUP BY name
nvbench
CREATE TABLE table_name_53 ( affiliation VARCHAR, nickname VARCHAR )
Who is affiliated with the nickname Ramblers?
SELECT affiliation FROM table_name_53 WHERE nickname = "ramblers"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CRE...
Answered and closed, no time limit.
SELECT COUNT(p.Id) FROM Posts AS p, PostHistory AS ph WHERE p.PostTypeId = 1 AND ph.PostHistoryTypeId = 10 AND NOT p.AcceptedAnswerId IS NULL AND p.Id = ph.PostId AND p.Score > 0
sede
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
how many patients underwent analgesics - non-narcotic analgesic within 2 months after having been diagnosed with pneumonia?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON tre...
eicu
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
has since 07/16/2102 been the heart rate of patient 27836 been normal?
SELECT COUNT(*) > 0 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 = 27836)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d...
mimic_iii
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
did patient 021-32860 receive any surgical procedures during the previous year?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-32860')) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETI...
eicu
CREATE TABLE table_name_16 ( tuesday VARCHAR, series VARCHAR )
Which Tuesday does big brother 12 air?
SELECT tuesday FROM table_name_16 WHERE series = "big brother 12"
sql_create_context
CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city...
What type has the most games?
SELECT gtype FROM video_games GROUP BY gtype ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, ...
How many activities does Mark Giuliano participate in?
SELECT COUNT(*) FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano"
spider
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...
患者戚嘉荣在零九年二月一日到二一年十一月二十六日的时间里买西药的次数一共有多少
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '戚嘉荣' AND t_kc22.STA_DATE BETWEEN '2009-02-01' AND '2021-11-26' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_77600 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which home team played the Away team from Richmond?
SELECT "Home team" FROM table_77600 WHERE "Away team" = 'richmond'
wikisql
CREATE TABLE table_64810 ( "Class" text, "Railway number(s)" text, "DRG number(s)" text, "Quantity" real, "Year(s) of manufacture" text, "Axle arrangement ( UIC ) Bauart" text )
Which railway number has 3 quantity?
SELECT "Railway number(s)" FROM table_64810 WHERE "Quantity" = '3'
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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
from KANSAS CITY to SALT LAKE CITY on DL arrive around 8pm tomorrow
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.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 20 AND d...
atis
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 treatment ( treatmentid...
in 09/this year has patient 028-55868 received any medication?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-55868')) AND DATETIME(medication.drugstarttime, 'start of year') = DAT...
eicu
CREATE TABLE table_23902 ( "Central-Southern Calabrian" text, "Phonetic Greek" text, "Italian" text, "French" text, "English" text )
How many Phonetic Greek words translate to grenouille in French?
SELECT COUNT("Phonetic Greek") FROM table_23902 WHERE "French" = 'grenouille'
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...
for the last time in 2101, when did patient 027-186593 get admitted via operating room to the hospital?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '027-186593' AND patient.hospitaladmitsource = 'operating room' AND STRFTIME('%y', patient.hospitaladmittime) = '2101' ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE table_name_17 ( award_description_s_ VARCHAR, year VARCHAR )
List the Award Descriptions for the year of 1989.
SELECT award_description_s_ FROM table_name_17 WHERE year = 1989
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
what is the maximum cost of a hospital that involves a drug named acetaminophen w/codeine until 2 years ago?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'acetaminophen w/codeine') AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_14040 ( "Award" text, "Organization" text, "Work" text, "Category" text, "Result" text )
What was the Best Feature Film at the Macabro Film Festival?
SELECT "Result" FROM table_14040 WHERE "Award" = 'best feature film' AND "Organization" = 'macabro film festival'
wikisql
CREATE TABLE table_47739 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the most draws when goals against are more than 33, losses are 13 and goals for is less than 51?
SELECT MAX("Draws") FROM table_47739 WHERE "Goals against" > '33' AND "Losses" = '13' AND "Goals for" < '51'
wikisql
CREATE TABLE table_name_29 ( unit VARCHAR, location VARCHAR )
What unit is in Mongolia?
SELECT unit FROM table_name_29 WHERE location = "mongolia"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
count the number of patients with abdominal abscess primary disease who had long term care hospital discharge.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND demographic.diagnosis = "ABDOMINAL ABSCESS"
mimicsql_data
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requi...
Goulbourne teaches what upper level courses ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.ins...
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
count the number of patients whose diagnoses short title is pneumococcal pneumonia and drug route is po/ng?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Pneumococcal pneumonia" AND prescriptions.route = "PO/NG"
mimicsql_data
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...
患者云昂雄在二0一0年八月十日到二0一一年十二月十二日期间,刷医保的统筹基金的总额有多少
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '云昂雄' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-08-10' AND '2011-12-12'
css
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE airline ( airline_code varc...
flight from ONTARIO to ORLANDO that departs 9 hours before arriving
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND flight.time_elapsed = 540 AND flight.to_airport = AIRPORT_SERVICE_1.airport_...
atis
CREATE TABLE table_24403 ( "Team name" text, "Races" real, "Won" real, "RR1 Pts." real, "RR2 Pts." real, "RR3 Pts." real, "RR4 Pts." text, "Total Pts." real, "Ranking" real )
When 70 is the total points what is the rr4 points?
SELECT "RR4 Pts." FROM table_24403 WHERE "Total Pts." = '70'
wikisql
CREATE TABLE table_name_63 ( attendance INTEGER, week VARCHAR )
What was average attendance during week 15?
SELECT AVG(attendance) FROM table_name_63 WHERE week = 15
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在2013年8月20日到2016年5月24日期间病患金新翰在医疗机构3186559做过的检查有多少次?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '金新翰' AND t_kc22.STA_DATE BETWEEN '2013-08-20' AND '2016-05-24' AND t_kc21.MED_SER_ORG_NO = '3186559' AND t_kc22.MED_INV_ITEM...
css
CREATE TABLE table_23995075_2 ( confederation VARCHAR, remaining_places_in_finals VARCHAR )
What is the confederation when there are 4 places remaining in the finals?
SELECT confederation FROM table_23995075_2 WHERE remaining_places_in_finals = "4"
sql_create_context
CREATE TABLE table_27529 ( "June 10-11" text, "March 27-29" text, "January 15-16" text, "November 3" text, "August 21-22" text )
How many solar eclipse during August 21-22 where June 10-11 on June 11, 1983?
SELECT COUNT("August 21-22") FROM table_27529 WHERE "June 10-11" = 'June 11, 1983'
wikisql
CREATE TABLE table_2668254_8 ( district VARCHAR, incumbent VARCHAR )
In what district was the incumbent Charles A. Wickliffe?
SELECT district FROM table_2668254_8 WHERE incumbent = "Charles A. Wickliffe"
sql_create_context
CREATE TABLE table_name_91 ( november INTEGER, record VARCHAR )
What day in November has a record of 15-6-1?
SELECT AVG(november) FROM table_name_91 WHERE record = "15-6-1"
sql_create_context
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, ...
how many patients are diagnosed with primary disease femoral artery thrombosis and are born before 2110?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" AND demographic.dob_year < "2110"
mimicsql_data
CREATE TABLE table_14342480_15 ( points INTEGER, player VARCHAR )
How many points did Duncan Thompson score?
SELECT MAX(points) FROM table_14342480_15 WHERE player = "Duncan Thompson"
sql_create_context
CREATE TABLE table_5567 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text )
What school is located in rossville?
SELECT "School" FROM table_5567 WHERE "Location" = 'rossville'
wikisql
CREATE TABLE table_name_35 ( res VARCHAR, record VARCHAR )
Which res has a Record of 3-0?
SELECT res FROM table_name_35 WHERE record = "3-0"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and price , and group by attribute founder, show by the Y-axis in desc.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Price DESC
nvbench
CREATE TABLE table_70701 ( "Model" text, "Floating point" text, "Decimal" text, "Byte string" text, "Memory map" text, "Max memory (kwords)" real )
When a Sigma 7 has a standard byte string, what is the value for the decimal?
SELECT "Decimal" FROM table_70701 WHERE "Byte string" = 'standard' AND "Model" = 'sigma 7'
wikisql
CREATE TABLE table_name_1 ( height VARCHAR, position VARCHAR, current_club VARCHAR )
What is the height of the Forward who currently plays for the Toronto Raptors?
SELECT height FROM table_name_1 WHERE position = "forward" AND current_club = "toronto raptors"
sql_create_context
CREATE TABLE table_name_4 ( year INTEGER, points VARCHAR, team VARCHAR, engine VARCHAR )
What is the total year with a Team of scuderia ferrari, an Engine of ferrari 106 2.5 l4, and more than 12 points?
SELECT SUM(year) FROM table_name_4 WHERE team = "scuderia ferrari" AND engine = "ferrari 106 2.5 l4" AND points > 12
sql_create_context
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advis...
How many clubs does the student named 'Eric Tai' belong to?
SELECT COUNT(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Eric" AND t3.lname = "Tai"
spider
CREATE TABLE table_60231 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text )
What is Party, when District is 'Tennessee 8'?
SELECT "Party" FROM table_60231 WHERE "District" = 'tennessee 8'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
how many patients have received ct scan - pelvis this year within 2 months after the diagnosis of nutritional deficiency?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'nutritional deficiency' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 's...
eicu
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
count how many hospital visits patient 87936 has in 2105.
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 87936 AND STRFTIME('%y', admissions.admittime) = '2105'
mimic_iii
CREATE TABLE table_name_46 ( type VARCHAR, works_number VARCHAR, number VARCHAR, date VARCHAR, builder VARCHAR )
Which Type has a Date smaller than 1943, and a Builder of alco schenectady, and a Number larger than 822, and Works number of 59867?
SELECT type FROM table_name_46 WHERE date < 1943 AND builder = "alco schenectady" AND number > 822 AND works_number = 59867
sql_create_context
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, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
Use a histogram to show the department's id and corresponding employees' first name, and order x axis in ascending order please.
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees ORDER BY FIRST_NAME
nvbench
CREATE TABLE table_name_5 ( season VARCHAR, coach VARCHAR )
How many seasons did coach steve fisher have?
SELECT COUNT(season) FROM table_name_5 WHERE coach = "steve fisher"
sql_create_context
CREATE TABLE table_33620 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text )
What is the highest overall number for someone from round 16?
SELECT MAX("Overall") FROM table_33620 WHERE "Round" = '16'
wikisql
CREATE TABLE table_21710 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What's the part 3 of the verb in class 5?
SELECT "Part 3" FROM table_21710 WHERE "Class" = '5'
wikisql
CREATE TABLE table_name_59 ( tournament VARCHAR, opponent VARCHAR )
What tournament has an opponent jung jae-sung lee yong-dae?
SELECT tournament FROM table_name_59 WHERE opponent = "jung jae-sung lee yong-dae"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
what are the five most commonly given microbiology tests for patients who previously received flexible sigmoidoscopy during the same month until 2104?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_name_89 ( rank INTEGER, carriers VARCHAR, passengers VARCHAR )
What is the lowest rank for China Eastern Airlines, Korean Air with more passengers than 97,055?
SELECT MIN(rank) FROM table_name_89 WHERE carriers = "china eastern airlines, korean air" AND passengers > 97 OFFSET 055
sql_create_context
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...
24030773的团伙成员最常去的几家医院的排序看一下
SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '24030773' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '24030773' GROUP BY fgwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC
css
CREATE TABLE table_name_70 ( nationality VARCHAR, time VARCHAR, athlete VARCHAR )
What's the nationality of Ray norton with a time of 20.6?
SELECT nationality FROM table_name_70 WHERE time = "20.6" AND athlete = "ray norton"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
give the number of patients diagnosed with ulcer of heel and midfoot and drug type is base.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Ulcer of heel & midfoot" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_name_88 ( rider VARCHAR, rounds VARCHAR, constructor VARCHAR, team VARCHAR )
Who is the rider of Scot Racing team with a Honda constructor and rounds 6-17?
SELECT rider FROM table_name_88 WHERE constructor = "honda" AND team = "scot racing team" AND rounds = "6-17"
sql_create_context
CREATE TABLE table_31605 ( "Year" real, "Team/Chassis" text, "Engine" text, "Tyres" text, "Points" real )
What engine was used after 1984?
SELECT "Engine" FROM table_31605 WHERE "Year" > '1984'
wikisql
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text )
Draw a pie chart to show the proportion of acceptance result.
SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
39632855563的检验报告单是由那个机构报告的,报告机构的代码及名称是什么
SELECT jybgb.BGJGDM, jybgb.BGJGMC FROM jybgb WHERE jybgb.BGDH = '39632855563'
css
CREATE TABLE table_28598 ( "Location" text, "Date" real, "Denomination" text, "Coinage metal" text, "Mintage" real, "KM number" text )
What is the coinage metal for a location of Fribourg and denomination of 00005 5 Francs?
SELECT "Coinage metal" FROM table_28598 WHERE "Location" = 'Fribourg' AND "Denomination" = '00005 5 francs'
wikisql
CREATE TABLE table_56354 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
I want the constructor for grid less than 20 and Laps of 6
SELECT "Constructor" FROM table_56354 WHERE "Grid" < '20' AND "Laps" = '6'
wikisql
CREATE TABLE table_62703 ( "Season" real, "Winners" text, "Runners-up" text, "Third-place" text, "fourth-placed" text, "Number of clubs" real )
What is the number of clubs before 2003 with a 4th place winner of Shenzhen Jianlibao?
SELECT AVG("Number of clubs") FROM table_62703 WHERE "fourth-placed" = 'shenzhen jianlibao' AND "Season" < '2003'
wikisql
CREATE TABLE table_69021 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
How many people were in attendance in a week over 4 on December 6, 1981?
SELECT COUNT("Attendance") FROM table_69021 WHERE "Week" > '4' AND "Date" = 'december 6, 1981'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
I need to know when 145 and 630 will be as I need to get going by 5:00 P.M. if I want to be to work on time .
SELECT DISTINCT course_offering.end_time, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'department0' AND (course.number = 145 OR course.number = 630) AND course_offeri...
advising
CREATE TABLE table_name_41 ( speed VARCHAR, rider VARCHAR )
Name the speed for andy reynolds
SELECT speed FROM table_name_41 WHERE rider = "andy reynolds"
sql_create_context
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 three most frequently ordered microbiology tests for patients who have previously received sedative agent - lorazepam within 2 months until 2 years ago?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'sedative agent - lorazepam' AND DATETIME(tre...
eicu
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLS...
门诊给患者韩奇正诊断为疾病Z28.586,那检测指标609254的结果定量及其单位是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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...
css
CREATE TABLE table_name_71 ( party VARCHAR, results_2004 VARCHAR )
Who had 0.00% in 2004?
SELECT party FROM table_name_71 WHERE results_2004 = "0.00%"
sql_create_context
CREATE TABLE table_69986 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
What was the record during the loss by key (7-11)?
SELECT "Record" FROM table_69986 WHERE "Loss" = 'key (7-11)'
wikisql
CREATE TABLE table_224794_3 ( vacator VARCHAR, district VARCHAR )
How many vacators were in the Pennsylvania 33rd district?
SELECT COUNT(vacator) FROM table_224794_3 WHERE district = "Pennsylvania 33rd"
sql_create_context
CREATE TABLE table_79673 ( "Rank" real, "Name" text, "Tenure" text, "Leagues" text, "Attempts" real, "Completions" real, "Comp %" real, "Touchdowns" real, "Interceptions" real, "Yardage" real, "QB Rating" real )
What is the comp percentage when there are less than 44,611 in yardage, more than 254 touchdowns, and rank larger than 24?
SELECT MIN("Comp %") FROM table_79673 WHERE "Yardage" < '44,611' AND "Touchdowns" > '254' AND "Rank" > '24'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE restriction ( restriction_c...
show me the cheapest flights round trip from NEW YORK to SAN JOSE arriving in SAN JOSE before 1900
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, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN JOSE' AND flight.arrival_time < 1900 AND flight.to_airport = AIRP...
atis
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give the number of patients with elective admission type whose lab test fluid is pleural.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_name_12 ( team__number1 VARCHAR, team__number2 VARCHAR )
with team #2 as akasvayu girona what is team #1?
SELECT team__number1 FROM table_name_12 WHERE team__number2 = "akasvayu girona"
sql_create_context
CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) 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...
Give me a bar chart for the total number of each dept name
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name
nvbench
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...
when had patient 035-20156 come to the hospital for the first time the previous year via direct admit?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '035-20156' AND patient.hospitaladmitsource = 'direct admit' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.hospitaladmittime LIMIT 1
eicu
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 ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
among patients who had a hospital stay for more than 29 days, how many of them had a test for red blood cells by lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "29" AND lab.label = "Red Blood Cells"
mimicsql_data
CREATE TABLE table_27332 ( "Episode No." text, "Prod No." real, "Title" text, "Directed by" text, "Written by" text, "Original airdate UK" text )
What is the production number of 3-04?
SELECT MAX("Prod No.") FROM table_27332 WHERE "Episode No." = '3-04'
wikisql
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 courses provide one / you with 2 credits ?
SELECT DISTINCT name, number FROM course WHERE credits = 2 AND department = 'EECS'
advising
CREATE TABLE table_name_66 ( score VARCHAR, outcome VARCHAR, date VARCHAR )
Which Score has aN Outcome of winner on 4 november 1990?
SELECT score FROM table_name_66 WHERE outcome = "winner" AND date = "4 november 1990"
sql_create_context
CREATE TABLE table_42390 ( "Year" real, "Result" real, "World Rank" text, "Location" text, "Date" text )
When was Steve Williams in Zurich and his result was 10.07?
SELECT "Date" FROM table_42390 WHERE "Location" = 'zurich' AND "Result" = '10.07'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmoun...
Top Answerers for Tag: score = number of answers with score >= x.
SELECT P.OwnerUserId AS "user_link", SUM(CASE WHEN P.Score < @LowerBound THEN 0 ELSE 1 END) AS "TotalScore", COUNT(*) AS "#Answers" FROM Posts AS P INNER JOIN PostTags AS PT ON PT.PostId = P.ParentId INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE T.TagName = '##TagName##' AND NOT P.OwnerUserId IS NULL GROUP BY P.OwnerUs...
sede
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 Apartment_Facilities ( apt_id I...
What is the number of start date of each apartment booking for each year? Return a bar chart, and order in asc by the how many booking start date.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id ORDER BY COUNT(booking_start_date)
nvbench
CREATE TABLE table_2175685_1 ( team VARCHAR, race_time VARCHAR )
What team won when the race time was 3:12:30?
SELECT team FROM table_2175685_1 WHERE race_time = "3:12:30"
sql_create_context