context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_39729 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
How many entrants have a mercedes fo 108w 2.4l v8 engine and over 0 points?
SELECT COUNT("Year") FROM table_39729 WHERE "Engine" = 'mercedes fo 108w 2.4l v8' AND "Points" > '0'
wikisql
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 ) ...
count the number of patients whose admission year is less than 2174?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2174"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give the admission type and drug type of subject id 2560.
SELECT demographic.admission_type, prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_48 ( build_date INTEGER, disposal VARCHAR )
Which railway had the earliest build date and a disposal of 'Scrapped 1941?
SELECT MIN(build_date) FROM table_name_48 WHERE disposal = "scrapped 1941"
sql_create_context
CREATE TABLE table_43949 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which Round has a Pick larger than 1?
SELECT SUM("Round") FROM table_43949 WHERE "Pick" > '1'
wikisql
CREATE TABLE table_56546 ( "Round" text, "Player" text, "Position" text, "Team" text, "College" text )
Who plays for sam houston state?
SELECT "Player" FROM table_56546 WHERE "College" = 'sam houston state'
wikisql
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_req...
give me all the flights from MEMPHIS to CHARLOTTE
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MEMPHIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLO...
atis
CREATE TABLE table_2562572_26 ( population__2011_ VARCHAR, cyrillic_name_other_names VARCHAR )
What is the population in (croatian: stari ednik)?
SELECT population__2011_ FROM table_2562572_26 WHERE cyrillic_name_other_names = "Стари Жедник (Croatian: Stari Žednik)"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_...
i would like to fly from BOSTON to DENVER early 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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
atis
CREATE TABLE table_name_53 ( draws VARCHAR, played INTEGER )
What is the number of draws when played is less than 38?
SELECT COUNT(draws) FROM table_name_53 WHERE played < 38
sql_create_context
CREATE TABLE table_79789 ( "Call sign" text, "Frequency" text, "City of license" text, "Facility ID" real, "ERP / Power W" real, "Height m ( ft )" text, "Class" text, "FCC info" text )
What city has the A Class licence?
SELECT "City of license" FROM table_79789 WHERE "Class" = 'a'
wikisql
CREATE TABLE table_204_317 ( id number, "metropolitan area" text, "country" text, "rank" number, "forstall\n2003 est." number, "official population" number, "year" number )
which areas had a population of more than 10,000,000 but less than 20,000,000 ?
SELECT "metropolitan area" FROM table_204_317 WHERE "official population" > 10000000 AND "official population" < 20000000
squall
CREATE TABLE table_47657 ( "Nat." text, "Name" text, "Since" text, "Goals" real, "Ends" text, "Transfer fee" text )
What is Name, when Goals is greater than 14, and when Transfer Fee is 'Youth System'?
SELECT "Name" FROM table_47657 WHERE "Goals" > '14' AND "Transfer fee" = 'youth system'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is the number of patients diagnosed with candidiasis of mouth who were admitted before 2174?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2174" AND diagnoses.short_title = "Thrush"
mimicsql_data
CREATE TABLE table_23408 ( "Season" text, "Player" text, "Junior college" text, "State" text, "Position" text, "Class" text, "University" text )
in which class was the ohio state university
SELECT "Class" FROM table_23408 WHERE "University" = 'Ohio State'
wikisql
CREATE TABLE table_60923 ( "Name a" text, "Country" text, "Office" text, "Mandate start" text, "Mandate end" text, "Term length" text )
When did Prime Minister Agathe Uwilingiyimana's mandate end?
SELECT "Mandate end" FROM table_60923 WHERE "Office" = 'prime minister' AND "Name a" = 'agathe uwilingiyimana'
wikisql
CREATE TABLE table_203_116 ( id number, "no." number, "player" text, "birth date" text, "weight" number, "height" number, "position" text, "current club" text )
which player is taller than andri agantis ?
SELECT "player" FROM table_203_116 WHERE "height" > (SELECT "height" FROM table_203_116 WHERE "player" = 'andri aganits')
squall
CREATE TABLE table_203_710 ( id number, "genre" text, "year" number, "title" text, "episode" text, "role" text, "notes" text )
the movie after the ref
SELECT "title" FROM table_203_710 WHERE id = (SELECT id FROM table_203_710 WHERE "title" = 'the ref') + 1
squall
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,...
在2010年12月15日到2018-年5月30日这期间患者76284316总共检查了几次?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '76284316' AND t_kc22.STA_DATE BETWEEN '2010-12-15' AND '2018-05-30' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_203_254 ( id number, "position" number, "team" text, "points" number, "played" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "difference" number )
who scored the least amount of points ?
SELECT "team" FROM table_203_254 ORDER BY "points" LIMIT 1
squall
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 allergy ( allergy...
since 2105, what are the four common diagnoses for patients with age 60 or above?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105' GROUP BY diagnosis.diagnosisnam...
eicu
CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15...
Show project ids and the number of documents in each project in a scatter chart
SELECT Project_ID, COUNT(*) FROM Documents GROUP BY Project_ID
nvbench
CREATE TABLE table_24195232_1 ( location VARCHAR, team_name VARCHAR )
What was the location for the team name of patriots?
SELECT location FROM table_24195232_1 WHERE team_name = "Patriots"
sql_create_context
CREATE TABLE drivers ( driverId INTEGER, driverRef TEXT, number TEXT, code TEXT, forename TEXT, surname TEXT, dob TEXT, nationality TEXT, url TEXT ) CREATE TABLE driverStandings ( driverStandingsId INTEGER, raceId INTEGER, driverId INTEGER, points REAL, position ...
A pie chart for finding the number of the names of Japanese constructors that have once earned more than 5 points?
SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name
nvbench
CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity numbe...
What are the first and last names of all students who are living in a dorm with a TV Lounge?
SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')
spider
CREATE TABLE table_22669044_10 ( score VARCHAR, record VARCHAR )
What's the score of the game with 31-29 record?
SELECT score FROM table_22669044_10 WHERE record = "31-29"
sql_create_context
CREATE TABLE table_name_62 ( county VARCHAR, location VARCHAR )
What is the county of the bridge in Boulder?
SELECT county FROM table_name_62 WHERE location = "boulder"
sql_create_context
CREATE TABLE table_25968 ( "Year" real, "Host City" text, "Host School" text, "Champion" text, "Second Place" text, "Third Place" text )
Who came in second place when the champion was south dakota school of mines & technology?
SELECT "Second Place" FROM table_25968 WHERE "Champion" = 'South Dakota School of Mines & Technology'
wikisql
CREATE TABLE table_name_81 ( links VARCHAR, flight_day VARCHAR )
What links were used on flight day 16?
SELECT links FROM table_name_81 WHERE flight_day = "day 16"
sql_create_context
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, ...
Where does Peter Mertens publish ?
SELECT DISTINCT paper.journalid, venue.venueid FROM author, paper, venue, writes WHERE author.authorname = 'Peter Mertens' AND venue.venueid = paper.venueid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
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...
医疗就诊43665866915在其出院时经过诊断的疾病它编号以及其名称分别是什么?
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '43665866915' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '43665866915' UNION SELECT zyb.OUT_DIAG_DIS_CD, zyb.OUT_DIAG_DIS_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '43665866915' UNION SELECT mzb....
css
CREATE TABLE table_name_40 ( integrated VARCHAR, allied_related VARCHAR )
Which integrated has an allied-related of some shared?
SELECT integrated FROM table_name_40 WHERE allied_related = "some shared"
sql_create_context
CREATE TABLE table_55977 ( "School" text, "Location" text, "Enrolment" real, "Founded" real, "Denomination" text, "Boys/Girls" text, "Day/Boarding" text, "School Colors" text )
What is the low enrolment for schools founded after 1995?
SELECT MIN("Enrolment") FROM table_55977 WHERE "Founded" > '1995'
wikisql
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(...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the first_name by a bar chart.
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_53220 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest gold medals of a rank 12 team?
SELECT MIN("Gold") FROM table_53220 WHERE "Rank" = '12'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
what is the number of patients whose primary disease is st-segment elevation myocardial infarction\cardiac cath and drug route is iv bolus?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE table_63921 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real )
what is the average losses when the club is warrnambool and wins is less than 12?
SELECT AVG("Losses") FROM table_63921 WHERE "Club" = 'warrnambool' AND "Wins" < '12'
wikisql
CREATE TABLE table_name_92 ( player VARCHAR, position VARCHAR, club_province VARCHAR )
Which Player has a Position of number 8, and a Club/province of scarlets?
SELECT player FROM table_name_92 WHERE position = "number 8" AND club_province = "scarlets"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALA...
Show employee_id from each email, could you show x axis in ascending order?
SELECT EMAIL, EMPLOYEE_ID FROM employees ORDER BY EMAIL
nvbench
CREATE TABLE table_18038 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
How many times during the season were the seahawks 8-6?
SELECT COUNT("Result") FROM table_18038 WHERE "Record" = '8-6'
wikisql
CREATE TABLE table_23866 ( "Party" text, "Seats Contested" real, "Seats Won" real, "No. of Votes" real, "% of Votes" text, "% in Seats contested" text, "Seats Forfeited" real, "2003 Seats" real )
How many seats were forfeited in the revolutionary socialist party?
SELECT COUNT("Seats Forfeited") FROM table_23866 WHERE "Party" = 'Revolutionary Socialist Party'
wikisql
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TAB...
show me the flights from OAKLAND to DENVER
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
atis
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
has patient 005-48105 had any surgeries on this hospital encounter?
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 = '005-48105' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, h...
what was the top three most frequent diagnoses until 3 years ago?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY diagnoses_icd....
mimic_iii
CREATE TABLE table_name_40 ( races INTEGER, podiums VARCHAR, season VARCHAR )
What is the sum of the races in the 2007 season, which has more than 4 podiums?
SELECT SUM(races) FROM table_name_40 WHERE podiums > 4 AND season = "2007"
sql_create_context
CREATE TABLE table_58359 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" real, "Left" real, "Current Conference" text )
Where was the former private member that was founded in 1891 and left in 1975?
SELECT "Location" FROM table_58359 WHERE "Left" = '1975' AND "Type" = 'private' AND "Founded" = '1891'
wikisql
CREATE TABLE table_name_32 ( date VARCHAR, début VARCHAR, opposition VARCHAR )
What is the date for the player who debuted later than 1972 against Limerick?
SELECT date FROM table_name_32 WHERE début > 1972 AND opposition = "limerick"
sql_create_context
CREATE TABLE table_204_868 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "opponent" text, "score" text )
how many games did this player play in 2011 ?
SELECT COUNT(*) FROM table_204_868 WHERE "date" = 2011
squall
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 is the last procedure that patient 14397 received in this year?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14397) AND DATETIME(procedures_icd.charttime, 'start of year') = DAT...
mimic_iii
CREATE TABLE table_name_67 ( location_attendance VARCHAR, record VARCHAR )
What is the attendance on location for a record of 40 40?
SELECT location_attendance FROM table_name_67 WHERE record = "40–40"
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number...
SELECT AVG(CAST(Reputation AS FLOAT)) FROM Users;.
SELECT AVG(CAST(Reputation AS FLOAT)) FROM Users
sede
CREATE TABLE table_65478 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the Result of the game on October 20, 1963 with an Attendance of 60,671 or greater?
SELECT "Result" FROM table_65478 WHERE "Attendance" > '60,671' AND "Date" = 'october 20, 1963'
wikisql
CREATE TABLE table_name_6 ( rank INTEGER, team VARCHAR, games VARCHAR )
What was the ranking of Beirasar Rosal a, the year they played 32 games?
SELECT MAX(rank) FROM table_name_6 WHERE team = "beirasar rosalía" AND games < 32
sql_create_context
CREATE TABLE table_41648 ( "Year" text, "Starts" real, "Cuts Made" real, "Wins" real, "Top 10" real, "Top 25" real, "Earnings (\u20ac)" real, "Money list rank" text )
What is the highest number of wins when more than 17 cuts and more than 25 starts were made, and the top 10 ranking is less than 8?
SELECT MAX("Wins") FROM table_41648 WHERE "Cuts Made" > '17' AND "Starts" > '25' AND "Top 10" < '8'
wikisql
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...
Show me about the correlation between School_ID and All_Games_Percent , and group by attribute All_Games in a scatter chart.
SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY All_Games
nvbench
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...
从2004年11月3日到2019年6月3日,患者31294224在医疗机构3614796检查次数是多少?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '31294224' AND t_kc22.STA_DATE BETWEEN '2004-11-03' AND '2019-06-03' AND t_kc22.t_kc21_MED_SER_ORG_NO = '3614796' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
what drugs were first prescribed to patient 007-9853 since 108 months ago via the intralumin route?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-9853')) AND medication.routeadmin = 'intralumin' AND DATETIME(m...
eicu
CREATE TABLE table_25157 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
Name the number of year for score being 6 3, 6 2, 6 4
SELECT COUNT("Year") FROM table_25157 WHERE "Score in the final" = '6–3, 6–2, 6–4'
wikisql
CREATE TABLE table_name_87 ( call_sign VARCHAR, state VARCHAR, frequency VARCHAR )
What is the call sign for 90.9 FM which is in Florida?
SELECT call_sign FROM table_name_87 WHERE state = "florida" AND frequency = "90.9 fm"
sql_create_context
CREATE TABLE table_31243 ( "Episode" real, "Title" text, "Directed by" text, "Written by" text, "UK viewers (million)" text, "Share (%)" text, "Original air date" text )
How many episodes have the title 'episode 2'?
SELECT MIN("Episode") FROM table_31243 WHERE "Title" = 'Episode 2'
wikisql
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Pr...
How many gas stations dors each manager have? Plot a bar chart.
SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name
nvbench
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
医疗就诊26786067488中所以的病人住院多久?
SELECT t_kc21.IN_HOSP_DAYS FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '26786067488'
css
CREATE TABLE problems ( problem_id number, product_id number, closure_authorised_by_staff_id number, reported_by_staff_id number, date_problem_reported time, date_problem_closed time, problem_description text, other_problem_details text ) CREATE TABLE problem_status_codes ( problem_...
Find the ids of the problems reported after the date of any problems reported by the staff Rylan Homenick.
SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > (SELECT MAX(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Rylan" AND T4.staff_last_name = "Homenick")
spider
CREATE TABLE table_35699 ( "Track" text, "City" text, "State" text, "Opened (closing date if defunct)" text, "Surface" text, "Length" text )
What is the city the track of manzanita speedway is in?
SELECT "City" FROM table_35699 WHERE "Track" = 'manzanita speedway'
wikisql
CREATE TABLE table_16922657_2 ( Ends INTEGER, country VARCHAR, Norway VARCHAR )
What is Norway's least ends lost?
SELECT MIN(Ends) AS lost FROM table_16922657_2 WHERE country = Norway
sql_create_context
CREATE TABLE table_name_7 ( visa_3 VARCHAR, visa_1 VARCHAR )
Which Visa 3 has a Visa 1 of michael mcglinchey?
SELECT visa_3 FROM table_name_7 WHERE visa_1 = "michael mcglinchey"
sql_create_context
CREATE TABLE table_9554 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
What is the score for set 1 with a total of 117 109?
SELECT "Set 1" FROM table_9554 WHERE "Total" = '117–109'
wikisql
CREATE TABLE table_204_975 ( id number, "year" number, "competition" text, "location" text, "event" text, "final-rank" text, "final-score" number, "qualifying rank" number, "qualifying score" number )
what is he number of events held in philadelphia ?
SELECT COUNT("competition") FROM table_204_975 WHERE "location" = 'philadelphia'
squall
CREATE TABLE table_14594528_6 ( name__alma_mater_ VARCHAR, wins VARCHAR )
What coach had 15 wins?
SELECT name__alma_mater_ FROM table_14594528_6 WHERE wins = 15
sql_create_context
CREATE TABLE table_27908 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
What is the dominant religion in 2002 for the population of 2337 in 2011?
SELECT "Dominant religion (2002)" FROM table_27908 WHERE "Population (2011)" = '2337'
wikisql
CREATE TABLE table_train_264 ( "id" int, "stroke" bool, "hematocrit_hct" float, "serum_psa" float, "coronary_artery_disease_cad" bool, "international_prostate_symptom_score_ipss" int, "hypertension" bool, "NOUSE" float )
international prostate symptom score ( ipss ) > 19 ( severe )
SELECT * FROM table_train_264 WHERE international_prostate_symptom_score_ipss > 19
criteria2sql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number...
what was the top five most frequent drugs prescribed to patients within the same month after they had been prescribed promethazine hcl 25 mg/ml ij soln in 2105?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'promethazine hcl 25 mg/ml ij soln' AND STRFTIME('%y...
eicu
CREATE TABLE table_name_63 ( name VARCHAR, decile VARCHAR, roll VARCHAR )
Tell me the name with decile of 6 and roll of 93
SELECT name FROM table_name_63 WHERE decile = "6" AND roll = 93
sql_create_context
CREATE TABLE player ( Team VARCHAR, Age VARCHAR )
Find the team of the player of the highest age.
SELECT Team FROM player ORDER BY Age DESC LIMIT 1
sql_create_context
CREATE TABLE table_62068 ( "Mininera DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
How many wins for team with 1800 Against and more than 0 byes?
SELECT MAX("Wins") FROM table_62068 WHERE "Against" = '1800' AND "Draws" > '0'
wikisql
CREATE TABLE table_25765 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
How many millions of people in the US saw the episode titled 'Francine's Flashback'?
SELECT "U.S. viewers (millions)" FROM table_25765 WHERE "Title" = 'Francine''s Flashback'
wikisql
CREATE TABLE table_name_62 ( laps VARCHAR, time_retired VARCHAR )
How many laps associated with a Time/Retired of + 1:25.475?
SELECT COUNT(laps) FROM table_name_62 WHERE time_retired = "+ 1:25.475"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
申请检验报告单70072856056的科室名称以及编码都是什么呢?
SELECT SQKS, SQKSMC FROM jybgb WHERE BGDH = '70072856056'
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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, JOB_ID varchar(10), ...
For those employees who was hired before 2002-06-21, find hire_date and the sum of manager_id bin hire_date by weekday, and visualize them by a bar chart, could you list y axis in desc order?
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_5089 ( "Station Code" text, "Station Name" text, "Arrival" text, "Departure" text, "Platform" text )
At what Platform is the Departure 18:00?
SELECT "Platform" FROM table_5089 WHERE "Departure" = '18:00'
wikisql
CREATE TABLE table_46620 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
What school/club did the player who layed shooting guard attend?
SELECT "School/Club Team" FROM table_46620 WHERE "Position" = 'shooting guard'
wikisql
CREATE TABLE table_11056 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Venue has a crowd larger than 25,000?
SELECT "Away team" FROM table_11056 WHERE "Crowd" > '25,000'
wikisql
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,...
根据不同的出院诊断疾病名称和科室编码,列出所有医疗就诊记录中患者在医院5280788中的平均年龄是多大?
SELECT MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5280788' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM
css
CREATE TABLE table_23248910_10 ( high_assists VARCHAR, date VARCHAR )
List all players with highest assists from April 2.
SELECT high_assists FROM table_23248910_10 WHERE date = "April 2"
sql_create_context
CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE takes ( id text, course_id text, sec_id text, semester text, year number, grade text ) CREATE TABLE...
What are the ids of instructors who taught in the Fall of 2009 but not in the Spring of 2010?
SELECT id FROM teaches WHERE semester = 'Fall' AND year = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND year = 2010
spider
CREATE TABLE table_55819 ( "Class" text, "Operator" text, "Number" real, "Year Built" text, "Cars per Set" real, "Unit Numbers." text )
What is the smallest number for Cars per Set built in 1977-1979 larger than 32?
SELECT MIN("Cars per Set") FROM table_55819 WHERE "Year Built" = '1977-1979' AND "Number" > '32'
wikisql
CREATE TABLE table_78514 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
Tell me the host team for giants stadium and visiting of cincinnati bengals
SELECT "Host Team" FROM table_78514 WHERE "Stadium" = 'giants stadium' AND "Visiting Team" = 'cincinnati bengals'
wikisql
CREATE TABLE table_12792876_4 ( try_bonus VARCHAR, points_against VARCHAR )
Name the try bonus of points against at 430
SELECT try_bonus FROM table_12792876_4 WHERE points_against = "430"
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...
Draw a bar chart about the distribution of All_Road and ACC_Percent , display by the bar in ascending.
SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY All_Road
nvbench
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
哪些人在46775344496的医疗就诊中报告检验报告单是超过10份的?列出这些报告人的工号,还有姓名也列出来
SELECT BGRGH, BGRXM FROM jybgb WHERE JZLSH = '46775344496' GROUP BY BGRGH HAVING COUNT(*) > 10
css
CREATE TABLE table_train_117 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "renal_disease" bool, "total_serum_protein" int, "diastolic_blood_pressure_dbp" int, "geriatric_depression_scale_gds" int, "serum_creatinine" float, "uncontrolled_blo...
geriatric depression scale score of less than or equal to 6
SELECT * FROM table_train_117 WHERE geriatric_depression_scale_gds <= 6
criteria2sql
CREATE TABLE table_name_39 ( date VARCHAR, home VARCHAR )
Home of buffalo happened on what date?
SELECT date FROM table_name_39 WHERE home = "buffalo"
sql_create_context
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...
how much did the arterial bp mean of patient 11732 change measured at 2103-05-26 21:00:00 compared to the value measured at 2103-05-26 19:00:00?
SELECT (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 = 11732)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'a...
mimic_iii
CREATE TABLE table_17451 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What position does Neil Komadoski play?
SELECT "Position" FROM table_17451 WHERE "Player" = 'Neil Komadoski'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
tell me the name of the output patient 027-210868 had last on the first intensive care unit visit?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-210868') AND NOT patient.unitdischargetime IS NULL ORDER...
eicu
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
在1559785这个医院的患者方忆秋,他的出院诊断疾病名称中包含肺病的医疗就诊记录编号是哪些
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '方忆秋' AND t_kc21.MED_SER_ORG_NO = '1559785' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%肺病%'
css
CREATE TABLE table_49011 ( "Season" text, "Passenger" text, "Equipment" text, "Position" text, "Points" real, "Races" real, "Wins" text, "Second" text, "Third" text )
Which passenger has a position of 21 and less than 49 points?
SELECT "Passenger" FROM table_49011 WHERE "Position" = '21' AND "Points" < '49'
wikisql
CREATE TABLE table_20948329_1 ( legs_won VARCHAR )
How many 180s have legs won of 45?
SELECT MAX(180 AS s) FROM table_20948329_1 WHERE legs_won = 45
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
医院9461389所有的就诊记载里,依科室编号的不同与入院诊断编码的不同列出医保大病支付的花费与医疗费的总额度相比比值最小是多少
SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '9461389' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD
css
CREATE TABLE table_name_15 ( pick__number INTEGER, league_from VARCHAR )
What is the lowest pick from Elitserien (Sweden)?
SELECT MIN(pick__number) FROM table_name_15 WHERE league_from = "elitserien (sweden)"
sql_create_context