instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airlin...
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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'B...
atis
CREATE TABLE table_22515 ( "Number" real, "Sanskrit" text, "International Alphabet of Sanskrit Transliteration" text, "Sanskrit gloss" text, "Western name" text, "Greek" text, "Gloss" text, "Tattva (Element)" text, "Quality" text, "Ruling Planet" text ) -- Using valid SQLite, a...
SELECT COUNT("Quality") FROM table_22515 WHERE "Sanskrit gloss" = 'scorpion'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
SELECT q.Id AS "post_link" FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = '##UserId##' AND q.Body LIKE '%##Text##%'
sede
CREATE TABLE table_75641 ( "Poll Source" text, "Date" text, "Candidate" text, "Support" text, "Consider" text, "Oppose" text, "Unsure" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of people were opposed to the candidate bas...
SELECT "Oppose" FROM table_75641 WHERE "Poll Source" = 'time poll' AND "Unsure" = '6%'
wikisql
CREATE TABLE table_50189 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Opponent in the match with a Score of 6 3, 6 4?
SELECT "Opponent" FROM table_50189 WHERE "Score" = '6–3, 6–4'
wikisql
CREATE TABLE table_name_82 ( record VARCHAR, home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which Record has a Home of ottawa senators on Date of december 21?
SELECT record FROM table_name_82 WHERE home = "ottawa senators" AND date = "december 21"
sql_create_context
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state ...
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY credit_score DESC
nvbench
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON'...
atis
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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_MZ...
css
CREATE TABLE table_name_69 ( date VARCHAR, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date with a Runner(s)-up that is jerry steelsmith?
SELECT date FROM table_name_69 WHERE runner_s__up = "jerry steelsmith"
sql_create_context
CREATE TABLE table_79110 ( "Round" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the zolder circuit, which had a.z.k./roc-comp tition a.z.k./roc-comp titio...
SELECT "Date" FROM table_79110 WHERE "Winning team" = 'a.z.k./roc-compétition a.z.k./roc-compétition' AND "Circuit" = 'zolder'
wikisql
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 Openning_year, SUM(Capacity) FROM cinema GROUP BY Openning_year
nvbench
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE ground_service ( city_code text, airport_co...
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 table_23080 ( "Scorecard" real, "Date" text, "Venue" text, "Team 1" text, "Team 2" text, "Result" text, "Man of the Match" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many scorecards are there for the match on October 28?...
SELECT COUNT("Scorecard") FROM table_23080 WHERE "Date" = 'October 28'
wikisql
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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 tim...
SELECT mzjzjlb.MZZYZDZZBM, mzjzjlb.MZZYZDZZMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '74461685601'
css
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGui...
SELECT Reputation, SUM(COUNT(*)) OVER (ORDER BY Reputation ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS UserCount, COUNT(*) AS total FROM Users GROUP BY Reputation ORDER BY Reputation
sede
CREATE TABLE table_30133 ( "No. in series" real, "No. in season" 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. -- when was the episo...
SELECT "Original air date" FROM table_30133 WHERE "Title" = 'Cracked'
wikisql
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 Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
nvbench
CREATE TABLE table_28898974_3 ( reason VARCHAR, electorate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When peninsula is the electorate what is the reason?
SELECT reason FROM table_28898974_3 WHERE electorate = "Peninsula"
sql_create_context
CREATE TABLE table_46324 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Bonus Points" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Points difference" FROM table_46324 WHERE "Points against" = '451'
wikisql
CREATE TABLE table_56731 ( "Edition" real, "Zone" text, "Round" text, "Date" text, "Against" text, "Surface" text, "Partner" text, "Opponents" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was against the opponent...
SELECT "Against" FROM table_56731 WHERE "Opponents" = 'mădălina gojnea monica niculescu'
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "2752" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_71790 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which years was the to par +6?
SELECT "Year(s) won" FROM table_71790 WHERE "To par" = '+6'
wikisql
CREATE TABLE table_10568553_1 ( street_names VARCHAR, milepost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which street is 12.2 miles long?
SELECT street_names FROM table_10568553_1 WHERE milepost = "12.2"
sql_create_context
CREATE TABLE table_45366 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent in a week below 14 on October 10, 1993?
SELECT "Opponent" FROM table_45366 WHERE "Week" < '14' AND "Date" = 'october 10, 1993'
wikisql
CREATE TABLE table_name_83 ( away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Richmond's score when it was the away team?
SELECT away_team AS score FROM table_name_83 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE proced...
SELECT COUNT(*) > 0 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 = 15209)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'criticar...
mimic_iii
CREATE TABLE table_2076 ( "Player" text, "Years with Dodgers" text, "Role with Dodgers" text, "Inducted as" text, "Year inducted" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the inducted as for joe medwick category:articles with hcards
SELECT "Inducted as" FROM table_2076 WHERE "Player" = 'Joe Medwick Category:Articles with hCards'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'pericardial window' AND STRFTIME('%y', treatment.treatmenttime) >= '2105') GROUP BY patient.uniquepid) AS ...
eicu
CREATE TABLE table_name_99 ( week_9_oct_20 VARCHAR, week_17__final__jan_4 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is listed for the Week 9 Oct 20 that has a Week 17 (Final) Jan 4 of Michigan (10-3)?
SELECT week_9_oct_20 FROM table_name_99 WHERE week_17__final__jan_4 = "michigan (10-3)"
sql_create_context
CREATE TABLE table_14977 ( "Parameter" text, "N80 IEC1" text, "N90 IEC1" text, "N90 IEC2" text, "N100 IEC 2" text, "N100 IEC3" text, "N117/2400 IEC3" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the N117/2400 IEC3 associated with a...
SELECT "N117/2400 IEC3" FROM table_14977 WHERE "N100 IEC3" = '25'
wikisql
CREATE TABLE table_22297198_3 ( team VARCHAR, outgoing_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team did Alireza mansourian leave?
SELECT team FROM table_22297198_3 WHERE outgoing_manager = "Alireza Mansourian"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE food_service ( mea...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BALTIMORE' AND flight.to_airport = airport_service.airport_code
atis
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2156" AND diagnoses.short_title = "End stage renal disease"
mimicsql_data
CREATE TABLE table_16576 ( "Club" text, "Position in 2012\u201313" text, "First season in top division" text, "Number of seasons in top division" real, "Number of seasons in the Premier League" real, "First season of current spell in top division" text, "Top division titles" real, "Last ...
SELECT MIN("Number of seasons in top division") FROM table_16576
wikisql
CREATE TABLE table_54835 ( "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. -- What is the sum of crowds that saw hawthorn at h...
SELECT SUM("Crowd") FROM table_54835 WHERE "Home team" = 'hawthorn'
wikisql
CREATE TABLE table_34011 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent when attendance was 60,355?
SELECT "Opponent" FROM table_34011 WHERE "Attendance" = '60,355'
wikisql
CREATE TABLE table_203_134 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what player placed nest after dustin johnson ?
SELECT "player" FROM table_203_134 WHERE id = (SELECT id FROM table_203_134 WHERE "player" = 'dustin johnson') + 1
squall
CREATE TABLE table_10411 ( "Class" text, "Type" text, "Quantity" real, "Date" text, "LNER Class" text, "1946 LNER nos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the type 2-8-0 with a O4 LNER Class?
SELECT "Date" FROM table_10411 WHERE "Type" = '2-8-0' AND "LNER Class" = 'o4'
wikisql
CREATE TABLE table_20565 ( "Year" real, "GDP Nominal ($ billions)" text, "GDP Adjusted ($ billions)" text, "Population (millions)" text, "GDP per capita Nominal ($)" real, "GDP per capita Adjusted ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "GDP per capita Adjusted ($)" FROM table_20565 WHERE "Population (millions)" = '37.376'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, ...
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c...
atis
CREATE TABLE table_6652 ( "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 won in mixed doubles in 2008?
SELECT "Mixed doubles" FROM table_6652 WHERE "Year" = '2008'
wikisql
CREATE TABLE table_1566852_7 ( interview_subject VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- HOW MANY TIMES WAS LUDACRIS THE INTERVIEW SUBJECT FOR THE 20 QUESTIONS COLUMN?
SELECT COUNT(20 AS _questions) FROM table_1566852_7 WHERE interview_subject = "Ludacris"
sql_create_context
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank i...
SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE NOT Company_ID IN (SELECT Company_ID FROM station_company) GROUP BY Main_Industry ORDER BY Main_Industry DESC
nvbench
CREATE TABLE stadium ( average_attendance VARCHAR, capacity_percentage INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average attendance of stadiums with capacity percentage higher than 100%?
SELECT average_attendance FROM stadium WHERE capacity_percentage > 100
sql_create_context
CREATE TABLE table_name_55 ( against INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest Against with a Date of 18/02/1989?
SELECT MIN(against) FROM table_name_55 WHERE date = "18/02/1989"
sql_create_context
CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE region ( Region_id int, Region_code text, R...
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_23 ( height INTEGER, year_born VARCHAR, current_club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How tall was the member of Nymburk, who was born in 1982?
SELECT MAX(height) FROM table_name_23 WHERE year_born = 1982 AND current_club = "nymburk"
sql_create_context
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
nvbench
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TAB...
SELECT Id, Title, Body FROM Posts AS P WHERE PostTypeId = 1 AND Tags LIKE '%three.js%' AND YEAR(P.CreationDate) BETWEEN 2015 AND 2019
sede
CREATE TABLE table_67497 ( "Year" text, "Venue" text, "Winners" text, "Runner-up" text, "3rd place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who came in 3rd place in 1990?
SELECT "3rd place" FROM table_67497 WHERE "Year" = '1990'
wikisql
CREATE TABLE table_72752 ( "Rank" real, "City 1" text, "City 2" text, "2012 Passengers (in millions)" text, "2011 Passengers (in millions)" text, "Distance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city is listed first when Okinawa i...
SELECT "City 1" FROM table_72752 WHERE "City 2" = 'Okinawa'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT (SELECT t_kc24.PER_ACC_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '44533265221') / (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID = '4453326522...
css
CREATE TABLE table_17288869_6 ( date VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of game 21?
SELECT date FROM table_17288869_6 WHERE game = 21
sql_create_context
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 MED_CLINIC_ID FROM t_kc24 WHERE PERSON_ID = '46707920' AND CLINIC_SLT_DATE BETWEEN '2012-06-05' AND '2013-03-07'
css
CREATE TABLE table_203_192 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- at what competition did david receive the least position ?
SELECT "competition" FROM table_203_192 ORDER BY "position" DESC LIMIT 1
squall
CREATE TABLE table_76139 ( "Rank" real, "Name" text, "Years" text, "Matches" real, "Goals" real, "Goals/Matches" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years have goals less than 229, and 440 as matches?
SELECT "Years" FROM table_76139 WHERE "Goals" < '229' AND "Matches" = '440'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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)...
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_6077 ( "Image" text, "Father" text, "Birth" text, "Ceased to be Duchess" text, "Death" text, "Husband" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which father had william iv as a husband?
SELECT "Father" FROM table_6077 WHERE "Husband" = 'william iv'
wikisql
CREATE TABLE table_65734 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks have an Attendance of 62,289?
SELECT SUM("Week") FROM table_65734 WHERE "Attendance" = '62,289'
wikisql
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) -- Using valid SQLite, answer the following questions fo...
SELECT Type, COUNT(Type) FROM ship GROUP BY Nationality, Type
nvbench
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_leg ( flight_id int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.arrival_time <= 1000 AND flight.to_airport = AIRPORT_SERVICE_1.air...
atis
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 SOC_SRT_DIRE_NM, AMOUNT, MED_CLINIC_ID FROM t_kc22 WHERE (MED_CLINIC_ID = '80658951927' OR MED_CLINIC_ID = '39680464130') AND SOC_SRT_DIRE_NM IN ((SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '80658951927') INTERSECT (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '39680464130'))
css
CREATE TABLE table_name_96 ( name VARCHAR, debut VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the player that had a debut in round 6?
SELECT name FROM table_name_96 WHERE debut = "round 6"
sql_create_context
CREATE TABLE table_37053 ( "Position" real, "Driver" text, "Wins" real, "Poles" real, "Top 5's" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points are associated with over 1 top 5, 1 win, over 0 poles, and andrew range...
SELECT MAX("Points") FROM table_37053 WHERE "Top 5's" > '1' AND "Wins" = '1' AND "Poles" > '0' AND "Driver" = 'andrew ranger'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( ...
SELECT Score, Text, PostId AS "post_link" FROM Comments WHERE UserId = '##UserId:int##' ORDER BY Score DESC
sede
CREATE TABLE mill ( Id VARCHAR ) CREATE TABLE architect ( name VARCHAR, nationality VARCHAR, id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the distinct names and nationalities of the architects who have ever built a mill?
SELECT DISTINCT T1.name, T1.nationality FROM architect AS T1 JOIN mill AS t2 ON T1.id = T2.architect_id
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_2221484_2 ( original_air_date VARCHAR, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did episode 258 in the series originally air?
SELECT original_air_date FROM table_2221484_2 WHERE series__number = 258
sql_create_context
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREAT...
SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY destination
nvbench
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_Course_Enrolment ( registration_...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass"
nvbench
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 mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '69072554' UNION SELECT hz_info_zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjz...
css
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT q.Id AS "post_link", q.Title, q.Tags, a.Score FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId AND a.PostTypeId = 2 AND q.PostTypeId = 1 WHERE a.CommunityOwnedDate IS NULL AND a.OwnerUserId = '##UserId##' AND q.Tags LIKE '%jquery%' AND NOT q.Tags LIKE '%javascript%' ORDER BY a.Score DESC
sede
CREATE TABLE table_76508 ( "Finished" text, "Horse" text, "Jockey" text, "Trainer" text, "Odds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Jockey that has Nick Zito as Trainer and Odds of 34-1?
SELECT "Jockey" FROM table_76508 WHERE "Trainer" = 'nick zito' AND "Odds" = '34-1'
wikisql
CREATE TABLE table_13114 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which shooter was the olympic bronze medalist?
SELECT "Shooter" FROM table_13114 WHERE "Total" = 'olympic bronze medalist'
wikisql
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 MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '75834844' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC
css
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "DMII renl nt st uncntrld" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_19872699_1 ( builder VARCHAR, skipper VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who build the boat where Ken Read was the skipper?
SELECT builder FROM table_19872699_1 WHERE skipper = "Ken Read"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK"
mimicsql_data
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) 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...
SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200
nvbench
CREATE TABLE table_43535 ( "Name" text, "Country" text, "Type" text, "Moving from" text, "Transfer window" text, "Ends" real, "Transfer fee" text, "Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type when 120,000 is t...
SELECT "Type" FROM table_43535 WHERE "Transfer fee" = '£120,000'
wikisql
CREATE TABLE table_name_16 ( tries_for VARCHAR, played VARCHAR, points_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value for the item 'Tries' when the value of the item 'Played' is 18 and the value of the item 'Points' is 375?
SELECT tries_for FROM table_name_16 WHERE played = "18" AND points_against = "375"
sql_create_context
CREATE TABLE building ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many buildings are there?
SELECT COUNT(*) FROM building
sql_create_context
CREATE TABLE table_32882 ( "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 grid 3?
SELECT "Time/Retired" FROM table_32882 WHERE "Grid" = '3'
wikisql
CREATE TABLE table_35860 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the averae top 25 with events less than 0
SELECT AVG("Top-25") FROM table_35860 WHERE "Events" < '0'
wikisql
CREATE TABLE table_name_94 ( saturated_fat VARCHAR, total_fat VARCHAR, polyunsaturated_fat VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the saturated fat with a total fat of 100g and 11g of polyunsaturated fat?
SELECT saturated_fat FROM table_name_94 WHERE total_fat = "100g" AND polyunsaturated_fat = "11g"
sql_create_context
CREATE TABLE table_40868 ( "Played" text, "Wins" text, "Losses" text, "Tied" text, "Win %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was tied at 15 played?
SELECT "Tied" FROM table_40868 WHERE "Played" = '15'
wikisql
CREATE TABLE table_204_443 ( id number, "week" number, "date" text, "opponent" text, "result" text, "game site" text, "attendance" number, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference in attendance between ...
SELECT ABS((SELECT "attendance" FROM table_204_443 ORDER BY "date" LIMIT 1) - (SELECT "attendance" FROM table_204_443 ORDER BY "date" DESC LIMIT 1))
squall
CREATE TABLE table_52100 ( "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Diff" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the difference with a loss smaller than 5 and points lower than 32...
SELECT COUNT("Diff") FROM table_52100 WHERE "Lost" < '5' AND "Points" < '32'
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "56212" AND prescriptions.route = "ED"
mimicsql_data
CREATE TABLE table_28969 ( "Species" text, "Common Name" text, "Protein Name" text, "Accession Number" text, "NT Length" text, "NT Identity" text, "AA Length" text, "AA Identity" text, "E-Value" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Protein Name" FROM table_28969 WHERE "AA Length" = '202 aa'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id num...
WITH Questions AS (SELECT *, (SELECT SUM(A.Score) FROM Posts AS A WHERE A.ParentId = Q.Id) AS "answerscore", (CASE WHEN NOT Q.AcceptedAnswerId IS NULL OR EXISTS(SELECT * FROM Posts AS A WHERE A.ParentId = Q.Id AND A.Score > 0) THEN 1 ELSE 0 END) AS "answered" FROM Posts AS Q WHERE Q.PostTypeId = 1 AND Q.Score <= @MaxVo...
sede
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Oxygen"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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.Y...
css
CREATE TABLE table_name_95 ( standard_cost__usd_ VARCHAR, creator VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Standard cost (USD) of Kwin team creator?
SELECT standard_cost__usd_ FROM table_name_95 WHERE creator = "kwin team"
sql_create_context
CREATE TABLE table_204_415 ( id number, "season" text, "tier" number, "division" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is his/her best ranking season ?
SELECT "season" FROM table_204_415 ORDER BY "place" LIMIT 1
squall
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count ...
SELECT p.CreationDate, p.Body, p.Id AS "post_link" FROM Posts AS p WHERE p.PostTypeId = 2 AND p.Body LIKE '%##keyword1##%'
sede
CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), ...
SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY budget
nvbench
CREATE TABLE VISITORS ( Tourist_Details VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show details of all visitors.
SELECT Tourist_Details FROM VISITORS
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text...
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na...
atis