instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_28054 ( "Episode no." real, "Airdate" text, "Dave Viewers" real, "Dave Rank" real, "Rank (cable)" real, "Dave ja vu Viewers" real, "Total viewers" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes aired on 2...
SELECT COUNT("Total viewers") FROM table_28054 WHERE "Airdate" = '25 October 2012'
wikisql
CREATE TABLE table_63351 ( "Season" real, "Team" text, "League" text, "Games" text, "Total Tackles" text, "Solo" text, "TFL\u00b9" text, "Sacks" text, "Int." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total tackles wh...
SELECT "Total Tackles" FROM table_63351 WHERE "Games" = '16' AND "Solo" = '88'
wikisql
CREATE TABLE table_name_58 ( ice_level_reporters VARCHAR, year VARCHAR, color_commentator_s_ VARCHAR, play_by_play VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Ice level reporter after 1992 with the color commentator John Davidson and th...
SELECT ice_level_reporters FROM table_name_58 WHERE color_commentator_s_ = "john davidson" AND play_by_play = "marv albert" AND year > 1992
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.Y...
css
CREATE TABLE Students ( date_of_latest_logon VARCHAR, family_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the dates of the latest logon of the students with family name 'Jaskolski' or 'Langosh'?
SELECT date_of_latest_logon FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh"
sql_create_context
CREATE TABLE table_203_699 ( id number, "name" text, "parentage" text, "size" text, "flower colour" text, "flower type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many flowers have the same type as the freedom bell ?
SELECT COUNT("name") FROM table_203_699 WHERE "name" <> 'freedom bell' AND "flower type" = (SELECT "flower type" FROM table_203_699 WHERE "name" = 'freedom bell')
squall
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name te...
SELECT DATEFROMPARTS(TIME_TO_STR(v.CreationDate, '%Y'), TIME_TO_STR(v.CreationDate, '%M'), 1) AS Month, 100.0 * COUNT(CASE WHEN v.VoteTypeId = 2 AND ClosedDate IS NULL AND DeletionDate IS NULL THEN 1 ELSE NULL END) / COUNT(DISTINCT p.Id) AS Pct FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2...
sede
CREATE TABLE table_204_771 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of silver medals won by peru and ecuador combi...
SELECT SUM("silver") FROM table_204_771 WHERE "nation" IN ('peru', 'ecuador')
squall
CREATE TABLE table_11318462_5 ( u16_2nd_viii VARCHAR, u15_3rd_iv VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are all the u16 2nd viii with u15 3rd iv being bbc
SELECT u16_2nd_viii FROM table_11318462_5 WHERE u15_3rd_iv = "BBC"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.age < "80"
mimicsql_data
CREATE TABLE table_23786 ( "Tournament" text, "Also currently known as" text, "City(s)" text, "Country" text, "Court surface" text, "Tier IV in" text, "Years" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the current tournament name...
SELECT "Also currently known as" FROM table_23786 WHERE "Tournament" = 'Tampa'
wikisql
CREATE TABLE table_19702 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team's result in week 4?
SELECT "Result" FROM table_19702 WHERE "Week" = '4'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cholecystectomy') AND DATETIME(procedures_icd.chartt...
mimic_iii
CREATE TABLE table_14758 ( "Series" text, "Name" text, "Hometown" text, "Occupation" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What series was Sam Evans on?
SELECT "Series" FROM table_14758 WHERE "Name" = 'sam evans'
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 MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5211360' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM HAVING AVG(PERSON_AGE) > 10
css
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
SELECT Time, meter_100 FROM swimmer ORDER BY Time
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-178495')) ORDER BY treatment.treatmenttime LIMIT 1
eicu
CREATE TABLE table_24949975_1 ( home_team VARCHAR, season VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team for the 2013 season and the result was 0 0?
SELECT home_team FROM table_24949975_1 WHERE season = "2013" AND result = "0–0"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.dob_year < "2090"
mimicsql_data
CREATE TABLE table_27196 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title when the writer is Emily H...
SELECT "Title" FROM table_27196 WHERE "Written by" = 'Emily Halpern'
wikisql
CREATE TABLE hosting_city ( year number, match_id number, host_city text ) CREATE TABLE match ( match_id number, date text, venue text, score text, result text, competition text ) CREATE TABLE temperature ( city_id number, jan number, feb number, mar number, apr...
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
spider
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...
SELECT Id FROM Users WHERE Reputation >= @rep ORDER BY NEWID() LIMIT 10
sede
CREATE TABLE hosting_city ( host_city VARCHAR ) CREATE TABLE city ( city VARCHAR, city_id VARCHAR ) CREATE TABLE temperature ( city_id VARCHAR, Feb INTEGER, Jun VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me a list of cities whose t...
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
sql_create_context
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varcha...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DETROIT' AND date_day.day_number = 21 AND date_day.month_number = 2 AND d...
atis
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) 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, meter_700 text, Time text ) CREATE...
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age ...
SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY COUNT(Open_Date) DESC
nvbench
CREATE TABLE table_34581 ( "Position" text, "Artist" text, "Single" text, "Year" text, "Weeks" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year did david whitfield win
SELECT "Year" FROM table_34581 WHERE "Artist" = 'david whitfield'
wikisql
CREATE TABLE table_30322 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the mens singles for lee eun-sil moon hyun-jung
SELECT "Mens Singles" FROM table_30322 WHERE "Womens Doubles" = 'Lee Eun-Sil Moon Hyun-Jung'
wikisql
CREATE TABLE table_name_45 ( current_club VARCHAR, position VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the current club with a position of sg/sf and a height less than 1.96?
SELECT current_club FROM table_name_45 WHERE position = "sg/sf" AND height < 1.96
sql_create_context
CREATE TABLE table_46753 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the T4 Place Player with a Score of more than 66?
SELECT "Player" FROM table_46753 WHERE "Score" > '66' AND "Place" = 't4'
wikisql
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) C...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_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...
atis
CREATE TABLE table_31112 ( "Provider" text, "Country" text, "Subscribers (2005) (thousands)" real, "Subscribers (2006) (thousands)" real, "Growth %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest number of 2005 subscribers for Vod...
SELECT MIN("Subscribers (2005) (thousands)") FROM table_31112 WHERE "Provider" = 'Vodafone'
wikisql
CREATE TABLE table_25594271_2 ( loa__metres_ VARCHAR, skipper VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many LOA metres were there when the skipper is lou abrahams?
SELECT loa__metres_ FROM table_25594271_2 WHERE skipper = "Lou Abrahams"
sql_create_context
CREATE TABLE table_name_7 ( county VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which county is named broderick wood products?
SELECT county FROM table_name_7 WHERE name = "broderick wood products"
sql_create_context
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.IN_DIAG_DIS_NM = '器质性心境[情感]障碍' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.IN_DIAG_DIS_NM = '器质性心境[情感]障碍'
css
CREATE TABLE table_42064 ( "Season" text, "Conf." text, "Conf. finish" text, "Div." text, "Div. Finish" text, "Head coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the division when Jim O'Brien was the head coach and the team fini...
SELECT "Div." FROM table_42064 WHERE "Div. Finish" = '2nd' AND "Head coach" = 'jim o''brien'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime ti...
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9566) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'other cells') AND DATETIME(labevents.charttime, 'start of month') = DATETIME...
mimic_iii
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "55" AND prescriptions.route = "TD"
mimicsql_data
CREATE TABLE table_name_63 ( memory VARCHAR, chipset VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which model's chipset is intel 955?
SELECT memory FROM table_name_63 WHERE chipset = "intel 955"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY) DESC
nvbench
CREATE TABLE table_name_49 ( result VARCHAR, year VARCHAR, episode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of nomination for Season 6 after 1995?
SELECT result FROM table_name_49 WHERE year > 1995 AND episode = "season 6"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
SELECT Posts.Id, 1 AS question, 1 AS upvote FROM Posts LEFT JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.PostTypeId = 1 AND Votes.VoteTypeId = 2 GROUP BY Posts.Id LIMIT 100 UNION ALL SELECT Posts.Id, 0 AS question, 1 AS upvote FROM Posts LEFT JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.PostTypeId = 2 AND Vot...
sede
CREATE TABLE table_name_47 ( races VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many races did he do in the year he had 8 points?
SELECT races FROM table_name_47 WHERE points = "8"
sql_create_context
CREATE TABLE table_49166 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place had a score of 71-70=141?
SELECT "Place" FROM table_49166 WHERE "Score" = '71-70=141'
wikisql
CREATE TABLE table_2818164_2 ( production_code INTEGER, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the production code of the episode originally aired on February 21, 1985?
SELECT MIN(production_code) FROM table_2818164_2 WHERE original_air_date = "February 21, 1985"
sql_create_context
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ci...
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname) DESC
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code
nvbench
CREATE TABLE table_211791_1 ( remarks VARCHAR, nato_reporting_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the remarks for sawhouse
SELECT remarks FROM table_211791_1 WHERE nato_reporting_name = "SAWHOUSE"
sql_create_context
CREATE TABLE chip_model ( Model_name text, Launch_year real, RAM_MiB real, ROM_MiB real, Slots text, WiFi text, Bluetooth text ) CREATE TABLE phone ( Company_name text, Hardware_Model_name text, Accreditation_type text, Accreditation_level text, Date text, chip_model...
SELECT Company_name, COUNT(Company_name) FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Graphics" GROUP BY Company_name ORDER BY Company_name
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...
SELECT zyjybgb.KSBM, zyjybgb.KSMC FROM zyjybgb WHERE zyjybgb.BGDH = '74592684851' UNION SELECT mzjybgb.KSBM, mzjybgb.KSMC FROM mzjybgb WHERE mzjybgb.BGDH = '74592684851'
css
CREATE TABLE table_name_17 ( no_5 VARCHAR, no_6 VARCHAR, no_10 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was No. 5 when No. 6 Mason and No. 10 Jackson?
SELECT no_5 FROM table_name_17 WHERE no_6 = "mason" AND no_10 = "jackson"
sql_create_context
CREATE TABLE table_name_17 ( house_1950 VARCHAR, governors_1950 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for House 1950 with a 1950 less than 1980, and Governors 1950 of governors 1970?
SELECT house_1950 FROM table_name_17 WHERE 1950 < 1980 AND governors_1950 = "governors 1970"
sql_create_context
CREATE TABLE table_203_238 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in how many international competitions did kazlou throw a length of above 80 meters ...
SELECT COUNT("competition") FROM table_203_238 WHERE "notes" > 80
squall
CREATE TABLE table_name_44 ( kit_maker VARCHAR, manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which kit maker have Trond Sollied as a manager?
SELECT kit_maker FROM table_name_44 WHERE manager = "trond sollied"
sql_create_context
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 Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY SUM(Weight) DESC
nvbench
CREATE TABLE perpetrator ( perpetrator_id number, people_id number, date text, year number, location text, country text, killed number, injured number ) CREATE TABLE people ( people_id number, name text, height number, weight number, home town text ) -- Using valid...
SELECT name FROM people ORDER BY height
spider
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road
nvbench
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 trip ( id number, duration ...
SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING AVG(bikes_available) > 10 EXCEPT SELECT name FROM station WHERE city = "San Jose"
spider
CREATE TABLE catalog_contents ( catalog_entry_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of all the catalog entries.
SELECT DISTINCT (catalog_entry_name) FROM catalog_contents
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '范慧捷' AND t_kc21.IN_HOSP_DATE BETWEEN '200...
css
CREATE TABLE table_name_61 ( laps VARCHAR, manufacturer VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps did the driver with the yamaha manufacturer go on grid 3?
SELECT laps FROM table_name_61 WHERE manufacturer = "yamaha" AND grid = 3
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(t_kc21.IN_DIAG_DIS_CD) FROM t_kc21 WHERE t_kc21.PERSON_ID = '22994447' AND t_kc21.IN_HOSP_DATE BETWEEN '2012-01-31' AND '2017-08-07'
css
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 COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5434543' AND qtb.IN_HOSP_DATE BETWEEN '2002-03-09' AND '2009-04-14' AND qtb.INSU_TYPE = '儿童' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5434543' AND gyb.IN_HOSP_DATE BETWEEN '2002-03-09' AND '2009-04-14' AND gyb.INSU_TYPE = '儿童' UNION SELECT COUNT(*) ...
css
CREATE TABLE table_12817 ( "Date" text, "Team" text, "Competition" text, "Round" text, "Opponent" text, "Location" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of the competition on October 25?
SELECT "Score" FROM table_12817 WHERE "Date" = 'october 25'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Paraplegia" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_12032893_1 ( home_town VARCHAR, high_school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home town was the high school Catholic University located in?
SELECT home_town FROM table_12032893_1 WHERE high_school = "Catholic University"
sql_create_context
CREATE TABLE table_36678 ( "Name" text, "Capacity" text, "Power" text, "Type" text, "Torque" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the torque of the 1.6 petrol with daewoo power?
SELECT "Torque" FROM table_36678 WHERE "Name" = '1.6 petrol' AND "Power" = 'daewoo'
wikisql
CREATE TABLE table_12751 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did Steve Stricker score?
SELECT "Score" FROM table_12751 WHERE "Player" = 'steve stricker'
wikisql
CREATE TABLE table_name_43 ( round INTEGER, pick__number VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first Round with a Pick # greater than 1 and 140 Overall?
SELECT MIN(round) FROM table_name_43 WHERE pick__number > 1 AND overall > 140
sql_create_context
CREATE TABLE settlements ( settlement_id number, claim_id number, effective_date time, settlement_amount number ) CREATE TABLE services ( service_id number, service_name text ) CREATE TABLE available_policies ( policy_id number, policy_type_code text, customer_phone text ) CREATE ...
SELECT t2.date_opened, t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE "%Diana%"
spider
CREATE TABLE table_318 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did robert nkemdiche go to college
SELECT "College" FROM table_318 WHERE "Player" = 'Robert Nkemdiche ‡'
wikisql
CREATE TABLE table_50626 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average crowd size for a home team...
SELECT AVG("Crowd") FROM table_50626 WHERE "Home team score" = '11.11 (77)'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmenti...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p thoracotomy' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURREN...
eicu
CREATE TABLE table_516 ( "Series Ep #" real, "Season 2 Ep #" real, "Title" text, "Director" text, "Writer(s)" text, "Original Airdate" text, "Production Code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the production code of the ...
SELECT MAX("Production Code") FROM table_516 WHERE "Title" = 'But There''s Clay'
wikisql
CREATE TABLE table_15323 ( "Version" text, "Code name" text, "Release date" text, "API level" real, "Distribution" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- with api level 3, what is the code name?
SELECT "Code name" FROM table_15323 WHERE "API level" = '3'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename...
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'mirella lapata' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_30840 ( "Age" real, "Date" text, "Track" text, "Race" text, "Distance (miles)" text, "Jockey" text, "Handicap" text, "Field (No. horses)" text, "Place" text, "Time" text, "Prize Money" text, "+ Sweepstake" text, "Archer\u2019s winnings" text ) -- ...
SELECT "Handicap" FROM table_30840 WHERE "Prize Money" = '120s'
wikisql
CREATE TABLE table_39368 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record after game 41?
SELECT "Record" FROM table_39368 WHERE "Game" = '41'
wikisql
CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE student ( stu_num number, stu_lname text...
SELECT T4.crs_description, T4.crs_credit FROM class AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'
spider
CREATE TABLE table_name_83 ( away_team VARCHAR, crowd INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the away team when the crowd was larger than 8,000?
SELECT away_team AS score FROM table_name_83 WHERE crowd > 8 OFFSET 000
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Kidney dialysis as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time o...
mimicsql_data
CREATE TABLE table_51512 ( "Channel" real, "Video" text, "Aspect" text, "PSIP Short Name" text, "Network" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What network has an aspect of 4:3 and a PSIP Short Name of qvc?
SELECT "Network" FROM table_51512 WHERE "Aspect" = '4:3' AND "PSIP Short Name" = 'qvc'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Accid in resident instit" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_204_697 ( id number, "song" text, "artist(s)" text, "concert" number, "film" number, "1978 album" number, "2002 album" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the largest number of films ?
SELECT MAX("film") FROM table_204_697
squall
CREATE TABLE Maintenance_Engineers ( engineer_id VARCHAR, first_name VARCHAR, last_name VARCHAR ) CREATE TABLE Engineer_Visits ( engineer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Among those engineers who have visited, which engineer makes ...
SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id = T2.engineer_id GROUP BY T1.engineer_id ORDER BY COUNT(*) LIMIT 1
sql_create_context
CREATE TABLE table_25685 ( "Autonomous Community" text, "Organization" text, "Television Channels" text, "Radio Stations" text, "Foundation" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the autonomous community with television channels tpa...
SELECT "Autonomous Community" FROM table_25685 WHERE "Television Channels" = 'TPA TPA2 RTPA Internacional'
wikisql
CREATE TABLE table_55101 ( "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. -- In which venue is South Melbourne the home team?...
SELECT "Venue" FROM table_55101 WHERE "Home team" = 'south melbourne'
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 WHERE demographic.age < "49" AND demographic.days_stay > "3"
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
mimic_iii
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480')) AND lab.labname = 'bedside glucose' AND lab.labresulttime = '2105...
eicu
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Tags ( Id num...
SELECT rt.Name, COUNT(*) FROM Posts AS p INNER JOIN ReviewTasks AS r ON r.PostId = p.Id INNER JOIN ReviewTaskTypes AS rt ON rt.Id = r.ReviewTaskTypeId WHERE p.PostTypeId = 1 OR p.PostTypeId = 2 GROUP BY rt.Name
sede
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.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '周锐志' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6373.39)
css
CREATE TABLE table_5326 ( "Bullet weight gram (grain)" text, "8.23 g (127 gr)" real, "9.72 g (150 gr)" real, "11.34 g (175 gr)" real, "12.96 g (200 gr)" real, "14.26 g (220 gr)" real, "Case capacity (%)" real ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT MAX("8.23 g (127 gr)") FROM table_5326 WHERE "Bullet weight gram (grain)" = '8x64mm s' AND "Case capacity (%)" < '110.3'
wikisql
CREATE TABLE table_name_13 ( sydney VARCHAR, auckland VARCHAR, gold_coast VARCHAR, adelaide VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Sydney has a Gold Coast of yes, an Adelaide of no, and an Auckland of yes?
SELECT sydney FROM table_name_13 WHERE gold_coast = "yes" AND adelaide = "no" AND auckland = "yes"
sql_create_context
CREATE TABLE table_204_278 ( id number, "name of president" text, "picture" text, "life span" text, "year of presidency" text, "place of conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the first president in the 1900 's ?
SELECT "name of president" FROM table_204_278 WHERE "year of presidency" >= 1900 ORDER BY "year of presidency" LIMIT 1
squall
CREATE TABLE table_1717824_1 ( _percentage_2011 VARCHAR, province VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the percentage in Manitoba in 2011?
SELECT _percentage_2011 FROM table_1717824_1 WHERE province = "Manitoba"
sql_create_context
CREATE TABLE table_name_53 ( song VARCHAR, artist_s_ VARCHAR, work_done VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2006 Cobra Starship song has work done of guest vocals?
SELECT song FROM table_name_53 WHERE work_done = "guest vocals" AND year = 2006 AND artist_s_ = "cobra starship"
sql_create_context