instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_53624 ( "Year" real, "Competition Description" text, "Location" text, "Apparatus" text, "Score-Final" real, "Score-Qualifying" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Qualifying score had hoop as an apparatus?
SELECT "Score-Qualifying" FROM table_53624 WHERE "Apparatus" = 'hoop'
wikisql
CREATE TABLE table_27733909_7 ( high_rebounds VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of high rebounds for january 5
SELECT COUNT(high_rebounds) FROM table_27733909_7 WHERE date = "January 5"
sql_create_context
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TAB...
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'stephen boyd' AND writes.authorid = author.authorid
scholar
CREATE TABLE apartment_bookings ( apt_booking_id number, apt_id number, guest_id number, booking_status_code text, booking_start_date time, booking_end_date time ) CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE apartment_buildings ( building_id...
SELECT apt_number FROM apartments ORDER BY room_count
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 ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(School_ID)
nvbench
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 Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
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 = "78057" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_11185 ( "Rank" text, "City" text, "Height" text, "Stories" real, "Completed" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of stories that had a 16 rank
SELECT COUNT("Stories") FROM table_11185 WHERE "Rank" = '16'
wikisql
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 T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name ORDER BY COUNT(T4.Name)
nvbench
CREATE TABLE table_39470 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What chassis is used in 1989 with a cosworth engine?
SELECT "Chassis" FROM table_39470 WHERE "Year" = '1989' AND "Engine" = 'cosworth'
wikisql
CREATE TABLE table_name_90 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was South Melbourne's home team score?
SELECT home_team AS score FROM table_name_90 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE table_name_25 ( points VARCHAR, standing_broad_jump__cm_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points are obtained when a standing broad jump is 207-215 cm?
SELECT COUNT(points) FROM table_name_25 WHERE standing_broad_jump__cm_ = "207-215"
sql_create_context
CREATE TABLE table_22080 ( "#" real, "Date" text, "Opponent" text, "Score" text, "Site/Stadium" text, "Win" text, "Loss" text, "Save" text, "Attendance" real, "Overall Record" text, "NCAAT Record" text ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT "NCAAT Record" FROM table_22080 WHERE "Date" = 'June 22'
wikisql
CREATE TABLE table_15690 ( "Date" text, "Score" text, "Location" text, "Competition" text, "Serial No." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- A competition of test taking place on 23 Apr 1988 had what as a score?
SELECT "Score" FROM table_15690 WHERE "Competition" = 'test' AND "Date" = '23 apr 1988'
wikisql
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 semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'BIOSTAT' AND COURSEalias0.numbe...
advising
CREATE TABLE table_34816 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Time" text, "Att." text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Att has a Time of 2:14?
SELECT "Att." FROM table_34816 WHERE "Time" = '2:14'
wikisql
CREATE TABLE table_name_79 ( romaji_title VARCHAR, tv_station VARCHAR, japanese_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Romanji title for around40 on TBS?
SELECT romaji_title FROM table_name_79 WHERE tv_station = "tbs" AND japanese_title = "around40〜注文の多いオンナたち〜"
sql_create_context
CREATE TABLE airport ( airport_id number, airport_name text, total_passengers number, %_change_2007 text, international_passengers number, domestic_passengers number, transit_passengers number, aircraft_movements number, freight_metric_tonnes number ) CREATE TABLE match ( round ...
SELECT * FROM airport ORDER BY international_passengers DESC LIMIT 1
spider
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id num...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 54386 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ...
mimic_iii
CREATE TABLE table_60156 ( "Team" text, "Opponent" text, "Score" text, "Venue" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the match with the sydney roosters as the opponent?
SELECT "Score" FROM table_60156 WHERE "Opponent" = 'sydney roosters'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "CHEST PAIN" AND procedures.short_title = "Endosc inser stent bile"
mimicsql_data
CREATE TABLE table_name_47 ( attendance INTEGER, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The game of 6 has what lowest attendance?
SELECT MIN(attendance) FROM table_name_47 WHERE game = 6
sql_create_context
CREATE TABLE table_173475_1 ( release VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year(s) was axis & allies: d-day released?
SELECT release FROM table_173475_1 WHERE title = "Axis & Allies: D-Day"
sql_create_context
CREATE TABLE table_15055 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the loss when the record is 38-33?
SELECT "Loss" FROM table_15055 WHERE "Record" = '38-33'
wikisql
CREATE TABLE table_name_32 ( artist VARCHAR, language VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which artist speaks croatian?
SELECT artist FROM table_name_32 WHERE language = "croatian"
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 MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.age >= "31"
mimicsql_data
CREATE TABLE table_11001 ( "1910" real, "1920" real, "1930" real, "1940" real, "1950" real, "1960" real, "1970" real, "1980" real, "1990" real, "2000" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the minimum 1930 when 1...
SELECT MIN("1930") FROM table_11001 WHERE "1990" = '6,883' AND "1920" > '6,215'
wikisql
CREATE TABLE table_name_51 ( byes INTEGER, against VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many byes were there with an Against of 1655 and more than 10 wins?
SELECT MIN(byes) FROM table_name_51 WHERE against = 1655 AND wins > 10
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal...
SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
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 Badges ( Id number, UserId number, Name text, ...
SELECT p.Id, p.Title, p.PostTypeId, p.CreationDate, p.ClosedDate, p.Score, p.ViewCount, p.AnswerCount, p.Tags, p.OwnerUserId, p.OwnerDisplayName, owner.Location, owner.Reputation, c.Id AS AnswerId, c.Score AS AnswerScore, responseOwner.Id AS ResponseOwnerId, responseOwner.DisplayName AS ResponseOwnerDisplayName, respon...
sede
CREATE TABLE table_56350 ( "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the fastest lap at th...
SELECT "Fastest Lap" FROM table_56350 WHERE "Race" = 'german grand prix'
wikisql
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 WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.dob_year < "1850"
mimicsql_data
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE table_name_24 ( round VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Round is the Position Goaltender?
SELECT round FROM table_name_24 WHERE position = "goaltender"
sql_create_context
CREATE TABLE table_63068 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the owner of the radio station that plays adult hits?
SELECT "Owner" FROM table_63068 WHERE "Format" = 'adult hits'
wikisql
CREATE TABLE table_name_58 ( floors VARCHAR, height_m___feet VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many floors have a Height m / feet of 900 / 2,952?
SELECT floors FROM table_name_58 WHERE height_m___feet = "900 / 2,952"
sql_create_context
CREATE TABLE table_24078 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Golden Bears points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of opponents played against t...
SELECT COUNT("Opponents") FROM table_24078 WHERE "Game" = '4'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGD...
css
CREATE TABLE table_32806 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent was playing on December 20, 1998?
SELECT "Opponent" FROM table_32806 WHERE "Date" = 'december 20, 1998'
wikisql
CREATE TABLE table_21769 ( "P" real, "Player" text, "Position" text, "League" real, "Copa del Rey" real, "Champions League" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when the position is forward and the league is 5 what nu...
SELECT COUNT("Champions League") FROM table_21769 WHERE "League" = '5' AND "Position" = 'Forward'
wikisql
CREATE TABLE table_29078 ( "Date" text, "Time" text, "Visiting team" text, "Home team" text, "Site" text, "Broadcast" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all home teams when Western Kentu...
SELECT "Home team" FROM table_29078 WHERE "Visiting team" = 'Western Kentucky'
wikisql
CREATE TABLE table_37494 ( "Date" real, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has a Score of 6 4, 6 2?
SELECT "Tournament" FROM table_37494 WHERE "Score" = '6–4, 6–2'
wikisql
CREATE TABLE table_25509 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name t...
SELECT "High assists" FROM table_25509 WHERE "Date" = 'January 15'
wikisql
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 patients.gender FROM patients WHERE patients.subject_id = 23475
mimic_iii
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 * FROM t_kc21 WHERE PERSON_NM = '张永望' AND MED_SER_ORG_NO = '6947100' AND NOT MED_ORG_DEPT_NM LIKE '%科学%'
css
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 demographic.religion, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "4589"
mimicsql_data
CREATE TABLE bdmzjzjlb ( 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 wdmzjzjlb.SG, wdmzjzjlb.TZ, wdmzjzjlb.TW, wdmzjzjlb.SSY, wdmzjzjlb.SZY, wdmzjzjlb.XL, wdmzjzjlb.HXPLC, wdmzjzjlb.ML FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '97259664233' UNION SELECT bdmzjzjlb.SG, bdmzjzjlb.TZ, bdmzjzjlb.TW, bdmzjzjlb.SSY, bdmzjzjlb.SZY, bdmzjzjlb.XL, bdmzjzjlb.HXPLC, bdmzjzjlb.ML FROM bdmzjzjlb ...
css
CREATE TABLE table_name_58 ( urban_sub_area VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which urban sub-area has a population of 16,140?
SELECT urban_sub_area FROM table_name_58 WHERE population = "16,140"
sql_create_context
CREATE TABLE table_69372 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the games played are smaller than 18, w...
SELECT MIN("Goals Conceded") FROM table_69372 WHERE "Played" < '18'
wikisql
CREATE TABLE table_name_50 ( title VARCHAR, guest_performer VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which title has a Black Ice for a guest performer and a length of 5:49?
SELECT title FROM table_name_50 WHERE guest_performer = "black ice" AND time = "5:49"
sql_create_context
CREATE TABLE table_9261 ( "Date" text, "Event" text, "Home Team" text, "Away Team" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much did the away team b3 score on August 12, 2014?
SELECT "Score" FROM table_9261 WHERE "Away Team" = 'b3' AND "Date" = 'august 12, 2014'
wikisql
CREATE TABLE table_name_21 ( tie_no VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the tie against the away team, Leicester City?
SELECT tie_no FROM table_name_21 WHERE away_team = "leicester city"
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
advising
CREATE TABLE table_name_68 ( displacement_ VARCHAR, _configuration VARCHAR, car_model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What displacement & configuration does the car model Panamera 4s have?
SELECT displacement_ & _configuration FROM table_name_68 WHERE car_model = "panamera 4s"
sql_create_context
CREATE TABLE table_18734298_1 ( written_by VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the series number 14?
SELECT written_by FROM table_18734298_1 WHERE no_in_series = 14
sql_create_context
CREATE TABLE table_16034882_3 ( points VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times were points counted for fk prienai
SELECT COUNT(points) FROM table_16034882_3 WHERE club = "FK Prienai"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
SELECT d_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_3639 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people ...
SELECT COUNT("Written by") FROM table_3639 WHERE "U.S. viewers (in millions)" = '3.40'
wikisql
CREATE TABLE table_204_71 ( id number, "rank" number, "heat" number, "name" text, "nationality" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many women clocked less than 13 secs the women 's heat of 100m hurd...
SELECT COUNT("name") FROM table_204_71 WHERE "time" < 13
squall
CREATE TABLE table_46340 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does the player play with an overall of 304?
SELECT "Position" FROM table_46340 WHERE "Overall" = '304'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm...
SELECT chartevents.charttime 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 = 9566)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat...
mimic_iii
CREATE TABLE table_24798489_1 ( episode_number VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes had New York, New York as the location?
SELECT COUNT(episode_number) FROM table_24798489_1 WHERE location = "New York, New York"
sql_create_context
CREATE TABLE table_48626 ( "Team" text, "Head coach" text, "Team captain" text, "Kitmaker" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the kitmaker for the team that Uwe Rapolder is the head coach of.
SELECT "Kitmaker" FROM table_48626 WHERE "Head coach" = 'uwe rapolder'
wikisql
CREATE TABLE table_38594 ( "Distance" text, "Time" text, "Date" text, "Location" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Distance of 500 m?
SELECT "Date" FROM table_38594 WHERE "Distance" = '500 m'
wikisql
CREATE TABLE table_name_38 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament was an A 1988, and a 2R 1999?
SELECT tournament FROM table_name_38 WHERE 1988 = "a" AND 1999 = "2r"
sql_create_context
CREATE TABLE table_name_85 ( result VARCHAR, battle VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result of the Battle of Marcellae in 756?
SELECT result FROM table_name_85 WHERE battle = "battle of marcellae" AND date = "756"
sql_create_context
CREATE TABLE table_name_86 ( podiums VARCHAR, fastest_laps VARCHAR, races VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the total number of podiums for more than 4 laps, and less than 149 races?
SELECT COUNT(podiums) FROM table_name_86 WHERE fastest_laps > 4 AND races < 149
sql_create_context
CREATE TABLE table_19753079_36 ( incumbent VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the incumbent for sue myrick (r) 69.0% jeff doctor (d) 31.0%
SELECT incumbent FROM table_19753079_36 WHERE candidates = "Sue Myrick (R) 69.0% Jeff Doctor (D) 31.0%"
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREA...
SELECT p.Id, p.AcceptedAnswerId, p.CreationDate, p.OwnerUserId, p.Tags, p.Title, p.Body AS Question, a.Body AS Answer FROM Posts AS p INNER JOIN Posts AS a ON p.AcceptedAnswerId = a.Id WHERE p.Tags LIKE '%pega%' AND p.PostTypeId = 1 AND a.PostTypeId = 2 AND NOT p.AcceptedAnswerId IS NULL AND p.DeletionDate IS NULL
sede
CREATE TABLE table_name_34 ( grid VARCHAR, laps INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid total for cars with over 69 laps?
SELECT COUNT(grid) FROM table_name_34 WHERE laps > 69
sql_create_context
CREATE TABLE table_203_94 ( id number, "year" number, "player" text, "country" text, "score" text, "to par" number, "margin\nof victory" text, "course" text, "location" text, "purse ($)" number, "winner's\nshare ($)" number ) -- Using valid SQLite, answer the following ques...
SELECT "margin\nof victory" FROM table_203_94 WHERE "year" = 2011
squall
CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_percent real ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE...
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner
nvbench
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX num...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "3806"
mimicsql_data
CREATE TABLE table_50206 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has a Opponent of tennessee titans?
SELECT "Week" FROM table_50206 WHERE "Opponent" = 'tennessee titans'
wikisql
CREATE TABLE table_630 ( "Client" text, "Years of Operation" text, "Area of Operation" text, "Country" text, "Services" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whose address of operation was the Echirax Concession?
SELECT "Client" FROM table_630 WHERE "Area of Operation" = 'EchiraX Concession'
wikisql
CREATE TABLE table_204_10 ( id number, "ecclesiastical jurisdictions" text, "latin name" text, "type" text, "rite" text, "ecclesiastical province" text, "established" text, "area (km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- wh...
SELECT "latin name" FROM table_204_10 ORDER BY "established" LIMIT 1
squall
CREATE TABLE table_76960 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Place of 3?
SELECT "Score" FROM table_76960 WHERE "Place" = '3'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ...
css
CREATE TABLE table_12722302_2 ( original_air_date VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original air date for the episode with 3.90 u.s. viewers (millions)?
SELECT original_air_date FROM table_12722302_2 WHERE us_viewers__million_ = "3.90"
sql_create_context
CREATE TABLE table_37363 ( "Year" text, "Played" real, "Wins" real, "Losses" real, "No Result" real, "% Win" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Played that has Losses of 6, and Wins larger than 33?
SELECT AVG("Played") FROM table_37363 WHERE "Losses" = '6' AND "Wins" > '33'
wikisql
CREATE TABLE table_62636 ( "Club" text, "Head Coach" text, "City" text, "Stadium" text, "2002-2003 season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city is the Stadium est dio cidade de barcelos in?
SELECT "City" FROM table_62636 WHERE "Stadium" = 'estádio cidade de barcelos'
wikisql
CREATE TABLE table_64486 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of points for places over 7 and having a draw order of 4?
SELECT AVG("Points") FROM table_64486 WHERE "Place" > '7' AND "Draw" = '4'
wikisql
CREATE TABLE table_name_57 ( district VARCHAR, democratic VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many districts featured the democrat nicholas von stein?
SELECT COUNT(district) FROM table_name_57 WHERE democratic = "nicholas von stein"
sql_create_context
CREATE TABLE table_79675 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total cuts were made in events with more than 0 wins and exactly 0 top-5s?...
SELECT COUNT("Cuts made") FROM table_79675 WHERE "Top-5" = '0' AND "Wins" > '0'
wikisql
CREATE TABLE table_name_42 ( opponent VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What person was played against when the playing surface was hard?
SELECT opponent FROM table_name_42 WHERE surface = "hard"
sql_create_context
CREATE TABLE table_name_24 ( game INTEGER, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Game where there were 65,666 in attendance?
SELECT AVG(game) FROM table_name_24 WHERE attendance = "65,666"
sql_create_context
CREATE TABLE table_22004 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance record for week 6?
SELECT COUNT("Attendance") FROM table_22004 WHERE "Week" = '6'
wikisql
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Subjects ( subj...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) DESC
nvbench
CREATE TABLE table_name_14 ( iata VARCHAR, airport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IATA for Beijing Capital International Airport?
SELECT iata FROM table_name_14 WHERE airport = "beijing capital international airport"
sql_create_context
CREATE TABLE table_name_67 ( date VARCHAR, results¹ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day were the results 3:0?
SELECT date FROM table_name_67 WHERE results¹ = "3:0"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, a...
SELECT DISTINCT booking_class FROM class_of_service WHERE booking_class = 'Q'
atis
CREATE TABLE table_10015132_11 ( school_club_team VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school did player number 21 play for?
SELECT school_club_team FROM table_10015132_11 WHERE no = "21"
sql_create_context
CREATE TABLE table_name_73 ( first_elected INTEGER, home_city_town VARCHAR, party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which First elected is the highest one that has a Party of dem, and a District larger than 24, and a Ho...
SELECT MAX(first_elected) FROM table_name_73 WHERE party = "dem" AND district > 24 AND home_city_town = "berlin"
sql_create_context
CREATE TABLE table_name_20 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on 6 April 2008?
SELECT record FROM table_name_20 WHERE date = "6 april 2008"
sql_create_context
CREATE TABLE table_name_92 ( position VARCHAR, college_junior_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Position for the brandon wheat kings (wchl)?
SELECT position FROM table_name_92 WHERE college_junior_club_team = "brandon wheat kings (wchl)"
sql_create_context
CREATE TABLE table_204_749 ( id number, "courthouse" text, "city" text, "street address" text, "jurisdiction" text, "dates of use" text, "named for" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long has the city of brattleboro 's cou...
SELECT "dates of use" - "dates of use" FROM table_204_749 WHERE "city" = 'brattleboro'
squall
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.dob_year < "2065"
mimicsql_data
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 SUM(QTY), SUM(AMOUNT) FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '西帕依固龈液' AND STA_DATE BETWEEN '2010-03-17' AND '2015-01-05'
css
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 patient.age FROM patient WHERE patient.uniquepid = '004-2373' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu