instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_76 ( block INTEGER, date_of_birth VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest block that has 15.09.1981 as the date, and a height greater than 202?
SELECT MAX(block) FROM table_name_76 WHERE date_of_birth = "15.09.1981" AND height > 202
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) C...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) >= '2105' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_33091 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game held where North Melbourne wa...
SELECT "Venue" FROM table_33091 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co...
advising
CREATE TABLE table_name_48 ( signed VARCHAR, position VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Was position ss from carson city high school signed?
SELECT signed FROM table_name_48 WHERE position = "ss" AND school = "carson city high school"
sql_create_context
CREATE TABLE table_204_731 ( id number, "rank" number, "athlete" text, "shooting\nscore (pts)" text, "fencing\nvictories (pts)" text, "swimming\ntime (pts)" text, "riding\npenalties (pts)" text, "running\ntime (pts)" text, "total" number ) -- Using valid SQLite, answer the followin...
SELECT COUNT("athlete") FROM table_204_731 WHERE "total" > 5000
squall
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID ...
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC
nvbench
CREATE TABLE table_name_78 ( psoe VARCHAR, polling_firm VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the PSOE for the Local Elections polling firm?
SELECT psoe FROM table_name_78 WHERE polling_firm = "local elections"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '喻思聪' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-10-16' AND '2006-01-26' GROUP BY t_kc21.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_65902 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par for Bo Bae Song?
SELECT "To par" FROM table_65902 WHERE "Player" = 'bo bae song'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
nvbench
CREATE TABLE table_name_53 ( laps VARCHAR, entrant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Peter Hopwood has how many laps in all?
SELECT COUNT(laps) FROM table_name_53 WHERE entrant = "peter hopwood"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131')) AND intakeoutput.cellpath L...
eicu
CREATE TABLE table_1870 ( "Team" text, "Location" text, "County" text, "Division" text, "Home ground" text, "Coach" text, "Captain" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the captain of the team in Southampton?
SELECT "Captain" FROM table_1870 WHERE "Location" = 'Southampton'
wikisql
CREATE TABLE table_2163 ( "#" real, "Player" text, "Age" text, "Australian Open" real, "French Open" real, "Wimbledon" real, "US Open" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many ages have Maureen Connolly Brinker as the player?
SELECT COUNT("Age") FROM table_2163 WHERE "Player" = 'Maureen Connolly Brinker'
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.long_title = "Single liveborn, born in hospital, delivered by cesarean section"
mimicsql_data
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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...
SELECT jybgb.BGJGDM, jybgb.BGJGMC FROM jybgb WHERE jybgb.BGDH = '10754397443'
css
CREATE TABLE table_13730 ( "Year" real, "Competition Description" text, "Location" text, "Apparatus" text, "Rank-Final" text, "Score-Final" real, "Rank-Qualifying" text, "Score-Qualifying" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT "Competition Description" FROM table_13730 WHERE "Rank-Qualifying" = '1st' AND "Apparatus" = 'ball'
wikisql
CREATE TABLE table_39419 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What class is assigned to frequencies larger than 89.3 with an ERP W...
SELECT "Class" FROM table_39419 WHERE "Frequency MHz" > '89.3' AND "ERP W" = '250'
wikisql
CREATE TABLE table_16501 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest of ayr united?
SELECT MIN("Highest") FROM table_16501 WHERE "Team" = 'Ayr United'
wikisql
CREATE TABLE table_name_32 ( uni_number INTEGER, first VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest uni# of the person with the first name Todd?
SELECT MAX(uni_number) FROM table_name_32 WHERE first = "todd"
sql_create_context
CREATE TABLE table_5347 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played mixed doubles when Anna Keir played wome...
SELECT "Mixed doubles" FROM table_5347 WHERE "Women's singles" = 'anna keir'
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 (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Open reduction of fracture with internal fixation, femur"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Abdomen artery incision"
mimicsql_data
CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE management ( department_ID int, head_ID int, tempor...
SELECT Name, AVG(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name
nvbench
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime) <= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B...
css
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 zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text ) CREATE TABLE weather ( date text, max_te...
SELECT T1.id, T2.installation_date FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id
spider
CREATE TABLE table_name_3 ( sport VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What sport happened at Wildcat Stadium?
SELECT sport FROM table_name_3 WHERE venue = "wildcat stadium"
sql_create_context
CREATE TABLE table_name_59 ( points INTEGER, chassis VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the low point total after 2006 with an m16 chassis?
SELECT MIN(points) FROM table_name_59 WHERE chassis = "m16" AND year > 2006
sql_create_context
CREATE TABLE table_203_11 ( id number, "title" text, "year" number, "peak chart positions\nus" number, "peak chart positions\nus r&b" number, "peak chart positions\nus rap" number, "peak chart positions\nuk" number, "certifications" text, "album" text ) -- Using valid SQLite, answe...
SELECT "title" FROM table_203_11 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_6697 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has a 2009 of q1, and a 2008 of 1r?
SELECT "Tournament" FROM table_6697 WHERE "2009" = 'q1' AND "2008" = '1r'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-84707' AND NOT patient.hospitaldischargetime IS NULL ORDER...
eicu
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id
advising
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...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 18866) AND icustays.outtime IS NULL)...
mimic_iii
CREATE TABLE table_16201038_5 ( missouri_vs VARCHAR, overall_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the opponents of Missouri that have an overall record of MU, 3-1?
SELECT missouri_vs FROM table_16201038_5 WHERE overall_record = "MU, 3-1"
sql_create_context
CREATE TABLE table_203802_2 ( english_party_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many parties are named the Center Alliance
SELECT COUNT(2013 AS _parliamentary_election) FROM table_203802_2 WHERE english_party_name = "Center Alliance"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '025-44842'
eicu
CREATE TABLE table_66178 ( "Title" text, "Series" text, "Director" text, "Release date" text, "reissue?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which series had a title of Boyhood Daze?
SELECT "Series" FROM table_66178 WHERE "Title" = 'boyhood daze'
wikisql
CREATE TABLE table_46634 ( "Nominative" text, "Ergative" text, "Dative" text, "Genitive" text, "Instrumental" text, "Adverbial" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ergative for the dative (i)mas?
SELECT "Ergative" FROM table_46634 WHERE "Dative" = '(i)mas'
wikisql
CREATE TABLE table_name_44 ( date VARCHAR, score VARCHAR, result VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Result of l, and a Competition of 1966 asian games, and a Score of 0 1 had what date?
SELECT date FROM table_name_44 WHERE result = "l" AND competition = "1966 asian games" AND score = "0–1"
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_51758 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the competition in paris for the parallel bars with a position of 1st?
SELECT "Competition" FROM table_51758 WHERE "Venue" = 'paris' AND "Position" = '1st' AND "Event" = 'parallel bars'
wikisql
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
SELECT zip_code, COUNT(*) FROM weather WHERE max_wind_Speed_mph >= 25 GROUP BY zip_code
nvbench
CREATE TABLE table_50648 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What g...
SELECT AVG("Game") FROM table_50648 WHERE "Date" = 'december 8'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location te...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 90663)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'or ...
mimic_iii
CREATE TABLE table_name_65 ( name VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which name has an Area of makarewa?
SELECT name FROM table_name_65 WHERE area = "makarewa"
sql_create_context
CREATE TABLE table_40592 ( "Sanderstead" text, "Selsdon" text, "Coombe Road" text, "Bingham Road" text, "Woodside" text, "Elmers End" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Coombe Road time with a Selsdon evening peak?
SELECT "Coombe Road" FROM table_40592 WHERE "Selsdon" = 'evening peak'
wikisql
CREATE TABLE table_76778 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record in Week 2?
SELECT "Record" FROM table_76778 WHERE "Week" = '2'
wikisql
CREATE TABLE table_name_60 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player has a Score of 71-71=142?
SELECT player FROM table_name_60 WHERE score = 71 - 71 = 142
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.BGDH = '27876710324'
css
CREATE TABLE Parties ( Party_ID INTEGER, Party_Details VARCHAR(255) ) CREATE TABLE Channels ( Channel_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Addresses ( Address_ID INTEGER, address_details VARCHAR(255) ) CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Ch...
SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code
nvbench
CREATE TABLE table_14459 ( "Week" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result when there was an attendance of 54,418?
SELECT "Result" FROM table_14459 WHERE "Attendance" = '54,418'
wikisql
CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_pla...
SELECT stuid FROM student WHERE city_code = "CHI"
spider
CREATE TABLE table_name_51 ( year INTEGER, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Year, when Tournament is 'Beijing'?
SELECT MIN(year) FROM table_name_51 WHERE tournament = "beijing"
sql_create_context
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_41121 ( "Stage (Winner)" text, "General Classification" text, "Young Classification" text, "Mountains Classification" text, "Sprint Classification" text, "Team Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha...
SELECT "Mountains Classification" FROM table_41121 WHERE "General Classification" = 'mark cavendish' AND "Team Classification" = 'garmin-chipotle-h30'
wikisql
CREATE TABLE table_8392 ( "Country" text, "Title" text, "Network" text, "Games" text, "Date aired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the show titled Beat the Star?
SELECT "Date aired" FROM table_8392 WHERE "Title" = 'beat the star'
wikisql
CREATE TABLE table_36301 ( "Distribution" text, "x86-64" text, "ia64" text, "ppc64" text, "sparc32" text, "hppa" text, "mips" text, "s390" text, "s390x" text, "alpha" text, "m68k" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT "s390x" FROM table_36301 WHERE "ia64" = 'yes' AND "alpha" = 'no'
wikisql
CREATE TABLE table_name_81 ( years_as_tallest VARCHAR, street_address VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE YEARS AS TALLEST WITH 01.0 10 light street?
SELECT years_as_tallest FROM table_name_81 WHERE street_address = "01.0 10 light street"
sql_create_context
CREATE TABLE table_56234 ( "Year" real, "Class" text, "Tyres" text, "Team" text, "Co-Drivers" text, "Laps" real, "Pos." text, "Class Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the co drivers past 1994 in the WSC class?...
SELECT "Co-Drivers" FROM table_56234 WHERE "Year" > '1994' AND "Class" = 'wsc'
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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "5" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_39574 ( "Score" text, "Opposition" text, "Venue" text, "City" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue had a city of Manchester in 2003?
SELECT "Venue" FROM table_39574 WHERE "City" = 'manchester' AND "Year" = '2003'
wikisql
CREATE TABLE table_21813 ( "Season" text, "Timeslot" text, "Premiere" text, "Finale" text, "TV season" text, "Ranking" text, "Viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every value for viewers for ranking #...
SELECT "Viewers (in millions)" FROM table_21813 WHERE "Ranking" = '#51' AND "Timeslot" = 'Tuesday 9:00 p.m.'
wikisql
CREATE TABLE table_39172 ( "Team" text, "Copa Libertadores 1999" text, "Copa Mercosur 1999" text, "Copa CONMEBOL 1999" text, "Intercontinental Cup 1999" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Copa Libertadores 1999 result for tea...
SELECT "Copa Libertadores 1999" FROM table_39172 WHERE "Copa CONMEBOL 1999" = 'did not qualify' AND "Team" = 'grêmio'
wikisql
CREATE TABLE table_name_25 ( grid INTEGER, rider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid for dirk heidolf?
SELECT SUM(grid) FROM table_name_25 WHERE rider = "dirk heidolf"
sql_create_context
CREATE TABLE table_57773 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time/Retired for a Grid larger than 6, and 57 laps?
SELECT "Time/Retired" FROM table_57773 WHERE "Grid" > '6' AND "Laps" = '57'
wikisql
CREATE TABLE table_name_61 ( april VARCHAR, game INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the total number of games in April greater than 83?
SELECT COUNT(april) FROM table_name_61 WHERE game > 83
sql_create_context
CREATE TABLE table_40566 ( "Episode number Production number" text, "Title" text, "Original airing" text, "Rating" real, "Share" real, "18-49" real, "Total viewers (in millions)" real, "Rank per week" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT MIN("Total viewers (in millions)") FROM table_40566 WHERE "Episode number Production number" = '109 5-22'
wikisql
CREATE TABLE table_11482 ( "Year" real, "Chassis" text, "Engine" text, "Tyres" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the total number of points with chassis of tf103
SELECT COUNT("Points") FROM table_11482 WHERE "Chassis" = 'tf103'
wikisql
CREATE TABLE table_name_74 ( played VARCHAR, points_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For which play was the points 271?
SELECT played FROM table_name_74 WHERE points_against = "271"
sql_create_context
CREATE TABLE table_34717 ( "Model" text, "Processor" text, "Memory" text, "Storage" text, "Graphics" text, "VRAM" text, "Display resolution" text, "MSRP" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the MSRP for the laptop with...
SELECT "MSRP" FROM table_34717 WHERE "Storage" = '128-512 gb ssd'
wikisql
CREATE TABLE table_204_421 ( id number, "name" text, "nationality" text, "position" text, "spartak career" text, "appearances" number, "goals" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many players had at least 20 league goals sco...
SELECT COUNT("name") FROM table_204_421 WHERE "goals" >= 20
squall
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...
SELECT t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '47989923435')
css
CREATE TABLE table_name_68 ( home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Home team on February 2, 1947?
SELECT home FROM table_name_68 WHERE date = "february 2, 1947"
sql_create_context
CREATE TABLE table_18892 ( "Region" text, "Total Population" real, "Catholic" real, "% Catholic" text, "% of global Catholic pop." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the maximum total population with % catholic being 1.17%
SELECT MAX("Total Population") FROM table_18892 WHERE "% Catholic" = '1.17%'
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...
SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Home
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...
SELECT FLX_MED_ORG_ID FROM t_kc21 WHERE MED_CLINIC_ID = '56302259723'
css
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Date_of_Birth, Weight FROM people ORDER BY Weight
nvbench
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cine...
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title
nvbench
CREATE TABLE table_11677691_8 ( position VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the kid from loganville, georgia play
SELECT position FROM table_11677691_8 WHERE hometown = "Loganville, Georgia"
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 ...
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '4972688' AND jyjgzbb.BGRQ BETWEEN '2004-08-25' AND '2006-05...
css
CREATE TABLE table_name_76 ( against VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the against for 17/02/1979?
SELECT against FROM table_name_76 WHERE date = "17/02/1979"
sql_create_context
CREATE TABLE table_29940 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Date" FROM table_29940 WHERE "Team" = 'New Orleans'
wikisql
CREATE TABLE table_name_5 ( games_played INTEGER, minutes VARCHAR, loses VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Games Played for Bo Oshoniyi, who had more than 1170 minutes and 10 loses?
SELECT AVG(games_played) FROM table_name_5 WHERE loses = 10 AND player = "bo oshoniyi" AND minutes > 1170
sql_create_context
CREATE TABLE table_22963 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 5th is the regular season what is the highest season?
SELECT MAX("Division") FROM table_22963 WHERE "Regular Season" = '5th'
wikisql
CREATE TABLE table_25098 ( "Post" real, "Horse name" text, "Trainer" text, "Jockey" text, "Opening Odds" text, "Starting Odds" text, "Finishing Pos." real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which post had the horse named chocolate can...
SELECT "Post" FROM table_25098 WHERE "Horse name" = 'Chocolate Candy'
wikisql
CREATE TABLE table_name_64 ( club VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club has tries for in the category tries for?
SELECT club FROM table_name_64 WHERE tries_for = "tries for"
sql_create_context
CREATE TABLE table_12567 ( "Coach" text, "Years coached" text, "Seasons" real, "Wins" real, "Losses" real, "Percentage" real, "Conference titles" text, "NCAA" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are coach Bill Henderson's...
SELECT MAX("Wins") FROM table_12567 WHERE "Coach" = 'bill henderson' AND "Losses" > '233'
wikisql
CREATE TABLE table_9851 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For what tournament was Bla Kav i the opponent in the final?
SELECT "Tournament" FROM table_9851 WHERE "Opponent in the final" = 'blaž kavčič'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT HOSP_DOC_CD, HOSP_DOC_NM FROM t_kc22 WHERE MED_CLINIC_ID = '95647491941'
css
CREATE TABLE table_13050003_3 ( steals VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of steals for 2012
SELECT COUNT(steals) FROM table_13050003_3 WHERE year = 2012
sql_create_context
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, ...
SELECT meter_400, ID FROM swimmer ORDER BY ID DESC
nvbench
CREATE TABLE table_66442 ( "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on 10 November 2006?
SELECT "Score" FROM table_66442 WHERE "Date" = '10 november 2006'
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 ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2155.0" AND diagnoses.icd9_code = "4240"
mimicsql_data
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE flight ( flno number(4,0), origin var...
SELECT destination, COUNT(destination) FROM flight WHERE price > 300 GROUP BY destination
nvbench
CREATE TABLE table_42621 ( "Name" text, "Position" text, "Number" real, "School/Club Team" text, "Season" text, "Acquisition via" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which School/ Club Team acquired Jondan Salvador via trade?
SELECT "School/Club Team" FROM table_42621 WHERE "Acquisition via" = 'trade' AND "Name" = 'jondan salvador'
wikisql
CREATE TABLE table_24638867_6 ( championship VARCHAR, outcome VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the championship for outcome being winner for 7 5, 4 6, 6 1
SELECT championship FROM table_24638867_6 WHERE outcome = "Winner" AND score = "7–5, 4–6, 6–1"
sql_create_context