instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_38 ( category VARCHAR, awards VARCHAR, year VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What category was nominated in 2010 fo the British Soap Awards?
SELECT category FROM table_name_38 WHERE year = 2010 AND result = "nominated" AND awards = "british soap awards"
sql_create_context
CREATE TABLE table_57557 ( "Stations" text, "Place" text, "Managed By" text, "Platforms" real, "Zone" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average zone for waddon marsh tram stop
SELECT AVG("Zone") FROM table_57557 WHERE "Stations" = 'waddon marsh tram stop'
wikisql
CREATE TABLE table_41272 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Result, when Director is Veljko Bulaji category:articles...
SELECT "Result" FROM table_41272 WHERE "Director" = 'veljko bulajić category:articles with hcards' AND "Original title" = 'sarajevski atentat'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, subject_i...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435) AND prescriptions.drug = 'gentamicin sulfate' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-11'
mimic_iii
CREATE TABLE table_46566 ( "Year" real, "Championship" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the winning score in the year 2002?
SELECT "Winning score" FROM table_46566 WHERE "Year" = '2002'
wikisql
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2180.0"
mimicsql_data
CREATE TABLE table_203_812 ( 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 total amount of nations with more than 5 bronze medal...
SELECT COUNT("nation") FROM table_203_812 WHERE "bronze" > 5
squall
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE state ( state_code text, state...
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 = 'ST. PETERSBURG' AND date_day.day_number = 22 AND date_day.month_number = ...
atis
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '马浩浩' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 459.68)
css
CREATE TABLE table_67376 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT SUM("Position") FROM table_67376 WHERE "Goal Difference" < '-11' AND "Played" < '38'
wikisql
CREATE TABLE table_name_63 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team at Junction Oval?
SELECT away_team FROM table_name_63 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_7540 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What set 2 has 15:33 as the time?
SELECT "Set 2" FROM table_7540 WHERE "Time" = '15:33'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.label = "Lactate Dehydrogenase, Pleural"
mimicsql_data
CREATE TABLE table_13719 ( "Sr No" real, "Name" text, "Locale" text, "Height" text, "Floors" real, "Building Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name that had 46 floors?
SELECT "Name" FROM table_13719 WHERE "Floors" = '46'
wikisql
CREATE TABLE table_3511 ( "Outcome" text, "No." text, "Date" text, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many outcomes occur on the date of ...
SELECT COUNT("Outcome") FROM table_3511 WHERE "Date" = 'January 31, 2010'
wikisql
CREATE TABLE table_79025 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MAX("Losses") FROM table_79025 WHERE "Goal Difference" > '26'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') ORDER BY labevents.valuenum DESC,...
mimic_iii
CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, pa...
SELECT T1.county_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.county_id = T2.district GROUP BY T1.county_id
spider
CREATE TABLE table_23114705_7 ( original_air_date VARCHAR, nz_viewers__thousand_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the air date of the episod that had 456.58 thousand viewers?
SELECT original_air_date FROM table_23114705_7 WHERE nz_viewers__thousand_ = "456.58"
sql_create_context
CREATE TABLE table_2439 ( "Position" real, "Driver" text, "Points" real, "Winnings" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which drivers won $40,000 in the NASCAR Winston Cup?
SELECT "Driver" FROM table_2439 WHERE "Series" = 'NASCAR Winston Cup' AND "Winnings" = '$40,000'
wikisql
CREATE TABLE race ( track_id VARCHAR ) CREATE TABLE track ( name VARCHAR, location VARCHAR, track_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the name and location of track with 1 race.
SELECT T2.name, T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id HAVING COUNT(*) = 1
sql_create_context
CREATE TABLE table_name_16 ( day_1 VARCHAR, day_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the day 1 when the day 3 is math?
SELECT day_1 FROM table_name_16 WHERE day_3 = "math"
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_66599 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the notes for 2005?
SELECT "Notes" FROM table_66599 WHERE "Year" = '2005'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGD...
css
CREATE TABLE table_35714 ( "Province" text, "Kibaki" text, "Raila" text, "Wamalwa" text, "Ngilu" text, "Others" text, "Registered Voters" text, "Turnout %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is listed for the Province wi...
SELECT "Province" FROM table_35714 WHERE "Wamalwa" = '4,431'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ...
SELECT DATEADD(week, DATEDIFF(week, 0, CreationDate), 0), COUNT(*) FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId WHERE pt.TagId = 93513 AND q.CreationDate > '2016-07-10' GROUP BY DATEADD(week, DATEDIFF(week, 0, CreationDate), 0) ORDER BY DATEADD(week, DATEDIFF(week, 0, CreationDate), 0)
sede
CREATE TABLE table_name_7 ( producer_s_ VARCHAR, track VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who produced track 7?
SELECT producer_s_ FROM table_name_7 WHERE track = 7
sql_create_context
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'eosinophils') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14054) AND STRFTIME('%y', labevents.charttime) >= '2105'
mimic_iii
CREATE TABLE table_name_52 ( rider VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the rider who had the time of 1:27.37.22?
SELECT rider FROM table_name_52 WHERE time = "1:27.37.22"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it...
mimic_iii
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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_type = "ELECTIVE"
mimicsql_data
CREATE TABLE table_name_72 ( fa_cup INTEGER, name VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of goals scored in the FA Cup by Whelan where he had more than 7 total goals?
SELECT AVG(fa_cup) FROM table_name_72 WHERE name = "whelan" AND total > 7
sql_create_context
CREATE TABLE table_1036189_1 ( bullet_tip_color VARCHAR, headstamp_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the headstamp id of h2, what was the color of the bullet tip?
SELECT bullet_tip_color FROM table_1036189_1 WHERE headstamp_id = "H2"
sql_create_context
CREATE TABLE table_name_5 ( date VARCHAR, result VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Result of w, and a Competition of 1968 asian cup happened on what date?
SELECT date FROM table_name_5 WHERE result = "w" AND competition = "1968 asian cup"
sql_create_context
CREATE TABLE table_46735 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is College, when Round is greater than 1, and when Pick is greater than 163?
SELECT "College" FROM table_46735 WHERE "Round" > '1' AND "Pick" > '163'
wikisql
CREATE TABLE table_2449 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did Renger Van Der Zande have the p...
SELECT "Date" FROM table_2449 WHERE "Pole Position" = 'Renger van der Zande' AND "Circuit" = 'Donington Park'
wikisql
CREATE TABLE table_79215 ( "Actor" text, "Character" text, "Soap Opera" text, "Years" text, "Duration" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which years did Martin Sacks work on a soap opera?
SELECT "Years" FROM table_79215 WHERE "Actor" = 'martin sacks'
wikisql
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_AGE >= 15 UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_AGE >= 15)
css
CREATE TABLE table_53983 ( "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. -- Who was the away team at South Melbourne with a ...
SELECT "Home team" FROM table_53983 WHERE "Crowd" > '10,000' AND "Away team" = 'south melbourne'
wikisql
CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers number, residents_per_officer number, case_burden number, crime_rate number, police_force text, location text ) CREATE TABLE city ( city_id number, county_id number, name ...
SELECT DISTINCT police_force FROM county_public_safety WHERE location <> "East"
spider
CREATE TABLE table_10896 ( "Electorate" text, "Incumbent" text, "Winner" text, "Majority" real, "Runner up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won with a majority more than 6,181 and J W Andrews as runner up?
SELECT "Winner" FROM table_10896 WHERE "Majority" > '6,181' AND "Runner up" = 'j w andrews'
wikisql
CREATE TABLE table_39795 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Position when the against i...
SELECT MAX("Position") FROM table_39795 WHERE "Against" < '41' AND "Lost" > '7'
wikisql
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'K19.872' AND jyjgzbb.JCZBDM = '...
css
CREATE TABLE table_56990 ( "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 date for home team Collingwood?
SELECT "Date" FROM table_56990 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE table_203_631 ( id number, "year" number, "name of show" text, "episodes" text, "other guests" text, "winner(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long has it been since chermaine sheh first appeared on a variety sh...
SELECT present_ref - MIN("year") FROM table_203_631
squall
CREATE TABLE table_61056 ( "Role" text, "Original Broadway cast" text, "Closing Broadway cast" text, "Original US Tour cast" text, "Original NonEquity Tour cast" text, "Original S\u00e3o Paulo cast" text, "Original Lima cast" text ) -- Using valid SQLite, answer the following questions for...
SELECT "Original NonEquity Tour cast" FROM table_61056 WHERE "Original Broadway cast" = 'kevin chamberlin'
wikisql
CREATE TABLE table_20507 ( "Region of USSR" text, "Number of families" real, "Number of people" real, "Average family size" text, "% of total deportees" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What regions of the USSR have a percentage of dep...
SELECT "Region of USSR" FROM table_20507 WHERE "% of total deportees" = '10.6'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardi...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5 normal saline' A...
mimic_iii
CREATE TABLE table_203_462 ( id number, "year" number, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was the only year the team qualified for the...
SELECT "year" FROM table_203_462 WHERE "playoffs" <> 'did not qualify'
squall
CREATE TABLE table_65017 ( "District" text, "Number of Households" real, "Total Population" real, "Male" real, "Female" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest female number of the hiroo 1-ch me district, which has more tha...
SELECT MIN("Female") FROM table_65017 WHERE "District" = 'hiroo 1-chōme' AND "Number of Households" > '1,666'
wikisql
CREATE TABLE table_9042 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which record has an Attendance larger than 17,0...
SELECT "Record" FROM table_9042 WHERE "Attendance" > '17,033' AND "Location" = 'air canada centre' AND "Points" < '3'
wikisql
CREATE TABLE table_50006 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the tie number for the round against visiting opponent Chelsea?
SELECT SUM("Tie no") FROM table_50006 WHERE "Away team" = 'chelsea'
wikisql
CREATE TABLE table_60228 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which circuit did alfa romeo win?
SELECT "Circuit" FROM table_60228 WHERE "Winning constructor" = 'alfa romeo'
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_ORG_DEPT_NM, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '1537137' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD
css
CREATE TABLE table_35277 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tries agai...
SELECT "Try bonus" FROM table_35277 WHERE "Tries against" = '55'
wikisql
CREATE TABLE table_38892 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of game had a result of 1:2?
SELECT "Type of game" FROM table_38892 WHERE "Results\u00b9" = '1:2'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id ...
SELECT t3.drug FROM (SELECT t2.drug, 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 = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_name_80 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which score has a record of 58 15 8?
SELECT score FROM table_name_80 WHERE record = "58–15–8"
sql_create_context
CREATE TABLE table_204_311 ( 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 difference between the total number of bronze medals ...
SELECT (SELECT "bronze" FROM table_204_311 WHERE "nation" = 'united states') - (SELECT "bronze" FROM table_204_311 WHERE "nation" = 'west germany')
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_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '葛晴画' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6196.22)
css
CREATE TABLE table_12714 ( "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 Score of the Round with Player Aaron Baddeley having a To par of +2?
SELECT "Score" FROM table_12714 WHERE "To par" = '+2' AND "Player" = 'aaron baddeley'
wikisql
CREATE TABLE table_41308 ( "Album" text, "Release date" text, "Label" text, "Format" text, "Covered Song" text, "Original Song" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What label shows an Album of cover version v?
SELECT "Label" FROM table_41308 WHERE "Album" = 'cover version v'
wikisql
CREATE TABLE table_name_53 ( january VARCHAR, april VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the january when april is courtney rachel culkin
SELECT january FROM table_name_53 WHERE april = "courtney rachel culkin"
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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
SELECT JOB_TITLE, AVG(SALARY) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.JOB_TITLE ORDER BY AVG(SALARY)
nvbench
CREATE TABLE table_name_21 ( score VARCHAR, to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a To par of +4, what is Andy Bean's Score?
SELECT score FROM table_name_21 WHERE to_par = "+4" AND player = "andy bean"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
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 >= 2959.88)
css
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 T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC
nvbench
CREATE TABLE table_21694 ( "Winner" text, "Country" text, "Winter Olympics" text, "FIS Nordic World Ski Championships" text, "Holmenkollen" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did the man from Norway who won the Holmenkollen in ...
SELECT "FIS Nordic World Ski Championships" FROM table_21694 WHERE "Country" = 'Norway' AND "Holmenkollen" = '1958'
wikisql
CREATE TABLE table_name_69 ( title VARCHAR, start_of_reign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Title's Start of Reign is 1993?
SELECT title FROM table_name_69 WHERE start_of_reign = 1993
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( ...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'obstruction of trachea / bronchus - susp...
eicu
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 t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_2897457_5 ( pick__number VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What pick number was marc deschamps?
SELECT pick__number FROM table_2897457_5 WHERE player = "Marc Deschamps"
sql_create_context
CREATE TABLE table_38848 ( "Institution" text, "Location" text, "Team Nickname" text, "Tenure" text, "New Conference" text, "New Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the new classification for La Mirada, Califor...
SELECT "New Classification" FROM table_38848 WHERE "Location" = 'la mirada, california'
wikisql
CREATE TABLE table_60922 ( "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 what place did Nick Faldo, who had more than 284 points and a to par score of +...
SELECT "Finish" FROM table_60922 WHERE "Total" > '284' AND "To par" = '+5' AND "Player" = 'nick faldo'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_i...
SELECT COUNT(*) 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 = 20000)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tube feeding...
mimic_iii
CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number ) CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE member ( member_id number, card_number text, name text, hometown text, ...
SELECT card_number FROM member WHERE hometown LIKE "%Kentucky%"
spider
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_Road
nvbench
CREATE TABLE table_name_45 ( rank VARCHAR, third_quarter VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the third quarter is China Mobile 195,680.4, what is the rank?
SELECT rank FROM table_name_45 WHERE third_quarter = "china mobile 195,680.4"
sql_create_context
CREATE TABLE table_204_893 ( id number, "rank" number, "name" text, "nationality" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many runners in the 2002 european athletics indoor championships completed the men 's...
SELECT COUNT("name") FROM table_204_893 WHERE "time" < 8
squall
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR...
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description ORDER BY Document_Type_Description
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text,...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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 = jyjgzbb.YLJGDM...
css
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_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '80809375' AND t_kc21.MED_SER_ORG_NO = '4405816' AND t_kc21.OUT_DIAG_DOC_NM LIKE '施%'
css
CREATE TABLE table_name_77 ( games INTEGER, points VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of games that has Juan Carlos Navarro and more than 266 points?
SELECT SUM(games) FROM table_name_77 WHERE points > 266 AND name = "juan carlos navarro"
sql_create_context
CREATE TABLE table_2528382_1 ( lyricist VARCHAR, music_director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the lyricist for the song with music directed by madan mohan kohli?
SELECT lyricist FROM table_2528382_1 WHERE music_director = "Madan Mohan Kohli"
sql_create_context
CREATE TABLE table_25755 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Original air date" FROM table_25755 WHERE "Written by" = 'David Zuckerman'
wikisql
CREATE TABLE table_12837_1 ( days_with_rain__year_summer_ VARCHAR, city_town VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the days with rain figure for the city of Santiago de Compostela?
SELECT days_with_rain__year_summer_ FROM table_12837_1 WHERE city_town = "Santiago de Compostela"
sql_create_context
CREATE TABLE table_name_32 ( crowd INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people were present in a total of every crowd at the MCG venue?
SELECT SUM(crowd) FROM table_name_32 WHERE venue = "mcg"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId ...
SELECT Posts.Id AS "post_link", Score, ViewCount, Tags FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName = 'php' AND Posts.AcceptedAnswerId IS NULL AND Posts.ParentId IS NULL AND AnswerCount = 0 AND ClosedDate IS NULL AND Posts.Id NOT IN (SELECT ...
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
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.icd9_code = "V452" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_name_33 ( opponent VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has an attendance of 17,015?
SELECT opponent FROM table_name_33 WHERE attendance = "17,015"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030...
eicu
CREATE TABLE table_name_18 ( visitor VARCHAR, leading_scorer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What visitor has tim duncan (16) as the leading scorer?
SELECT visitor FROM table_name_18 WHERE leading_scorer = "tim duncan (16)"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '22354212' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 4694.23)
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT AVG(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '8773150' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-06-09' AND '2006-02-24'
css
CREATE TABLE table_name_85 ( number_of_electorates__2003_ INTEGER, constituency_number VARCHAR, district VARCHAR, reserved_for___sc___st__none_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of Electorates (2003) in District...
SELECT MIN(number_of_electorates__2003_) FROM table_name_85 WHERE district = "bhind" AND reserved_for___sc___st__none_ = "none" AND constituency_number = "11"
sql_create_context
CREATE TABLE table_name_27 ( vote_to_evict VARCHAR, vote_to_save VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Vote to Evict has a Vote to Save of 21.22%?
SELECT vote_to_evict FROM table_name_27 WHERE vote_to_save = "21.22%"
sql_create_context
CREATE TABLE table_52482 ( "Round" real, "Overall" real, "Player" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was petter ronnquist picked?
SELECT "Overall" FROM table_52482 WHERE "Player" = 'petter ronnquist'
wikisql
CREATE TABLE table_name_20 ( cuts_made INTEGER, top_5 VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of cuts made in a tournament with 0 wins and 0 top 5 placings?
SELECT MAX(cuts_made) FROM table_name_20 WHERE top_5 = 0 AND wins < 0
sql_create_context
CREATE TABLE table_45602 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Result, when Date is 19 August 1992?
SELECT "Result" FROM table_45602 WHERE "Date" = '19 august 1992'
wikisql