instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_70212 ( "Grand Prix" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the pole positon for korean grand prix
SELECT "Pole position" FROM table_70212 WHERE "Grand Prix" = 'korean grand prix'
wikisql
CREATE TABLE table_52663 ( "Chemical class" text, "Group" text, "Formula" text, "Prefix" text, "Suffix" text, "Example" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What prefix has Bromo as the group?
SELECT "Prefix" FROM table_52663 WHERE "Group" = 'bromo'
wikisql
CREATE TABLE table_203_710 ( id number, "genre" text, "year" number, "title" text, "episode" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last piece of filmography that he has worked on to date ?
SELECT "title" FROM table_203_710 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_68993 ( "Material" text, "Resistivity (10 \u22126 ohm-inches)" real, "Relative permeability" real, "Skin depth, inches" real, "Surface resistance, Relative to copper" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the aver...
SELECT AVG("Relative permeability") FROM table_68993 WHERE "Resistivity (10 \u22126 ohm-inches)" < '1.12' AND "Surface resistance, Relative to copper" < '1'
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 T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
nvbench
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ...
WITH a AS (SELECT p.Id, COUNT(p.Id) AS nId, TIME_TO_STR(p.CreationDate, '%Y') AS PostYr, TIME_TO_STR(v.CreationDate, '%Y') + 1.00 * TIME_TO_STR(v.CreationDate, '%-M') / 12 AS VoteMonth FROM Posts AS p JOIN Votes AS v ON p.Id = v.PostId WHERE p.PostTypeId IN (1) AND v.VoteTypeId IN (2, 3) GROUP BY p.Id, TIME_TO_STR(p.Cr...
sede
CREATE TABLE table_name_25 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game on May 31?
SELECT SUM(attendance) FROM table_name_25 WHERE date = "may 31"
sql_create_context
CREATE TABLE table_32618 ( "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 away team played at Glenferrie Oval?
SELECT "Away team" FROM table_32618 WHERE "Venue" = 'glenferrie oval'
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 COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '2596003' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-10-17' AND '2018-11-04' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 1825.05) AS T
css
CREATE TABLE table_38454 ( "Line" text, "Speed" text, "Length" text, "Construction begun" text, "Expected start of revenue services" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the length when the expected start of revenue is more than 20...
SELECT "Length" FROM table_38454 WHERE "Expected start of revenue services" > '2017'
wikisql
CREATE TABLE table_name_63 ( country VARCHAR, money___$__ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- From which country is the player who made less than $216?
SELECT country FROM table_name_63 WHERE money___$__ < 216
sql_create_context
CREATE TABLE table_66497 ( "Position" text, "Country" text, "Floor" real, "Pommel Horse" real, "Rings" real, "Vault" real, "Parallel Bars" real, "Horizontal Bar" real, "Team Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name ...
SELECT MAX("Horizontal Bar") FROM table_66497 WHERE "Country" = 'france' AND "Rings" < '58.975'
wikisql
CREATE TABLE table_31166 ( "District" real, "Representative" text, "Party" text, "Residence" text, "First Elected" text, "Term Limited" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which district does andy thompson represent
SELECT COUNT("District") FROM table_31166 WHERE "Representative" = 'Andy Thompson'
wikisql
CREATE TABLE table_39675 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the Euro '64 qualifying game?
SELECT "Results\u00b9" FROM table_39675 WHERE "Type of game" = 'euro ''64 qualifying'
wikisql
CREATE TABLE table_name_31 ( saka_era VARCHAR, sign_of_zodiac VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE SAKA ERA OF VIRGO?
SELECT saka_era FROM table_name_31 WHERE sign_of_zodiac = "virgo"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostHistory ( Id number, Po...
SELECT Id FROM Users
sede
CREATE TABLE table_72515 ( "Rank" real, "Rider" text, "Mon 26 May" text, "Tues 27 May" text, "Wed 28 May" text, "Thurs 29 May" text, "Fri 30 May" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the numbr for fri may 30 and mon may 26 ...
SELECT "Fri 30 May" FROM table_72515 WHERE "Mon 26 May" = '19'' 02.890 118.847mph'
wikisql
CREATE TABLE table_23123 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the nhl times for jeff jacques
SELECT "NHL team" FROM table_23123 WHERE "Player" = 'Jeff Jacques'
wikisql
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Open biopsy of soft tissue"
mimicsql_data
CREATE TABLE table_52299 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the driver with Laps larger than 16 with a ferrari and grid less than 15
SELECT "Driver" FROM table_52299 WHERE "Laps" > '16' AND "Constructor" = 'ferrari' AND "Grid" < '15'
wikisql
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Course_Authors_and_Tutors ( author_id I...
SELECT family_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_name_49 ( score VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the score for game 4?
SELECT score FROM table_name_49 WHERE game = 4
sql_create_context
CREATE TABLE table_name_96 ( caps VARCHAR, player VARCHAR, province___club VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Caps, when Province / Club is Example, when Position is Prop, and when Player is Sam Walters?
SELECT caps FROM table_name_96 WHERE province___club = "example" AND position = "prop" AND player = "sam walters"
sql_create_context
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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admission_type = "URGENT"
mimicsql_data
CREATE TABLE elimination ( TIME VARCHAR, Eliminated_By VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the times of elimination by 'Punk' or 'Orton'.
SELECT TIME FROM elimination WHERE Eliminated_By = "Punk" OR Eliminated_By = "Orton"
sql_create_context
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 COUNT(*), rank FROM captain GROUP BY rank
spider
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-83')) AND STRFTIME('%y-%m', lab.labresulttime) <= '2105-04' ORDER BY lab.labres...
eicu
CREATE TABLE table_name_52 ( fa_trophy INTEGER, player VARCHAR, league VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many FA Trophy has a Player of mario walsh and a League larger than 17?
SELECT AVG(fa_trophy) FROM table_name_52 WHERE player = "mario walsh" AND league > 17
sql_create_context
CREATE TABLE table_204_126 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the number of times the united states is listed as the ...
SELECT COUNT(*) FROM table_204_126 WHERE "country" = 'united states'
squall
CREATE TABLE table_32701 ( "Dance" text, "Best dancer(s)" text, "Highest score" real, "Worst dancer(s)" text, "Lowest score" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which of the Worst dancer(s) has the Lowest score of 14?
SELECT "Worst dancer(s)" FROM table_32701 WHERE "Lowest score" = '14'
wikisql
CREATE TABLE table_name_22 ( wickets VARCHAR, rank INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the total number of Wickets that ranger higher than 5?
SELECT COUNT(wickets) FROM table_name_22 WHERE rank > 5
sql_create_context
CREATE TABLE table_28734 ( "Institution" text, "Location" text, "Team Nickname" text, "Years" text, "New Conference" text, "New Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the nickname the Red Raiders?
SELECT "Location" FROM table_28734 WHERE "Team Nickname" = 'Red Raiders'
wikisql
CREATE TABLE table_41171 ( "Issue" text, "Date" text, "Title" text, "Penciller" text, "Color" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Date of the Cimmeria Issue for which the Penciller was Tom s Giorello?
SELECT "Date" FROM table_41171 WHERE "Penciller" = 'tomás giorello' AND "Title" = 'cimmeria'
wikisql
CREATE TABLE table_8210 ( "Region" text, "Date" text, "Label" text, "Format" text, "Version" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Region of the release on December 22, 2008?
SELECT "Region" FROM table_8210 WHERE "Date" = 'december 22, 2008'
wikisql
CREATE TABLE table_39032 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What...
SELECT MAX("Poles") FROM table_39032 WHERE "Starts" > '18' AND "Winnings" = '$125,102' AND "Year" < '1992'
wikisql
CREATE TABLE table_203_548 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the total number of medals received by the nations ranke...
SELECT SUM("total") FROM table_203_548 WHERE "rank" = 11
squall
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 procedures.short_title = "Closed bronchial biopsy"
mimicsql_data
CREATE TABLE table_77277 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Local Time" text, "AEDT Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Home team score" FROM table_77277 WHERE "AEDT Time" = '11:00 pm'
wikisql
CREATE TABLE table_name_40 ( home_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team when the tie is 11?
SELECT home_team FROM table_name_40 WHERE tie_no = "11"
sql_create_context
CREATE TABLE table_57721 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lost On August 20
SELECT "Loss" FROM table_57721 WHERE "Date" = 'august 20'
wikisql
CREATE TABLE table_name_54 ( constructor VARCHAR, rounds VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the constructor on the team with 8 rounds and a chassis of 156 158 1512?
SELECT constructor FROM table_name_54 WHERE rounds = "8" AND chassis = "156 158 1512"
sql_create_context
CREATE TABLE table_19454 ( "Virtual" real, "Physical" real, "Call sign" text, "Branding" text, "Network" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the virtual for Fox
SELECT COUNT("Virtual") FROM table_19454 WHERE "Network" = 'Fox'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal bool...
SELECT q.Id AS "post_link" FROM Posts AS q WHERE PostTypeId = 1 AND Score > 0 AND ClosedDate IS NULL AND (SELECT COUNT(*) FROM Posts AS a WHERE a.ParentId = q.Id AND a.Score > -1) = 0 AND AcceptedAnswerId IS NULL ORDER BY CreationDate
sede
CREATE TABLE table_69506 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the start number for a rank 11 race with less than 200 laps?
SELECT "Start" FROM table_69506 WHERE "Laps" < '200' AND "Rank" = '11'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY All_Games DESC
nvbench
CREATE TABLE table_59182 ( "Elimination" text, "Wrestler" text, "Eliminated by" text, "Elimination Move" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Elimination number is listed againt Eliminated by Sonjay Dutt?
SELECT "Elimination" FROM table_59182 WHERE "Eliminated by" = 'sonjay dutt'
wikisql
CREATE TABLE table_27261 ( "Air date" text, "Reward" text, "Immunity" text, "Eliminated" text, "Vote" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the vote when the air date is 4 october 1997?
SELECT "Vote" FROM table_27261 WHERE "Air date" = '4 October 1997'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskSt...
SELECT p.Id AS "post_link", COUNT(*) AS "occurrences" FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId WHERE p.PostTypeId = 1 AND p.ClosedDate IS NULL AND v.VoteTypeId = 6 GROUP BY p.Id HAVING COUNT(*) >= 2 ORDER BY occurrences DESC
sede
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, U...
SELECT Id, Tags, Body FROM Posts WHERE PostTypeId = 1 AND Body LIKE '%new to%'
sede
CREATE TABLE table_26125 ( "Represent" text, "Contestant" text, "Age" real, "Height (ft.)" text, "Height (mtr.)" text, "Hometown" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country had a contestant that was 1.70 meters tall?
SELECT "Represent" FROM table_26125 WHERE "Height (mtr.)" = '1.70'
wikisql
CREATE TABLE table_name_31 ( secr_numbers VARCHAR, year_made VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the SECR number of the item made in 1861?
SELECT secr_numbers FROM table_name_31 WHERE year_made = "1861"
sql_create_context
CREATE TABLE table_name_69 ( score INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How high did Arnold Palmer score in 1962?
SELECT MAX(score) FROM table_name_69 WHERE player = "arnold palmer"
sql_create_context
CREATE TABLE table_78791 ( "Release" text, "Chart" text, "Peak Position" real, "Sales Total" real, "Chart Run" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Chart has a Peak Position of 1?
SELECT "Chart" FROM table_78791 WHERE "Peak Position" = '1'
wikisql
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 demographic.dischtime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "91588"
mimicsql_data
CREATE TABLE table_75133 ( "Rank" text, "Runs" text, "Opponent" text, "Venue" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Runs has a Rank of =5 and an Opponent of south australia?
SELECT "Runs" FROM table_75133 WHERE "Rank" = '=5' AND "Opponent" = 'south australia'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT COUNT(*) > 0 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 = 22120) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (SELECT d_...
mimic_iii
CREATE TABLE table_name_14 ( result VARCHAR, week VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game after Week 13 on December 8, 1991?
SELECT result FROM table_name_14 WHERE week > 13 AND date = "december 8, 1991"
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.admission_type = "EMERGENCY" AND demographic.days_stay > "23"
mimicsql_data
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 prescriptions.drug_type FROM prescriptions WHERE prescriptions.subject_id = "2560"
mimicsql_data
CREATE TABLE table_951 ( "No." text, "Name" text, "Livery" text, "Arrival" real, "Type" text, "Configuration" text, "Builder" text, "Built" real, "Status" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whats the ...
SELECT "Status" FROM table_951 WHERE "Location" = 'Museum'
wikisql
CREATE TABLE table_name_94 ( royal_house VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What royal house did Shaokang belong to?
SELECT royal_house FROM table_name_94 WHERE name = "shaokang"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY AVG(Height)
nvbench
CREATE TABLE table_80049 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years had more than 0 points?
SELECT SUM("Year") FROM table_80049 WHERE "Points" > '0'
wikisql
CREATE TABLE table_58563 ( "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. -- When did the home team score 9.13 (67)?
SELECT "Date" FROM table_58563 WHERE "Home team score" = '9.13 (67)'
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 T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_name_43 ( player VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player is from the Denver Broncos?
SELECT player FROM table_name_43 WHERE team = "denver broncos"
sql_create_context
CREATE TABLE table_74885 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for score of 1-5
SELECT "Date" FROM table_74885 WHERE "Score" = '1-5'
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 T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Price
nvbench
CREATE TABLE table_train_26 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "allergy_to_penicillin" bool, "active_infection" bool, "allergy_to_cephalosporin" bool, "receiving_anticoagulants" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following ...
SELECT * FROM table_train_26 WHERE receiving_anticoagulants = 1
criteria2sql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE microlab ( microl...
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 = '004-11043')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE song ( song_name varchar2(50), artist...
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY AVG(rating)
nvbench
CREATE TABLE airport ( Airport_ID int, Airport_Name text, Total_Passengers real, %_Change_2007 text, International_Passengers real, Domestic_Passengers real, Transit_Passengers real, Aircraft_Movements real, Freight_Metric_Tonnes real ) CREATE TABLE airport_aircraft ( ID int, ...
SELECT Aircraft, COUNT(Aircraft) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY Aircraft ORDER BY COUNT(Aircraft)
nvbench
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87232 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine')
mimic_iii
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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
mimicsql_data
CREATE TABLE table_name_60 ( points INTEGER, entrant VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was marlboro brm's lowest points by using brm p160b?
SELECT MIN(points) FROM table_name_60 WHERE entrant = "marlboro brm" AND chassis = "brm p160b"
sql_create_context
CREATE TABLE table_name_74 ( net_power VARCHAR, type VARCHAR, finish_construction VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the net power, when the type was wwer-440/230, and when construction was finished on 24.10.1977?
SELECT net_power FROM table_name_74 WHERE type = "wwer-440/230" AND finish_construction = "24.10.1977"
sql_create_context
CREATE TABLE table_26177 ( "Neighbourhood" text, "% 0-19" text, "% 20-39" text, "% 40-59" text, "% 60-74" text, "% 75 +" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every value for % 40-59 if % 60-74 is 12,42%?
SELECT "% 40-59" FROM table_26177 WHERE "% 60-74" = '12,42%'
wikisql
CREATE TABLE table_name_14 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average attendance that has april 12 as the date?
SELECT AVG(attendance) FROM table_name_14 WHERE date = "april 12"
sql_create_context
CREATE TABLE table_18638 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many incumbents were first elected in 1930?
SELECT COUNT("Party") FROM table_18638 WHERE "First elected" = '1930'
wikisql
CREATE TABLE table_name_30 ( function__figure_ VARCHAR, real_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What role did Jean-Luc Bouvier serve?
SELECT function__figure_ FROM table_name_30 WHERE real_name = "jean-luc bouvier"
sql_create_context
CREATE TABLE table_name_73 ( year VARCHAR, league VARCHAR, malaysia_cup VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the League the malaysian super league, and a Malaysia Cup of group stage?
SELECT year FROM table_name_73 WHERE league = "malaysian super league" AND malaysia_cup = "group stage"
sql_create_context
CREATE TABLE table_204_397 ( id number, "rank" text, "team" text, "athletes" text, "run 1" text, "run 2" text, "run 3" text, "run 4" text, "final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what team came out on top ?
SELECT "team" FROM table_204_397 WHERE id = 1
squall
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '蒋天干' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2000-08-12' AND '2015-01-13'
css
CREATE TABLE table_14494 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total rank with a Nation of gotland, and a Gold larger than 23?
SELECT COUNT("Rank") FROM table_14494 WHERE "Nation" = 'gotland' AND "Gold" > '23'
wikisql
CREATE TABLE table_name_51 ( writer_s_ VARCHAR, episode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote Episode 2-15 (56)?
SELECT writer_s_ FROM table_name_51 WHERE episode = "2-15 (56)"
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 restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, m...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_tim...
atis
CREATE TABLE table_name_55 ( points INTEGER, position VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average points when position is more than 5 and played is less than 10?
SELECT AVG(points) FROM table_name_55 WHERE position > 5 AND played < 10
sql_create_context
CREATE TABLE table_28626 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What couple had a total of 8?
SELECT "Couple" FROM table_28626 WHERE "Total" = '8'
wikisql
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating nu...
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY AVG(rating)
nvbench
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD ...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1165324' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-04-26' AND '2008-06-23' AND t_kc21.INSU_TYPE = '儿童'
css
CREATE TABLE table_name_15 ( scores_by_each_individual_judge VARCHAR, status VARCHAR, date_performed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Scores by each individual judge has a Status of eliminated, and a Date performed of august 13?
SELECT scores_by_each_individual_judge FROM table_name_15 WHERE status = "eliminated" AND date_performed = "august 13"
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Chrnc hpt C wo hpat coma" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Customer_Policies ( Policy_ID INTEGE...
SELECT T1.Claim_ID, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_ID = T2.Claim_ID GROUP BY T1.Claim_ID
nvbench
CREATE TABLE table_52857 ( "Station Number" text, "District" text, "Location" text, "Type" text, "Appliances" text, "Registrations" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the station at Huntingdonshire with a stat...
SELECT "Location" FROM table_52857 WHERE "District" = 'huntingdonshire' AND "Station Number" = 'c17'
wikisql
CREATE TABLE player ( POSITION VARCHAR, name VARCHAR, Points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the position of players with average number of points scored by players of that position bigger than 20.
SELECT POSITION FROM player GROUP BY name HAVING AVG(Points) >= 20
sql_create_context
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType DESC
nvbench
CREATE TABLE table_68650 ( "Tournament" text, "2003" text, "2007" text, "2008" text, "2009" text, "2011" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2003 value with 2r in 2008 and 1r in 2011?
SELECT "2003" FROM table_68650 WHERE "2008" = '2r' AND "2011" = '1r'
wikisql
CREATE TABLE table_73830 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" text, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The population i...
SELECT "Dominant religion (2002)" FROM table_73830 WHERE "Population (2011)" = '2,107'
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 demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Chandra Schulman"
mimicsql_data