instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_70558 ( "Catalog #" text, "Title" text, "Year" text, "Composer" text, "Released" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What CD was released in 2009?
SELECT "Title" FROM table_70558 WHERE "Released" = '2009'
wikisql
CREATE TABLE table_27179 ( "Year" text, "Amiga demo" text, "PC demo" text, "C64 demo" text, "Amiga intro" text, "PC intro" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What won best pc intro when my kingdom (haujobb & scoopex) won best amiga d...
SELECT "PC intro" FROM table_27179 WHERE "Amiga demo" = 'My Kingdom (Haujobb & Scoopex)'
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.formulary_drug_cd = "ESMO100I"
mimicsql_data
CREATE TABLE table_name_64 ( points_2 INTEGER, position VARCHAR, goal_average_1 VARCHAR, goals_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points 2 has a Goal Average 1 larger than 1.17, a Goals Against larger than 48, and a Position...
SELECT SUM(points_2) FROM table_name_64 WHERE goal_average_1 > 1.17 AND goals_against > 48 AND position > 6
sql_create_context
CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
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 NOT ...
css
CREATE TABLE table_name_1 ( transfer_window VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the transfer window for Steven Thompson?
SELECT transfer_window FROM table_name_1 WHERE name = "steven thompson"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'acq cardiac septl defect' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'acq cardiac septl defect'
mimic_iii
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '94379213' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_42411 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Identifier, when City of License is Terrace Bay?
SELECT "Identifier" FROM table_42411 WHERE "City of license" = 'terrace bay'
wikisql
CREATE TABLE table ( league_cup VARCHAR, r VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was the r 4?
SELECT COUNT(league_cup) FROM table WHERE r = 4
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "79" AND lab.label = "Alanine Aminotransferase (ALT)"
mimicsql_data
CREATE TABLE table_name_87 ( record VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which record has a time of 0:13?
SELECT record FROM table_name_87 WHERE time = "0:13"
sql_create_context
CREATE TABLE Contacts ( contact_id INTEGER, customer_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(50), contact_phone VARCHAR(80) ) CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) ...
SELECT T1.product_name, SUM(SUM(T2.order_quantity)) FROM Products AS T1 JOIN Order_Items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name
nvbench
CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_station_name text, end_station_id number, bike_id number, subscription_type text, zip_code number ) CREATE TABLE status ( station_id numb...
SELECT city, MAX(lat) FROM station GROUP BY city
spider
CREATE TABLE table_8639 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the lowest laps with 29 points on 1 grid?
SELECT MIN("Laps") FROM table_8639 WHERE "Points" = '29' AND "Grid" < '1'
wikisql
CREATE TABLE table_71676 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Team 2 has a second leg of 3-1?
SELECT "Team 2" FROM table_71676 WHERE "2nd leg" = '3-1'
wikisql
CREATE TABLE table_9003 ( "Rider" text, "Manufacturer" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time/retired of the car that started in grid 4?
SELECT "Time/Retired" FROM table_9003 WHERE "Grid" = '4'
wikisql
CREATE TABLE table_1341930_33 ( party VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many party with candidates being alton lennon (d) 89.0% c. dana malpass (r) 11.0%
SELECT COUNT(party) FROM table_1341930_33 WHERE candidates = "Alton Lennon (D) 89.0% C. Dana Malpass (R) 11.0%"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "REPLACE"
mimicsql_data
CREATE TABLE table_9946 ( "Place" text, "Athlete" text, "Points" text, "Score" text, "500 m" text, "1500 m" text, "5000 m" text, "10000 m" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which athlete had a score of 236.023?
SELECT "Athlete" FROM table_9946 WHERE "Score" = '236.023'
wikisql
CREATE TABLE table_name_16 ( points INTEGER, year VARCHAR, entrant VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the average points of Scuderia Scribante with a Brabham bt11 chassis before 1968?
SELECT AVG(points) FROM table_name_16 WHERE entrant = "scuderia scribante" AND chassis = "brabham bt11" AND year < 1968
sql_create_context
CREATE TABLE table_19189856_1 ( first_performance VARCHAR, performer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many first performances where performer is wilfred engelman category:articles with hcards
SELECT COUNT(first_performance) FROM table_19189856_1 WHERE performer = "Wilfred Engelman category:Articles with hCards"
sql_create_context
CREATE TABLE table_57442 ( "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. -- What w...
SELECT "Location Attendance" FROM table_57442 WHERE "Record" = '3–16'
wikisql
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 demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Robert Hyden"
mimicsql_data
CREATE TABLE table_62409 ( "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. -- What is the Place of the Player with a Score of 73-67-74-71=285?
SELECT "Place" FROM table_62409 WHERE "Score" = '73-67-74-71=285'
wikisql
CREATE TABLE table_8623 ( "Discipline" text, "Championship" text, "Circuit" text, "Session" text, "Cause" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which session had a discipline of open wheel?
SELECT "Session" FROM table_8623 WHERE "Discipline" = 'open wheel'
wikisql
CREATE TABLE table_name_22 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2012 value with 479 in 2008?
SELECT 2012 FROM table_name_22 WHERE 2008 = "479"
sql_create_context
CREATE TABLE table_378 ( "Member" text, "Electorate" text, "Province" text, "MPs term" text, "Election date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the election date where electorate is omata
SELECT "Election date" FROM table_378 WHERE "Electorate" = 'Omata'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-36108')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE table_12078626_1 ( success VARCHAR, date_of_completion VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the success where date of completion is september 28, 2007
SELECT success FROM table_12078626_1 WHERE date_of_completion = "September 28, 2007"
sql_create_context
CREATE TABLE table_15417439_1 ( identity VARCHAR, genus_species VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What identities do the genus/species arabidopsis thaliana have?
SELECT identity FROM table_15417439_1 WHERE genus_species = "Arabidopsis thaliana"
sql_create_context
CREATE TABLE table_10074 ( "City" text, "Province" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Province with ICAO of zbcf?
SELECT "Province" FROM table_10074 WHERE "ICAO" = 'zbcf'
wikisql
CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER ) CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DATETIME, ExaminationRoom TEXT ...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID
nvbench
CREATE TABLE table_39073 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the pick for player roger zatkoff?
SELECT SUM("Pick") FROM table_39073 WHERE "Player" = 'roger zatkoff'
wikisql
CREATE TABLE table_26368963_1 ( under_13 VARCHAR, under_17 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the under-17 was Antonio Glez, who was the under-13?
SELECT under_13 FROM table_26368963_1 WHERE under_17 = "Antonio Glez"
sql_create_context
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 athletes have a time of 13.29 ?
SELECT COUNT("name") FROM table_204_71 WHERE "time" = 13.29
squall
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE equipment_...
SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg, flight_stop WHERE (CITY_1.city_code = ...
atis
CREATE TABLE table_name_23 ( surface VARCHAR, championship VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the surface when the championship is rome and the opponent is sergi bruguera?
SELECT surface FROM table_name_23 WHERE championship = "rome" AND opponent = "sergi bruguera"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "OVERDOSE" AND demographic.dod_year <= "2111.0"
mimicsql_data
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_lab...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i...
mimic_iii
CREATE TABLE table_52584 ( "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 home team played against south Melbourne?
SELECT "Home team" FROM table_52584 WHERE "Away team" = 'south melbourne'
wikisql
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 prescriptions ( subject_id text, hadm_id...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.age >= "79"
mimicsql_data
CREATE TABLE table_28378 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the written by when...
SELECT "Written by" FROM table_28378 WHERE "Title" = 'His Hour Upon the Stage'
wikisql
CREATE TABLE artwork ( TYPE VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the most common type of artworks.
SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_70813 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest lane with a time of 2:05.90, and a Heat larger than 3?
SELECT MIN("Lane") FROM table_70813 WHERE "Time" = '2:05.90' AND "Heat" > '3'
wikisql
CREATE TABLE table_name_24 ( total VARCHAR, year_built VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many entries feature a year built of 2010?
SELECT COUNT(total) FROM table_name_24 WHERE year_built = 2010
sql_create_context
CREATE TABLE table_203_771 ( id number, "#" number, "artist" text, "featuring" text, "title" text, "version" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total titles are listed for the artist benassi bros. . ?
SELECT COUNT("title") FROM table_203_771 WHERE "artist" = 'benassi bros'
squall
CREATE TABLE table_25394 ( "Team" text, "SEC Wins" real, "SEC Losses" real, "Percentage" text, "Home Record" text, "Road Record" text, "Overall Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of road record for team ol...
SELECT COUNT("Road Record") FROM table_25394 WHERE "Team" = 'Ole Miss'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, ...
SELECT jybgb.KSBM, jybgb.KSMC 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...
css
CREATE TABLE table_78801 ( "Service name" text, "Owner" text, "Catch-up period" text, "Streamed" text, "Download" text, "Technology" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Service Name has UTV as the owner?
SELECT "Service name" FROM table_78801 WHERE "Owner" = 'utv'
wikisql
CREATE TABLE table_23053 ( "Series #" real, "Episode #" real, "Title" text, "Written by" text, "Directed by" text, "Viewers" real, "Original airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original air date for the episo...
SELECT "Original airdate" FROM table_23053 WHERE "Title" = 'The Transit of Venus'
wikisql
CREATE TABLE table_78968 ( "Crowd" real, "Venue" text, "Home Team" text, "Opponent" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance at Round 9?
SELECT COUNT("Crowd") FROM table_78968 WHERE "Round" = 'round 9'
wikisql
CREATE TABLE table_77630 ( "YEAR" real, "Seniors" text, "Reserves" text, "Thirds (Under 17's)" text, "Fourths (Under 14's)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which seniors have a year before 2007, Fourths (Under 14's) of kiewa-sandy cre...
SELECT "Seniors" FROM table_77630 WHERE "YEAR" < '2007' AND "Fourths (Under 14's)" = 'kiewa-sandy creek' AND "Reserves" = 'mitta united'
wikisql
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arriv...
SELECT DISTINCT flight_id FROM flight WHERE (((departure_time < 600 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 24 AND DATE_DAYalias0.month_number = 5 AND DATE_DAYal...
atis
CREATE TABLE table_1471 ( "C/W 15+" real, "Oblast\\Age" text, "15 to 17" real, "18 to 19" real, "20 to 24" real, "25 to 29" real, "30 to 34" real, "35 to 39" real, "40 to 44" real, "45 to 49" real, "50 to 54" real, "55 to 59" real, "60 to 64" real, "65 to 69" real...
SELECT "18 to 19" FROM table_1471 WHERE "70+" = '4562'
wikisql
CREATE TABLE table_name_80 ( game INTEGER, record VARCHAR, october VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has a Record of 5 3 1, and an October smaller than 29?
SELECT SUM(game) FROM table_name_80 WHERE record = "5–3–1" AND october < 29
sql_create_context
CREATE TABLE table_64240 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- wh...
SELECT AVG("Latitude") FROM table_64240 WHERE "Water (sqmi)" = '0.058' AND "ANSI code" < '1759683'
wikisql
CREATE TABLE match ( match_id number, date text, venue text, score text, result text, competition text ) CREATE TABLE city ( city_id number, city text, hanzi text, hanyu_pinyin text, regional_population number, gdp number ) CREATE TABLE temperature ( city_id number,...
SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000
spider
CREATE TABLE table_49861 ( "Province" text, "Skip" text, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Shot Pct., when Stolen Ends is 2?
SELECT "Shot Pct." FROM table_49861 WHERE "Stolen Ends" = '2'
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 microbiologyevents ( row_id number, subject_id number, ...
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) = '2101' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3
mimic_iii
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair_assignment ( ...
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE table_name_22 ( term VARCHAR, district VARCHAR, party VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which term had a Democratic representative from district 7?
SELECT term FROM table_name_22 WHERE district = "7" AND party = "democratic"
sql_create_context
CREATE TABLE table_name_5 ( term VARCHAR, name_of_acharya VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the term of acharya shree vasudevprasadji maharaj?
SELECT term FROM table_name_5 WHERE name_of_acharya = "acharya shree vasudevprasadji maharaj"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests i...
SELECT DISTINCT department FROM course WHERE name LIKE '%Upper-Level Writing%'
advising
CREATE TABLE table_name_53 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date with an Opponent that is flavia pennetta?
SELECT date FROM table_name_53 WHERE opponent = "flavia pennetta"
sql_create_context
CREATE TABLE table_60849 ( "Medal" text, "Name" text, "Sport" text, "Event" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What sport has Ma Yuxi in it?
SELECT "Sport" FROM table_60849 WHERE "Name" = 'ma yuxi'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM...
css
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE tra...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE table_203_141 ( id number, "sr. no." number, "name" text, "from" text, "till" text, "occupation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was director after rajeshwar prasad ?
SELECT "name" FROM table_203_141 WHERE "sr. no." = (SELECT "sr. no." FROM table_203_141 WHERE "name" = 'rajeshwar prasad') - 1
squall
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE author ( authorid int...
SELECT DISTINCT COUNT(paper.paperid) FROM journal, paper, paperkeyphrase WHERE journal.journalname = 'Cell' AND paper.journalid = journal.journalid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2015
scholar
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 * 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.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE Staff ( staff_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80) ) CREATE TABLE Customers ( customer_id INTEGER, customer_type_code VARCHAR(20), address_line_1 VARCHAR(80), address_line_...
SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY product_category_code
nvbench
CREATE TABLE table_4222 ( "Seed" real, "Rank" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many new points does the player ...
SELECT MAX("New points") FROM table_4222 WHERE "Player" = 'Roberta Vinci'
wikisql
CREATE TABLE table_name_14 ( organization VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What organization ranks 68?
SELECT organization FROM table_name_14 WHERE rank = "68"
sql_create_context
CREATE TABLE table_893 ( "Year" text, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of women's doubles for 1986
SELECT COUNT("Womens doubles") FROM table_893 WHERE "Year" = '1986'
wikisql
CREATE TABLE table_train_225 ( "id" int, "heart_disease" bool, "diabetic" string, "creatinine_clearance_cl" float, "panel_reactive_antibodies" int, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- between 21 and 80 years ...
SELECT * FROM table_train_225 WHERE age >= 21 AND age <= 80
criteria2sql
CREATE TABLE table_7005 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a IATA of vie?
SELECT "Country" FROM table_7005 WHERE "IATA" = 'vie'
wikisql
CREATE TABLE table_63890 ( "Actor" text, "Character" text, "Soap Opera" text, "Years" text, "Duration" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the soap opera when the duration is 18 years and the character is miley byrne?
SELECT "Soap Opera" FROM table_63890 WHERE "Duration" = '18 years' AND "Character" = 'miley byrne'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
CREATE TABLE table_59187 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average money ( ) that has +8 as the to par, with 73-72-72-71=288 ...
SELECT AVG("Money ( \u00a3 )") FROM table_59187 WHERE "To par" = '+8' AND "Score" = '73-72-72-71=288'
wikisql
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY COUNT(Country)
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_name_53 ( entered VARCHAR, eliminated VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Entered when the eliminated number is 3?
SELECT COUNT(entered) FROM table_name_53 WHERE eliminated = "3"
sql_create_context
CREATE TABLE table_71836 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for detroit and decision of denis
SELECT "Record" FROM table_71836 WHERE "Home" = 'detroit' AND "Decision" = 'denis'
wikisql
CREATE TABLE table_42583 ( "Ship size" text, "Cargo" text, "2004" text, "2005" text, "2006" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the cargo value in 2004 for ship size?
SELECT "2004" FROM table_42583 WHERE "Ship size" = 'ship size'
wikisql
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. -- which nation was not in the top 10 iran or germany ?
SELECT "nation" FROM table_203_812 WHERE "nation" IN ('iran', 'germany') AND "rank" > 10
squall
CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transa...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count > 100 OR amount_of_transaction > 1000
nvbench
CREATE TABLE table_54410 ( "Round" real, "Overall" real, "Player" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club team has 216 overall?
SELECT "Club team" FROM table_54410 WHERE "Overall" = '216'
wikisql
CREATE TABLE table_49902 ( "Team" text, "Sport" text, "Played" text, "Venue" text, "Championships" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What sport was played at the bosse field?
SELECT "Sport" FROM table_49902 WHERE "Venue" = 'bosse field'
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_CD = 'Y80.928' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_...
css
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) -- Using valid SQLite, answer...
SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team ORDER BY COUNT(Team) DESC
nvbench
CREATE TABLE table_63513 ( "Tournament" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "Win %" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Win %" FROM table_63513 WHERE "2003" = 'atp world tour finals'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '苗星河' AND t_kc22.STA_DATE BETWEEN '2000-07-11' AND '2017-06-02' AND gwyjzb.MED_SER_ORG_NO = '0680435' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_...
css
CREATE TABLE table_name_36 ( result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result against opponent Amanda Lucas?
SELECT result FROM table_name_36 WHERE opponent = "amanda lucas"
sql_create_context
CREATE TABLE table_name_84 ( cardinalatial_order_and_title VARCHAR, elector VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Cardinalatial order and title that Pedro Mart nez de Luna y Gotor elevated?
SELECT cardinalatial_order_and_title FROM table_name_84 WHERE elector = "pedro martínez de luna y gotor"
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 medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-61209' AND NOT patient.hospitaldischargetime IS NULL ORDER BY p...
eicu
CREATE TABLE table_20498 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the margin of victory with the winni...
SELECT "Margin of victory" FROM table_20498 WHERE "Winning score" = '63-68-68-68=267'
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2145" AND procedures.icd9_code = "17"
mimicsql_data
CREATE TABLE table_name_80 ( score VARCHAR, tournament VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT WAS THE SCORE IN THE FINAL PLAYED AGAINST JOSE CHECA-CALVO IN THE SANT CUGAT TOURNAMENT ?
SELECT score FROM table_name_80 WHERE tournament = "sant cugat" AND opponent_in_the_final = "jose checa-calvo"
sql_create_context