instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_14419 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event did he fight masato shiozawa?
SELECT "Event" FROM table_14419 WHERE "Opponent" = 'masato shiozawa'
wikisql
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 Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY Company DESC
nvbench
CREATE TABLE table_15986 ( "Week" real, "Dance/song" text, "Horwood" text, "Goodman" text, "Dixon" text, "Tonioli" text, "Total" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score did Dixon give to the song 'samba /...
SELECT "Dixon" FROM table_15986 WHERE "Dance/song" = 'Samba / Young Hearts Run Free' AND "Result" = 'Second place'
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 jyjgzbb.JYZBLSH 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.YLJGDM AND jybgb.BGD...
css
CREATE TABLE table_67202 ( "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 name of the player with a score of 72-68-70=210?
SELECT "Player" FROM table_67202 WHERE "Score" = '72-68-70=210'
wikisql
CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_22482077_1 ( year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 2010, how many 1st venue cities were there?
SELECT COUNT(1 AS st_venue) FROM table_22482077_1 WHERE year = 2010
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, char...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 85169 AND STRFTIME('%y', admissions.admittime) = '2102'
mimic_iii
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id numb...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%india' ORDER BY Reputation DESC LIMIT 500
sede
CREATE TABLE table_23753 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the statuses of the platelet counts for the cond...
SELECT "Platelet count" FROM table_23753 WHERE "Prothrombin time" = 'Unaffected' AND "Partial thromboplastin time" = 'Unaffected'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airp...
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_...
atis
CREATE TABLE table_name_70 ( tournament VARCHAR, surface VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament took place on July 17, 2005, with a clay surface?
SELECT tournament FROM table_name_70 WHERE surface = "clay" AND date = "july 17, 2005"
sql_create_context
CREATE TABLE table_name_57 ( rank VARCHAR, location VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the park in pigeon forge, tennessee in the best food category?
SELECT COUNT(rank) FROM table_name_57 WHERE location = "pigeon forge, tennessee" AND category = "best food"
sql_create_context
CREATE TABLE table_name_53 ( total INTEGER, rank VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Total for the rank 12, and gold less than 0?
SELECT MAX(total) FROM table_name_53 WHERE rank = "12" AND gold < 0
sql_create_context
CREATE TABLE table_train_35 ( "id" int, "pregnancy_or_lactation" bool, "glucocorticoid_history" bool, "impaired_consciousness" bool, "hematologic_disease" bool, "glasgow_come_score_gcs" int, "liver_disease" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for...
SELECT * FROM table_train_35 WHERE glucocorticoid_history = 1
criteria2sql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) 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 swimme...
SELECT meter_600, ID FROM swimmer ORDER BY meter_600 DESC
nvbench
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
SELECT c.Id AS "comment_link", c.Text, c.CreationDate, p.Id AS "post_link" FROM Comments AS c JOIN Posts AS p ON (c.PostId = p.Id) WHERE Text LIKE '%##Word##%' AND p.OwnerUserId = '##userid##' ORDER BY CreationDate
sede
CREATE TABLE table_42576 ( "Hangul" text, "Hanja" text, "Revised" text, "McCune-Reischauer" text, "2000 n South Korea population *" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Hangul when the Hanja is , ?
SELECT "Hangul" FROM table_42576 WHERE "Hanja" = '西, 徐'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location te...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.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 = admissions...
mimic_iii
CREATE TABLE table_578 ( "Franchise or Game" text, "Console" text, "Main Developer" text, "Main Genre" text, "First Release" real, "Latest Release" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which main developer made their first release in 1...
SELECT "Main Developer" FROM table_578 WHERE "First Release" = '1991' AND "Console" = 'Mega Drive/Genesis'
wikisql
CREATE TABLE table_70277 ( "Start Date/Time" text, "Duration" text, "End Time" text, "Spacecraft" text, "Crew" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the spacecraft with end time of 4 September 04:51?
SELECT "Spacecraft" FROM table_70277 WHERE "End Time" = '4 september 04:51'
wikisql
CREATE TABLE table_17198 ( "Unit" text, "Commander" text, "Complement" text, "Killed" text, "Wounded" text, "Missing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the commander of 167 off 2348 men
SELECT "Commander" FROM table_17198 WHERE "Complement" = '167 off 2348 men'
wikisql
CREATE TABLE table_72762 ( "Track Name" text, "Location" text, "Length" text, "Sanction" text, "Program" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location is farmer city speedway?
SELECT "Location" FROM table_72762 WHERE "Track Name" = 'Farmer City Speedway'
wikisql
CREATE TABLE table_66062 ( "Year" text, "Champions" text, "Score" text, "Runners-up" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What the score of the 1992 game?
SELECT "Score" FROM table_66062 WHERE "Year" = '1992'
wikisql
CREATE TABLE table_1984697_85 ( principal VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the principal of Northfield Junior-Senior High School.
SELECT principal FROM table_1984697_85 WHERE school = "Northfield Junior-Senior High school"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPriv...
SELECT t.TagName AS "tagname", COUNT(q.Id) AS "#questions", ROUND(CAST(SUM(q.Score) AS DECIMAL) / COUNT(q.Id), 1) AS "avgqscore" FROM Posts AS q JOIN PostTags AS pt ON q.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE q.PostTypeId = 1 AND q.CreationDate >= DATEADD(d, -30, GETDATE()) GROUP BY t.TagName ORDER BY C...
sede
CREATE TABLE table_name_8 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Blue Jays' opponent when their record was 33-15?
SELECT opponent FROM table_name_8 WHERE record = "33-15"
sql_create_context
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 cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule...
SELECT Directed_by, COUNT(*) FROM film GROUP BY Directed_by ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE zzmzjzjlb ( 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, MZZYZDZ...
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.ZZYSGH = '21408957' AND zzmzjzjlb.JZKSRQ BETWEEN '2004-07-08' AND '2004-11-20' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.ZZYSGH = '21408957' AND fzzmzjzjlb.JZKSRQ BETWEEN '2004-07-08' AND '2004-11-20'
css
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
SELECT Answers.OwnerUserId AS "user_link", SUM(Answers.Score) AS "total_score" FROM Posts AS Answers INNER JOIN Users ON Answers.OwnerUserId = Users.Id INNER JOIN (SELECT Posts.Id AS "id" FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '%rules-as-written%' AND Tags LIKE '%dnd-3.5e%') AS Questions ON Answers.ParentId = Qu...
sede
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE T...
SELECT COUNT(Id) AS TotalCount FROM Comments WHERE UserId = '##UserId##'
sede
CREATE TABLE table_name_41 ( championship VARCHAR, surface VARCHAR, score_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the championship that had final score of 6 2, 5 7, 6 4, 6 2 and was on a clay surface?
SELECT championship FROM table_name_41 WHERE surface = "clay" AND score_in_the_final = "6–2, 5–7, 6–4, 6–2"
sql_create_context
CREATE TABLE table_45933 ( "Season" text, "North" text, "South" text, "East" text, "West" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was in the South when TSV Kottern was in the West and EHF Passau was in the East?
SELECT "South" FROM table_45933 WHERE "West" = 'tsv kottern' AND "East" = 'ehf passau'
wikisql
CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE discipline_enrollments ( campus number, discipline number, year number, undergraduate number, graduate number ) CREATE TABLE enrollments ( campus number, year number, ...
SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees)
spider
CREATE TABLE table_71723 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which location had a round of 3, and an Opponent of...
SELECT "Location" FROM table_71723 WHERE "Round" < '3' AND "Opponent" = 'matt horwich'
wikisql
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 > 2220.31)
css
CREATE TABLE table_name_5 ( opponent VARCHAR, location VARCHAR, number VARCHAR, time VARCHAR, aircraft VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent with a time higher than 1040, a Spad xiii aircraft in Dun-Sur-Meuse with a l...
SELECT opponent FROM table_name_5 WHERE time > 1040 AND aircraft = "spad xiii" AND number < 22 AND location = "dun-sur-meuse"
sql_create_context
CREATE TABLE table_name_73 ( recipients_and_nominees VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the recipients in 1994?
SELECT recipients_and_nominees FROM table_name_73 WHERE year = 1994
sql_create_context
CREATE TABLE table_26919_7 ( hebrew VARCHAR, english VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If in english it is heart, what is it in hebrew?
SELECT hebrew FROM table_26919_7 WHERE english = "heart"
sql_create_context
CREATE TABLE table_name_86 ( vctp VARCHAR, vcrt VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If there is a VCRT of 7.62mm (0.3in) fn mag 60-20 machine gun, what is the VCTP of that?
SELECT vctp FROM table_name_86 WHERE vcrt = "7.62mm (0.3in) fn mag 60-20 machine gun"
sql_create_context
CREATE TABLE table_name_4 ( goals VARCHAR, years_active VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals did a player active since 2006 have?
SELECT goals FROM table_name_4 WHERE years_active = "2006"
sql_create_context
CREATE TABLE table_name_73 ( year INTEGER, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year that had a Lotus 49B chassis?
SELECT MIN(year) FROM table_name_73 WHERE chassis = "lotus 49b"
sql_create_context
CREATE TABLE table_name_27 ( date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date had an attendance of 76,518?
SELECT date FROM table_name_27 WHERE attendance = "76,518"
sql_create_context
CREATE TABLE table_name_33 ( result VARCHAR, venue VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score for the match played in Venue H and the opponent was Newcastle United?
SELECT result FROM table_name_33 WHERE venue = "h" AND opponent = "newcastle united"
sql_create_context
CREATE TABLE table_204_457 ( id number, "ship name" text, "desig" text, "status" text, "notes" text, "links" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the first ship listed as undamaged ?
SELECT "ship name" FROM table_204_457 WHERE "status" = 'undamaged' ORDER BY id LIMIT 1
squall
CREATE TABLE table_60500 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player with playoff money from the United States?
SELECT "Player" FROM table_60500 WHERE "Money ( \u00a3 )" = 'playoff' AND "Country" = 'united states'
wikisql
CREATE TABLE table_name_23 ( points INTEGER, engine VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average points of a Cosworth v8 engine in 1973.
SELECT AVG(points) FROM table_name_23 WHERE engine = "cosworth v8" AND year = 1973
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_i...
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83062) AND icustays.outtime IS NULL) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_item...
mimic_iii
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 patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) >= '2105'
eicu
CREATE TABLE department ( department_id number, name text, creation text, ranking number, budget_in_billions number, num_employees number ) CREATE TABLE head ( head_id number, name text, born_state text, age number ) CREATE TABLE management ( department_id number, head_...
SELECT T1.department_id, T1.name, COUNT(*) FROM management AS T2 JOIN department AS T1 ON T1.department_id = T2.department_id GROUP BY T1.department_id HAVING COUNT(*) > 1
spider
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.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_55 ( position VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has Notes of 68.76 m?
SELECT position FROM table_name_55 WHERE notes = "68.76 m"
sql_create_context
CREATE TABLE table_59436 ( "Season" text, "Round" text, "Date" text, "Home" text, "Away" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the round played on 13 October 1984?
SELECT "Round" FROM table_59436 WHERE "Date" = '13 october 1984'
wikisql
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, do...
SELECT gender, COUNT(*) FROM Dorm GROUP BY gender
nvbench
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE va...
SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_FNAME
nvbench
CREATE TABLE table_48203 ( "Member" text, "Party" text, "Electorate" text, "State" text, "Term of office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Term of Office, when Member is 'Dominic Costa'?
SELECT "Term of office" FROM table_48203 WHERE "Member" = 'dominic costa'
wikisql
CREATE TABLE table_27734577_11 ( date VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the Hawks play against Boston?
SELECT date FROM table_27734577_11 WHERE team = "Boston"
sql_create_context
CREATE TABLE table_26818 ( "Rank" real, "Senator" text, "Date of birth" text, "Entered Senate" text, "Left Senate" text, "State served" text, "Party" text, "Time since entry" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the states...
SELECT "State served" FROM table_26818 WHERE "Time since entry" = '49years, 29days'
wikisql
CREATE TABLE table_name_54 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament has a value of 2R in 2008?
SELECT tournament FROM table_name_54 WHERE 2008 = "2r"
sql_create_context
CREATE TABLE table_name_34 ( team_1 VARCHAR, team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was team one name for the Team 2 of Toulouse Fc (d1)>?
SELECT team_1 FROM table_name_34 WHERE team_2 = "toulouse fc (d1)"
sql_create_context
CREATE TABLE table_name_15 ( year VARCHAR, location VARCHAR, loser VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years did the new york giants lose at metlife stadium?
SELECT COUNT(year) FROM table_name_15 WHERE location = "metlife stadium" AND loser = "new york giants"
sql_create_context
CREATE TABLE table_name_6 ( grid VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many grids does dave walker have?
SELECT COUNT(grid) FROM table_name_6 WHERE driver = "dave walker"
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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Creation of conduit between left ventricle and aorta"
mimicsql_data
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND FLIGHT_1.departure_time = 1000...
atis
CREATE TABLE table_204_192 ( id number, "year" number, "team" text, "co-drivers" text, "car" text, "class" text, "laps" number, "pos." text, "class\npos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which year had more laps , 1988...
SELECT "year" FROM table_204_192 WHERE "year" IN (1988, 1985) ORDER BY "laps" DESC LIMIT 1
squall
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '曹诗蕾' AND jybg...
css
CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) ...
SELECT formats FROM files GROUP BY formats ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text ) CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1
spider
CREATE TABLE table_56627 ( "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 was the score of the away team at the MCG?
SELECT "Away team score" FROM table_56627 WHERE "Venue" = 'mcg'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-149724')) AND intakeoutput.cellpath LIKE '%output%' AND ...
eicu
CREATE TABLE table_name_72 ( height VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the heigh of the player who went to lake howell high school?
SELECT height FROM table_name_72 WHERE school = "lake howell high school"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "3799"
mimicsql_data
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT RZBQDM, RZBQMC, RYCWH FROM zyjzjlb WHERE JZLSH = '30702944784'
css
CREATE TABLE table_name_40 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for 2002 when the 2004 is A, and the 2005 is 1r?
SELECT 2002 FROM table_name_40 WHERE 2004 = "a" AND 2005 = "1r"
sql_create_context
CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE d...
SELECT COUNT(DISTINCT (publication.title)), publication.year FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.jid = journal.jid GROUP BY publication.year
academic
CREATE TABLE table_22464 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT MAX("GEO ID") FROM table_22464 WHERE "Township" = 'Joliette'
wikisql
CREATE TABLE table_52427 ( "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. -- Which home team scored 19.18 (132)?
SELECT "Home team" FROM table_52427 WHERE "Home team score" = '19.18 (132)'
wikisql
CREATE TABLE table_36292 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has an Opponent of meike babel?
SELECT "Tournament" FROM table_36292 WHERE "Opponent" = 'meike babel'
wikisql
CREATE TABLE table_204_490 ( id number, "position" text, "name" text, "height" text, "weight" text, "birthdate" text, "birthplace" text, "2009-10 team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total of names are listed ?
SELECT COUNT("name") FROM table_204_490
squall
CREATE TABLE table_name_64 ( surface VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Surface has a Date of 15 february 1988?
SELECT surface FROM table_name_64 WHERE date = "15 february 1988"
sql_create_context
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. -- how many golfers in the third round are from the united states ?
SELECT COUNT("player") FROM table_203_134 WHERE "country" = 'united states'
squall
CREATE TABLE table_name_27 ( series_4 VARCHAR, seat VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for series 4 when the seat shows 1?
SELECT series_4 FROM table_name_27 WHERE seat = 1
sql_create_context
CREATE TABLE table_train_118 ( "id" int, "hypocalcemia" bool, "heart_disease" bool, "renal_disease" bool, "fibrinogen" float, "diastolic_blood_pressure_dbp" int, "symptomatic_hypotension" bool, "serum_creatinine" float, "ca" float, "hypertension" bool, "NOUSE" float ) -- Us...
SELECT * FROM table_train_118 WHERE symptomatic_hypotension = 1 OR (hypertension = 1 OR diastolic_blood_pressure_dbp > 95)
criteria2sql
CREATE TABLE table_name_10 ( partner VARCHAR, score_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the partner in the final with a score of 2 6, 7 6, 7 6?
SELECT partner FROM table_name_10 WHERE score_in_the_final = "2–6, 7–6, 7–6"
sql_create_context
CREATE TABLE table_name_52 ( player VARCHAR, round VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Round larger than 5, and a School/Club Team of bethune-cookman?
SELECT player FROM table_name_52 WHERE round > 5 AND school_club_team = "bethune-cookman"
sql_create_context
CREATE TABLE table_61465 ( "Draw" real, "Artist" text, "Song" text, "Lyrics (l) / Music (m)" text, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Lyrics (l) / Music (m) when the draw was more than 3, and the results were Siste ...
SELECT "Lyrics (l) / Music (m)" FROM table_61465 WHERE "Draw" > '3' AND "Results" = 'siste sjansen' AND "Song" = 'shuffled'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-12221')) AND medication.drugname = 'acetaminophen 325 mg t...
eicu
CREATE TABLE table_41908 ( "Single" text, "CCM Chart" text, "Debut" text, "Peak Date" text, "Peak Pos" real, "Total Wks" real, "Spins (since 1998) source: Mediabase" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What CCM Chart had 18 total ...
SELECT "CCM Chart" FROM table_41908 WHERE "Total Wks" = '18'
wikisql
CREATE TABLE table_name_6 ( school VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school did draft pick from round 3 go to?
SELECT school FROM table_name_6 WHERE round = 3
sql_create_context
CREATE TABLE table_name_10 ( year VARCHAR, issue_price VARCHAR, special_notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year has an issue price over 15.95, and a special notes from edmonton oilers gift set?
SELECT COUNT(year) FROM table_name_10 WHERE issue_price > 15.95 AND special_notes = "from edmonton oilers gift set"
sql_create_context
CREATE TABLE table_1341577_43 ( first_elected VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the district called Tennessee 6, how many in total of first elected are there?
SELECT COUNT(first_elected) FROM table_1341577_43 WHERE district = "Tennessee 6"
sql_create_context
CREATE TABLE table_46350 ( "Year" real, "Round" text, "Opponent" text, "Result" text, "BSU Head Coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result after 1993 of the first four rounds?
SELECT "Result" FROM table_46350 WHERE "Year" > '1993' AND "Round" = 'first four'
wikisql
CREATE TABLE marketing_regions ( marketing_region_code text, marketing_region_name text, marketing_region_descriptrion text, other_details text ) CREATE TABLE invoice_items ( invoice_item_id number, invoice_id number, order_id number, order_item_id number, product_id number, ord...
SELECT T1.city_town, COUNT(*) FROM addresses AS T1 JOIN drama_workshop_groups AS T2 ON T1.address_id = T2.address_id GROUP BY T1.city_town
spider
CREATE TABLE table_73277 ( "Season" real, "Episode" real, "Episode Summary" text, "Premier date" text, "External Link" text, "Coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the coach for emily is made into a more outgoing person.
SELECT "Coach" FROM table_73277 WHERE "Episode Summary" = 'Emily is made into a more outgoing person.'
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.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor...
SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details
nvbench
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId num...
SELECT TOP(10000) AS Id, Title, AcceptedAnswerId, Score, ViewCount, Tags, AnswerCount, CommentCount, FavoriteCount FROM Posts WHERE Tags LIKE '%python%' AND NOT AcceptedAnswerId IS NULL AND Score > 0 AND FavoriteCount > 0 ORDER BY Score
sede
CREATE TABLE table_17741 ( "Team" text, "Car(s)" text, "#" real, "Driver(s)" text, "Primary Sponsor(s)" text, "Owner(s)" text, "Crew Chief" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total number of crew chiefs of the Fas Lane...
SELECT COUNT("Crew Chief") FROM table_17741 WHERE "Team" = 'FAS Lane Racing'
wikisql
CREATE TABLE table_name_53 ( win__percentage INTEGER, away VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest win% with an away score of 3-2 in 2011 season?
SELECT MIN(win__percentage) FROM table_name_53 WHERE away = "3-2" AND season = "2011"
sql_create_context
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, ...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'ENS' AND COURSE_0.number =...
advising