context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_87 ( player VARCHAR, money___£__ VARCHAR, country VARCHAR )
Who is the player with playoff money from the United States?
SELECT player FROM table_name_87 WHERE money___£__ = "playoff" AND country = "united states"
sql_create_context
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Student_Tests_Taken ( registration_id IN...
Return the completion date for all the tests that have 'Fail' result, and count them by a bar chart
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail"
nvbench
CREATE TABLE student ( city_code VARCHAR, age INTEGER, sex VARCHAR )
Find the average age and number of male students (with sex M) from each city.
SELECT COUNT(*), AVG(age), city_code FROM student WHERE sex = 'M' GROUP BY city_code
sql_create_context
CREATE TABLE table_name_47 ( record VARCHAR, date VARCHAR )
What is the Record with a Date with 24 march 2008?
SELECT record FROM table_name_47 WHERE date = "24 march 2008"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
how many patients whose admission type is elective and procedure short title is venous cath nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.short_title = "Venous cath NEC"
mimicsql_data
CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE user ( uid int, user_id varchar, name varchar )...
What is the number of Pet Groomers in Edinburgh
SELECT COUNT(DISTINCT (business.name)) FROM business, category WHERE business.city = 'Edinburgh' AND category.business_id = business.business_id AND category.category_name = 'Pet Groomers'
yelp
CREATE TABLE table_23285849_10 ( score VARCHAR, high_assists VARCHAR )
When chauncey billups (7) has the highest amount of assists what is the score?
SELECT score FROM table_23285849_10 WHERE high_assists = "Chauncey Billups (7)"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_stop ( flight_id int, stop_n...
what are all the flights between SAN FRANCISCO and BOSTON
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE table_name_58 ( round INTEGER, college VARCHAR )
What is the lowest round for Southern College?
SELECT MIN(round) FROM table_name_58 WHERE college = "southern"
sql_create_context
CREATE TABLE table_70596 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What is the average number of points for an Offenhauser L4 engine with a Trevis chassis?
SELECT AVG("Points") FROM table_70596 WHERE "Engine" = 'offenhauser l4' AND "Chassis" = 'trevis'
wikisql
CREATE TABLE table_17083 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
Which college does the player John Theus associate with?
SELECT "College" FROM table_17083 WHERE "Player" = 'John Theus'
wikisql
CREATE TABLE laptimes ( driverid VARCHAR, milliseconds INTEGER ) CREATE TABLE drivers ( driverid VARCHAR, nationality VARCHAR )
Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?
SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000
sql_create_context
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 all employees who have the letters D or S in their first name, find job_id and the average of manager_id , and group by attribute job_id, and visualize them by a bar chart, could you display JOB_ID in asc order?
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_name_57 ( venue VARCHAR, away_team VARCHAR )
Where did Collingwood play ae the away team?
SELECT venue FROM table_name_57 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE table_name_55 ( alternate VARCHAR, skip VARCHAR )
What is the alternate of the nation with Erkki Lill as the skip?
SELECT alternate FROM table_name_55 WHERE skip = "erkki lill"
sql_create_context
CREATE TABLE table_68744 ( "Region served" text, "City" text, "Channels ( Analog / Digital )" text, "First air date" text, "ERP (Analog/ Digital)" text, "HAAT (Analog/ Digital) 1" text, "Transmitter Location" text )
What is the ERP for the Mount Goonaneman transmitter?
SELECT "ERP (Analog/ Digital)" FROM table_68744 WHERE "Transmitter Location" = 'mount goonaneman'
wikisql
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 d_items ( row_id num...
what was the name of the last intake that patient 739 yesterday had?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739)) AND DATETIME(inputevents_cv.ch...
mimic_iii
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is the primary disease and diagnosis short title of patient named lawrence wibbens?
SELECT demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Lawrence Wibbens"
mimicsql_data
CREATE TABLE table_66614 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the number of silver medals when there are more than 1 gold, and more than 6 bronze?
SELECT MIN("Silver") FROM table_66614 WHERE "Gold" > '1' AND "Bronze" > '6'
wikisql
CREATE TABLE table_14652 ( "City" text, "Province/Region" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
Which country is the ICAO vvts?
SELECT "Country" FROM table_14652 WHERE "ICAO" = 'vvts'
wikisql
CREATE TABLE table_16494599_3 ( player VARCHAR, school_club_team VARCHAR )
What players attended missouri?
SELECT player FROM table_16494599_3 WHERE school_club_team = "Missouri"
sql_create_context
CREATE TABLE table_name_82 ( winner VARCHAR, stage VARCHAR )
Name the winner for ss14
SELECT winner FROM table_name_82 WHERE stage = "ss14"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
检验报告单编号为81389511365的报告组织号码以及名字是什么?
SELECT zyjybgb.BGJGDM, zyjybgb.BGJGMC FROM zyjybgb WHERE zyjybgb.BGDH = '81389511365' UNION SELECT mzjybgb.BGJGDM, mzjybgb.BGJGMC FROM mzjybgb WHERE mzjybgb.BGDH = '81389511365'
css
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Averages for tags of post questions from [AskDifferent].
SELECT t.TagName, t.Count, x.* FROM Tags AS t INNER JOIN (SELECT TagId, ROUND(AVG(CAST(ViewCount AS FLOAT)), 2) AS AvgViewCount, ROUND(AVG(CAST(AnswerCount AS FLOAT)), 2) AS AvgAnswerCount, ROUND(AVG(CAST(CommentCount AS FLOAT)), 2) AS AvgCommentCount, ROUND(AVG(CAST(FavoriteCount AS FLOAT)), 2) AS AvgFavoriteCount, SU...
sede
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the amount of hire_date bin hire_date by weekday in a bar chart.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
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...
在06年4月14日到2019年11月24日之间患者16067327所有检验结果指标记录中的检测方法都有什么?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH W...
css
CREATE TABLE table_name_21 ( total_time VARCHAR, bike__40km_ VARCHAR )
For the triathlon with a bike (40km) of 58:20 what is the total time?
SELECT total_time FROM table_name_21 WHERE bike__40km_ = "58:20"
sql_create_context
CREATE TABLE table_10350 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the crowd with Home team score of 16.9 (105)?
SELECT AVG("Crowd") FROM table_10350 WHERE "Home team score" = '16.9 (105)'
wikisql
CREATE TABLE table_name_86 ( bronze INTEGER, total VARCHAR, silver VARCHAR )
What is the highest Bronze, when Total is less than 3, and when Silver is less than 0?
SELECT MAX(bronze) FROM table_name_86 WHERE total < 3 AND silver < 0
sql_create_context
CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text )
Give the different reigns of wrestlers who are not located in Tokyo, Japan.
SELECT DISTINCT reign FROM wrestler WHERE location <> "Tokyo , Japan"
spider
CREATE TABLE table_64084 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "2012 club" text )
What is the Weight of the GK Player with 2012 Club of CN Atl tic-Barceloneta?
SELECT "Weight" FROM table_64084 WHERE "Pos." = 'gk' AND "2012 club" = 'cn atlètic-barceloneta'
wikisql
CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Course ( CID VARCHAR(7), CName VARCHAR(40), ...
Draw a bar chart about the distribution of Days and the sum of Instructor , and group by attribute Days.
SELECT Days, SUM(Instructor) FROM Course GROUP BY Days ORDER BY Credits
nvbench
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 marital status and age of subject id 66411?
SELECT demographic.marital_status, demographic.age FROM demographic WHERE demographic.subject_id = "66411"
mimicsql_data
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and employee_id , and sort Y from high to low order.
SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
nvbench
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
尤英秀患者在10年4月29日至15年7月29日之间去的医院总数是多少?
SELECT COUNT(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_NM = '尤英秀' AND IN_HOSP_DATE BETWEEN '2010-04-29' AND '2015-07-29'
css
CREATE TABLE table_15967 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What positions does the college/junior/club team, molot perm (russia) have?
SELECT "Position" FROM table_15967 WHERE "College/junior/club team" = 'Molot Perm (Russia)'
wikisql
CREATE TABLE table_56177 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which venue was it at when 10.14 (74) was the home teams score?
SELECT "Venue" FROM table_56177 WHERE "Home team score" = '10.14 (74)'
wikisql
CREATE TABLE table_name_41 ( drawn INTEGER, games INTEGER )
Which Drawn has Games smaller than 7?
SELECT SUM(drawn) FROM table_name_41 WHERE games < 7
sql_create_context
CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE albums ( aid number, title text, year number, ...
What are all the labels?
SELECT DISTINCT label FROM albums
spider
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
bring me the number of patients with coronary artery primary disease born before 2150.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.dob_year < "2150"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
when patient 032-24135 was first diagnosed with ventricular tachycardia - non-sustained during this year?
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-24135')) AND diagnosis.diagnosisname = 'ventricular tachycard...
eicu
CREATE TABLE table_66038 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What round did the match at the Golden Trophy 1999 event end?
SELECT SUM("Round") FROM table_66038 WHERE "Event" = 'golden trophy 1999'
wikisql
CREATE TABLE albums ( aid number, title text, year number, label text, type text ) CREATE TABLE songs ( songid number, title text ) CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE performance ( songid number, bandmate number, stagepos...
What are the types of vocals that the musician with the first name 'Solveig' played in the song 'A Bar in Amsterdam'?
SELECT type FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = "Solveig" AND T2.title = "A Bar In Amsterdam"
spider
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARC...
What is the average age of male students in each city? Draw a bar chart, display by the city_code in ascending please.
SELECT city_code, AVG(Age) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY city_code
nvbench
CREATE TABLE table_52589 ( "Race" text, "Length" text, "Class" text, "Circuit" text, "Date" text )
On what circuit is there a race that lasts 2 hours?
SELECT "Circuit" FROM table_52589 WHERE "Length" = '2 hours'
wikisql
CREATE TABLE table_8125 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Which Date has a Tournament of national jewish hospital open, and a Runner(s)-up of pat bradley?
SELECT "Date" FROM table_8125 WHERE "Tournament" = 'national jewish hospital open' AND "Runner(s)-up" = 'pat bradley'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
What classes on this list are for 8 credits ?
SELECT DISTINCT name, number FROM course WHERE credits = 8 AND department = 'EECS'
advising
CREATE TABLE table_2562572_50 ( dominant_religion__2002_ VARCHAR, settlement VARCHAR )
What was the dominant religion (2002) of the Mala Remeta settlement?
SELECT dominant_religion__2002_ FROM table_2562572_50 WHERE settlement = "Mala Remeta"
sql_create_context
CREATE TABLE table_204_623 ( id number, "opponent" text, "goals" text, "wins" number, "draws" number, "losses" number, "+- goals" number, "matches" number, "qualified" number, "eliminated" number )
what is the number of losses for dinamo tiran
SELECT "losses" FROM table_204_623 WHERE "opponent" = 'dinamo tirane'
squall
CREATE TABLE table_78716 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is Competition, when Date is 'January 11, 1996', when Venue is 'San Diego , United States'?
SELECT "Competition" FROM table_78716 WHERE "Date" = 'january 11, 1996' AND "Venue" = 'san diego , united states'
wikisql
CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time )
What is the average number of stars that each reviewer awards for a movie?
SELECT T2.name, AVG(T1.stars) FROM rating AS T1 JOIN reviewer AS T2 ON T1.rid = T2.rid GROUP BY T2.name
spider
CREATE TABLE table_60323 ( "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 position of club Melilla CF, with a goal difference smaller than -10?
SELECT SUM("Position") FROM table_60323 WHERE "Club" = 'melilla cf' AND "Goal Difference" < '-10'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the change of department_id over hire_date, could you order by the HIRE_DATE in desc?
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_45350 ( "Season" text, "Wins" real, "Losses" real, "Ties" real, "Ivy Lg. record" text )
What is the total number of Losses, when Ties is 2, and when Wins is greater than 8?
SELECT COUNT("Losses") FROM table_45350 WHERE "Ties" = '2' AND "Wins" > '8'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
how many patients whose days of hospital stay is greater than 14 and diagnoses icd9 code is v168?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "14" AND diagnoses.icd9_code = "V168"
mimicsql_data
CREATE TABLE table_54627 ( "Number & name" text, "Description" text, "Current status" text, "Livery" text, "Date" text )
Which livery is from 1919?
SELECT "Livery" FROM table_54627 WHERE "Date" = '1919'
wikisql
CREATE TABLE table_name_84 ( laps INTEGER, grid VARCHAR, time VARCHAR, rider VARCHAR )
How many laps had a time stat of accident for the rider carmelo morales when the grid was more than 25?
SELECT SUM(laps) FROM table_name_84 WHERE time = "accident" AND rider = "carmelo morales" AND grid > 25
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...
有多少外地病人来医疗机构3922120看病的
SELECT COUNT(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3922120' AND gwyjzb.REMOTE_SETTLE_FLG = '异地1' OR gwyjzb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3922120' AND fgwyjzb.REMOTE_SETTLE_FLG = '异地1' OR fgwyjzb.REMOTE_SETTLE_FLG = '异地...
css
CREATE TABLE table_name_56 ( club VARCHAR, home_result VARCHAR, away_result VARCHAR )
Home result of 1 0, and a Away result of 0 1 involves what club?
SELECT club FROM table_name_56 WHERE home_result = "1–0" AND away_result = "0–1"
sql_create_context
CREATE TABLE table_20692 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
What is the average start for the season with $7,220 in winnings?
SELECT "Avg. Start" FROM table_20692 WHERE "Winnings" = '$7,220'
wikisql
CREATE TABLE table_4797 ( "Rank" real, "Player" text, "Years" text, "Games" real, "Ast. Avg." real, "Total Assists" real )
What is the total number of assists for players with under 55 games and over 6 assists per game average?
SELECT SUM("Total Assists") FROM table_4797 WHERE "Ast. Avg." > '6' AND "Games" < '55'
wikisql
CREATE TABLE table_19560 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text )
Which is the class AA when graford was the class A
SELECT "Class AA" FROM table_19560 WHERE "Class A" = 'Graford'
wikisql
CREATE TABLE table_1341690_18 ( incumbent VARCHAR, result VARCHAR )
How many incumbents resulted in a lost renomination republican gain?
SELECT COUNT(incumbent) FROM table_1341690_18 WHERE result = "Lost renomination Republican gain"
sql_create_context
CREATE TABLE table_29569969_2 ( us_viewers__millions_ VARCHAR, production_code VARCHAR )
How many million people in the US saw the episode with production code 105?
SELECT us_viewers__millions_ FROM table_29569969_2 WHERE production_code = 105
sql_create_context
CREATE TABLE table_name_14 ( tons VARCHAR, nationality VARCHAR )
How many tons was the ship from norway?
SELECT COUNT(tons) FROM table_name_14 WHERE nationality = "norway"
sql_create_context
CREATE TABLE table_75087 ( "Rank" text, "Stadium" text, "Capacity" real, "City" text, "Country" text, "Tournament hosted" text )
What is the average capacity that has switzerland as the country?
SELECT AVG("Capacity") FROM table_75087 WHERE "Country" = 'switzerland'
wikisql
CREATE TABLE table_47408 ( "Circuit" text, "Location" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winner" text )
What is Location, when Circuit is August 16?
SELECT "Location" FROM table_47408 WHERE "Circuit" = 'august 16'
wikisql
CREATE TABLE table_78628 ( "Party" text, "Party-list votes" real, "Vote percentage" text, "Total seats" text, "Seat percentage" text )
What is the seat percentage when vote percentage is 2.4% (-8.3)?
SELECT "Seat percentage" FROM table_78628 WHERE "Vote percentage" = '2.4% (-8.3)'
wikisql
CREATE TABLE table_54354 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the away team when the venue was Windy Hill?
SELECT "Away team" FROM table_54354 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE table_17490 ( "Subjects" text, "First Year" text, "Second Year" text, "Third Year" text, "Fourth Year" text )
What is the third year course in science?
SELECT "Third Year" FROM table_17490 WHERE "Subjects" = 'Science'
wikisql
CREATE TABLE table_name_58 ( date VARCHAR, week VARCHAR, result VARCHAR )
What is the date of the post-week 2 game with a result of l 16 10?
SELECT date FROM table_name_58 WHERE week > 2 AND result = "l 16–10"
sql_create_context
CREATE TABLE pilot ( pilot_id number, name text, age number ) CREATE TABLE airport_aircraft ( id number, airport_id number, aircraft_id number ) CREATE TABLE aircraft ( aircraft_id number, aircraft text, description text, max_gross_weight text, total_disk_area text, max...
what is the name and age of the youngest winning pilot?
SELECT t1.name, t1.age FROM pilot AS t1 JOIN match AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age LIMIT 1
spider
CREATE TABLE table_name_67 ( site VARCHAR, opponent_number VARCHAR )
At which site was Northwestern an opponent?
SELECT site FROM table_name_67 WHERE opponent_number = "northwestern"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
在患者81881911的诊疗记录里,从00年9月13日到12年2月14日这期间,为其检测转铁蛋白的医务人员有哪几位,报一下工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH ...
css
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
How many students are there in total?
SELECT COUNT(*) FROM student
spider
CREATE TABLE table_66554 ( "Date" text, "Location" text, "Lineup" text, "Assist/pass" text, "Score" text, "Result" text, "Competition" text )
What is the location on 2008-06-17 when the lineup was start?
SELECT "Location" FROM table_66554 WHERE "Lineup" = 'start' AND "Date" = '2008-06-17'
wikisql
CREATE TABLE table_65712 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School" text )
Which pick played the Defensive End position?
SELECT "Pick" FROM table_65712 WHERE "Position" = 'defensive end'
wikisql
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Pr...
Show first name and id for all customers with at least 2 accounts in a bar chart, and could you order x axis from high to low order?
SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.customer_first_name DESC
nvbench
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
when was the first time that patient 12885 was given a other phototherapy procedure during the previous year?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'other phototherapy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12885) AND DATET...
mimic_iii
CREATE TABLE table_name_72 ( round INTEGER, position VARCHAR )
In what round was the first outside linebacker picked?
SELECT MIN(round) FROM table_name_72 WHERE position = "outside linebacker"
sql_create_context
CREATE TABLE table_name_45 ( year INTEGER, apparatus VARCHAR, rank_final VARCHAR )
What is the highest Year, when Apparatus is 'Vault', and when Rank-Final is less than 9?
SELECT MAX(year) FROM table_name_45 WHERE apparatus = "vault" AND rank_final < 9
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, d...
what is the earliest flight from BOSTON to OAKLAND that serves a meal
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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_s...
atis
CREATE TABLE table_203_696 ( id number, "year" number, "single" text, "charts\nfr" number, "charts\nbel\nwa" number, "charts\nswi" number, "certification" number, "album" text )
how many songs were not listed on the swiss charts ?
SELECT COUNT("single") FROM table_203_696 WHERE "charts\nswi" IS NULL
squall
CREATE TABLE table_26428 ( "Profile" text, "Bandwidth ( MHz )" text, "Number of carriers" real, "Carrier bandwidth (kHz)" text, "Power ( dBm )" text, "Max. downstream throughput ( Mbit/s )" real )
What are the mhz when the profile is 8b?
SELECT "Bandwidth ( MHz )" FROM table_26428 WHERE "Profile" = '8b'
wikisql
CREATE TABLE table_name_29 ( venue VARCHAR, competition VARCHAR, date VARCHAR )
What venue did the 2000 tiger cup take place at on November 10, 2000?
SELECT venue FROM table_name_29 WHERE competition = "2000 tiger cup" AND date = "november 10, 2000"
sql_create_context
CREATE TABLE table_24691 ( "Location" text, "July (\u00b0C)" text, "July (\u00b0F)" text, "January (\u00b0C)" text, "January (\u00b0F)" text )
In what location were the January ( F) temperatures 30/17?
SELECT "Location" FROM table_24691 WHERE "January (\u00b0F)" = '30/17'
wikisql
CREATE TABLE table_2509202_2 ( guanay_municipality VARCHAR, tacacoma_municipality VARCHAR )
What is the guanay municipality when the tacacoma municipality is 4.321?
SELECT guanay_municipality FROM table_2509202_2 WHERE tacacoma_municipality = "4.321"
sql_create_context
CREATE TABLE table_15162503_1 ( description VARCHAR, viewers_selection VARCHAR )
What was the description when the viewers selected Nan?
SELECT description FROM table_15162503_1 WHERE viewers_selection = "Nan"
sql_create_context
CREATE TABLE table_name_95 ( home VARCHAR, decision VARCHAR, date VARCHAR )
On October 24, who played at home when there was a decision of Ward?
SELECT home FROM table_name_95 WHERE decision = "ward" AND date = "october 24"
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...
混合性焦虑和抑郁障碍的患者的促肾上腺皮质激素在门诊诊断的参考值范围下限和上限都是啥?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '混合性焦虑和抑郁障碍' AND jyjgzbb.JCZBMC = '促肾上腺皮质激素' UNION SELECT jyjgzbb.C...
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
how many patients were in 2105 in the 607 ward.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 607 AND STRFTIME('%y', patient.unitadmittime) = '2105'
eicu
CREATE TABLE table_72483 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
what's the points with tries for being 64
SELECT "Points" FROM table_72483 WHERE "Tries for" = '64'
wikisql
CREATE TABLE table_23102 ( "Season #" real, "Episode #" real, "Title" text, "Director(s)" text, "Writer(s)" text, "Original Air Date" text )
When was the episode number 2 originally aired?
SELECT "Original Air Date" FROM table_23102 WHERE "Episode #" = '2'
wikisql
CREATE TABLE table_15535 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many total medals for the nation ranked 7 with 1 silver and under 4 bronzes?
SELECT AVG("Total") FROM table_15535 WHERE "Bronze" < '4' AND "Silver" = '1' AND "Rank" = '7'
wikisql
CREATE TABLE table_66440 ( "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponents in the final" text, "Score" text )
What was the Surface on during 10 November 2006?
SELECT "Surface" FROM table_66440 WHERE "Date" = '10 november 2006'
wikisql
CREATE TABLE table_68256 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Name the finish with player lou graham
SELECT "Finish" FROM table_68256 WHERE "Player" = 'lou graham'
wikisql
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 average age of patients whose primary disease is neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues\bone marrow transplant and days of hospital stay is 23?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND demographic.days_stay = "23"
mimicsql_data
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...
列出患者金鸿轩就诊科室名称不包含产科的在医院3113072中所有门诊就诊记录是什么流水号?
SELECT wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '金鸿轩' AND hz_info.YLJGDM = '3113072' AND NOT wdmzjzjlb.JZKSMC LIKE '%产科%' UNION SELECT bdmzjzj...
css
CREATE TABLE table_19609 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production Code" real, "U.S. viewers (millions)" text )
15.03 million u.s viewers seen what episode?
SELECT "Title" FROM table_19609 WHERE "U.S. viewers (millions)" = '15.03'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
At what time will Steven Ceccio teach 885 ?
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 885 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Steven Ceccio%' AND offering_instructor.instr...
advising