instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_64801 ( "School (IHSAA ID#)" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text, "Year Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year did the school with enrol...
SELECT "Year Joined" FROM table_64801 WHERE "Enrollment" = '413'
wikisql
CREATE TABLE table_name_65 ( tournament VARCHAR, score_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament had a final score of 6 3, 6 2?
SELECT tournament FROM table_name_65 WHERE score_in_the_final = "6–3, 6–2"
sql_create_context
CREATE TABLE table_9219 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the winner and score for finalist s bastien grosjean?
SELECT "Winner and score" FROM table_9219 WHERE "Finalist" = 'sébastien grosjean'
wikisql
CREATE TABLE Staff ( staff_id INTEGER, staff_name VARCHAR(255), gender VARCHAR(1), other_staff_details VARCHAR(255) ) CREATE TABLE Skills ( skill_id INTEGER, skill_code VARCHAR(20), skill_description VARCHAR(255) ) CREATE TABLE Third_Party_Companies ( company_id INTEGER, company_ty...
SELECT skill_description, COUNT(skill_description) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description ORDER BY COUNT(skill_description)
nvbench
CREATE TABLE table_name_33 ( winner VARCHAR, result VARCHAR, loser VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Winner, when the Loser is the Baltimore Colts, when the Location is Schaefer Stadium, and when the Result i...
SELECT winner FROM table_name_33 WHERE loser = "baltimore colts" AND location = "schaefer stadium" AND result = "42-3"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775 AND admissions.dischtime IS NULL)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_item...
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT demographic.religion, demographic.ethnicity FROM demographic WHERE demographic.name = "Hector Blair"
mimicsql_data
CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_number number, draft_class text, college text ) CREATE TABLE player ( player_id number, player text, years_played text, total_wl text, singles_wl text, ...
SELECT T1.position FROM match_season AS T1 JOIN team AS T2 ON T1.team = T2.team_id WHERE T2.name = "Ryley Goldner"
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, K...
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.ZZYSGH = '34115354' AND txmzjzjlb.JZKSRQ BETWEEN '2005-01-17' AND '2019-09-19' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.ZZYSGH = '34115354' AND ftxmzjzjlb.JZKSRQ BETWEEN '2005-01-17' AND '2019-09-19'
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-15')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETI...
eicu
CREATE TABLE table_29096 ( "Series #" real, "Episode #" real, "Title" text, "Director" text, "Writer" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The director of the episode with the title 'The Sky is Falling' is who?...
SELECT "Director" FROM table_29096 WHERE "Title" = 'The Sky is Falling'
wikisql
CREATE TABLE table_203_168 ( id number, "team name" text, "leagues" text, "base" text, "year started" text, "year ended" text, "notable riders" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the next team to end after the london lio...
SELECT "team name" FROM table_203_168 WHERE "year ended" > (SELECT "year ended" FROM table_203_168 WHERE "team name" = 'london lions') ORDER BY "year ended" LIMIT 1
squall
CREATE TABLE campuses ( id VARCHAR, campus VARCHAR ) CREATE TABLE faculty ( campus VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many faculty lines are there in 'San Francisco State University' in year 2004?
SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = "San Francisco State University"
sql_create_context
CREATE TABLE table_51412 ( "Year" real, "Film" text, "Role" text, "Leading Man" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What director directed the role of shelby barret wyatt in 1935?
SELECT "Director" FROM table_51412 WHERE "Year" = '1935' AND "Role" = 'shelby barret wyatt'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium, whole blood'))
mimic_iii
CREATE TABLE table_27764201_2 ( game_site VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did the Centurions play the Rhein Fire?
SELECT COUNT(game_site) FROM table_27764201_2 WHERE opponent = "Rhein Fire"
sql_create_context
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 demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560"
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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '17410143'
css
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
SELECT COUNT(*) FROM mzjzjlb WHERE JZKSBM = '97321' AND JZKSRQ BETWEEN '2018-02-23' AND '2021-07-20'
css
CREATE TABLE qtb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5932040' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5932040' GROUP BY gyb.MED_ORG_DEPT_NM, gyb....
css
CREATE TABLE table_name_32 ( home_team VARCHAR, crowd INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the home team had a crowd larger than 21,188?
SELECT home_team AS score FROM table_name_32 WHERE crowd > 21 OFFSET 188
sql_create_context
CREATE TABLE table_45054 ( "Season" text, "Races" real, "Wins" real, "Podiums" real, "Poles" real, "Fastest Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of poles when the fastest laps are less than 0?
SELECT MIN("Poles") FROM table_45054 WHERE "Fastest Laps" < '0'
wikisql
CREATE TABLE table_name_43 ( crowd INTEGER, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want to know the average crowd for away team of melbourne
SELECT AVG(crowd) FROM table_name_43 WHERE away_team = "melbourne"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGui...
WITH PostsPerUser AS (SELECT u.Id, COUNT(*) AS NumPosts FROM Posts AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserId WHERE a.PostTypeId IN (1, 2) GROUP BY u.Id HAVING COUNT(*) >= @MinAnswers), TopUsers AS (SELECT u.Id AS "user_link", u.Reputation, ppu.NumPosts, (CAST(u.Reputation AS FLOAT) / NumPosts) AS RepPerPost FR...
sede
CREATE TABLE table_203_789 ( id number, "season" text, "team" text, "country" text, "division" number, "apps" number, "goals" number, "assists" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in which season was there a total of 2 assis...
SELECT "season" FROM table_203_789 WHERE "assists" = 2
squall
CREATE TABLE table_name_45 ( tier INTEGER, postseason VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of tiers for the postseason of semifinalist?
SELECT SUM(tier) FROM table_name_45 WHERE postseason = "semifinalist"
sql_create_context
CREATE TABLE table_26495 ( "Administrative division" text, "Area (km\u00b2) 2011**" text, "Population 2001 Census (Adjusted)" real, "Population 2011 Census (Adjusted)" real, "Population density (/km\u00b2 2011)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Population density (/km\u00b2 2011)" FROM table_26495 WHERE "Area (km\u00b2) 2011**" = '684.37'
wikisql
CREATE TABLE table_9068 ( "Name" text, "Height" text, "Weight" real, "Position" text, "Bats/Throws" text, "Class" text, "Hometown/Highschool" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did kyle mckenzie play?
SELECT "Position" FROM table_9068 WHERE "Name" = 'kyle mckenzie'
wikisql
CREATE TABLE table_1243601_1 ( regular_season VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the regular season listing in 2007?
SELECT regular_season FROM table_1243601_1 WHERE year = "2007"
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.label = "Troponin T"
mimicsql_data
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "311"
mimicsql_data
CREATE TABLE table_204_763 ( id number, "county" text, "km" number, "intersecting road" text, "notes" text, "coordinates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last intersecting road on the chart ?
SELECT "intersecting road" FROM table_204_763 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_name_23 ( date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game with an attendance of 20,874 fans?
SELECT date FROM table_name_23 WHERE attendance = "20,874"
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) ...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'atypical lymphocytes')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY...
mimic_iii
CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Ref_Address_Types ( add...
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz...
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '010-26737' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_28003 ( "Episode #" real, "The W\u00f8rd" text, "Guest" text, "Introductory phrase" text, "Original airdate" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the production code of the episode wit...
SELECT "Production code" FROM table_28003 WHERE "Original airdate" = 'December 01'
wikisql
CREATE TABLE table_name_13 ( bronze INTEGER, nation VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of bronze for the United States with more than 1 silver?
SELECT MAX(bronze) FROM table_name_13 WHERE nation = "united states" AND silver > 1
sql_create_context
CREATE TABLE table_name_56 ( location VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location of the tournament held in Spain?
SELECT location FROM table_name_56 WHERE country = "spain"
sql_create_context
CREATE TABLE table_203_60 ( id number, "outcome" text, "no." number, "date" text, "championship" text, "surface" text, "opponent in the final" text, "score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which month were the...
SELECT "date" FROM table_203_60 GROUP BY "date" ORDER BY COUNT(*) DESC LIMIT 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 FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '20027341' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_54201 ( "Date" text, "Competition" text, "Venue" text, "Result" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What outcome has a score of 12-22?
SELECT "Result" FROM table_54201 WHERE "Score" = '12-22'
wikisql
CREATE TABLE table_60894 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when To par is '1', and when Player is 'Seve Ballesteros'?
SELECT "Country" FROM table_60894 WHERE "To par" = '1' AND "Player" = 'seve ballesteros'
wikisql
CREATE TABLE LANGUAGE ( name VARCHAR, language_id VARCHAR ) CREATE TABLE film ( language_id VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which language does the film AIRPORT POLLOCK use? List the language name.
SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK'
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Albumin"
mimicsql_data
CREATE TABLE table_61010 ( "2006" real, "2007" real, "2008" real, "2009" real, "2010" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many 2008s have 6.9 as a 2006, with a 2007 less than 7.1?
SELECT COUNT("2008") FROM table_61010 WHERE "2006" = '6.9' AND "2007" < '7.1'
wikisql
CREATE TABLE table_66115 ( "School" text, "Location" text, "Mascot" text, "# / County" text, "Enrollment" real, "IHSAA Class / Football/Soccer" text, "Year Joined" real, "Previous Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT "Mascot" FROM table_66115 WHERE "School" = 'logansport community'
wikisql
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREA...
SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM dataset, paper, paperdataset WHERE dataset.datasetname LIKE 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid
scholar
CREATE TABLE table_name_98 ( model_number VARCHAR, gpu_frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the model number for the GPU and 320 mhz?
SELECT model_number FROM table_name_98 WHERE gpu_frequency = "320 mhz"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025...
eicu
CREATE TABLE table_name_82 ( surface VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What surface was the match on November 6, 1982 played on?
SELECT surface FROM table_name_82 WHERE date = "november 6, 1982"
sql_create_context
CREATE TABLE table_name_66 ( date VARCHAR, race_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the I Dessau Autobahnspinne race?
SELECT date FROM table_name_66 WHERE race_name = "i dessau autobahnspinne"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC
nvbench
CREATE TABLE table_70752 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Points when equipe ligier gauloises blondes is the entrant?
SELECT AVG("Points") FROM table_70752 WHERE "Entrant" = 'equipe ligier gauloises blondes'
wikisql
CREATE TABLE table_46428 ( "Finished" real, "Time/ Behind" text, "Post" real, "Horse" text, "Jockey" text, "Trainer" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Jockey, when Post is 12?
SELECT "Jockey" FROM table_46428 WHERE "Post" = '12'
wikisql
CREATE TABLE table_17764 ( "Model Number" text, "Clock Speed" text, "L2" text, "L3" text, "FSB Speed" text, "Multiplier" text, "Cores" real, "Threads per core" real, "Voltage" text, "TDP (W)" text, "Socket" text, "Release Date" text, "Price ( USD )" text ) -- Using ...
SELECT "Clock Speed" FROM table_17764 WHERE "Price ( USD )" = '$910'
wikisql
CREATE TABLE table_name_97 ( pick INTEGER, round VARCHAR, position VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what round smaller than 10, was the center les studdard picked in?
SELECT MIN(pick) FROM table_name_97 WHERE position = "center" AND name = "les studdard" AND round < 10
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
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 = '028-47306')) AND DATETIME(medication.drugstarttime) <= DATETIME(CUR...
eicu
CREATE TABLE table_74494 ( "Pick #" real, "MLS team" text, "Player" text, "Position" text, "Affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team does Jimmy Frazelle play on?
SELECT "MLS team" FROM table_74494 WHERE "Player" = 'jimmy frazelle'
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0641182' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-01-18' AND '2003-06-12' AND t_kc21.SERVANT_FLG = '公务员'
css
CREATE TABLE table_203_750 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- number of different teams listed on the chart
SELECT COUNT(DISTINCT "opponent") FROM table_203_750
squall
CREATE TABLE table_name_96 ( nation VARCHAR, silver VARCHAR, total VARCHAR, gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nation has a Gold larger than 0, and a Bronze smaller than 2, and a Total larger than 3, and a S...
SELECT nation FROM table_name_96 WHERE gold > 0 AND bronze < 2 AND total > 3 AND silver > 1
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 ti...
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat...
mimic_iii
CREATE TABLE table_1342331_18 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What candidate is in Louisiana 6?
SELECT candidates FROM table_1342331_18 WHERE district = "Louisiana 6"
sql_create_context
CREATE TABLE table_34898 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the first elected date for the incumbent in the South Carolina 4 district?
SELECT "First elected" FROM table_34898 WHERE "District" = 'south carolina 4'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diag...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42829 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') ORDER BY labevents.ch...
mimic_iii
CREATE TABLE table_239 ( "Power Source" text, "Number of Generators" real, "Power Capacity (GW)" text, "% of total Capacity" text, "Capacity factor" text, "Annual Energy (billion kWh)" text, "% of annual production" text ) -- Using valid SQLite, answer the following questions for the table...
SELECT COUNT("Number of Generators") FROM table_239 WHERE "Power Capacity (GW)" = '78.7'
wikisql
CREATE TABLE table_10147 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what circuit was the iii Reims Grand Prix held?
SELECT "Circuit" FROM table_10147 WHERE "Race Name" = 'iii reims grand prix'
wikisql
CREATE TABLE table_name_61 ( partner VARCHAR, outcome VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which partners were runner-up in the tournament in Mons, Belgium?
SELECT partner FROM table_name_61 WHERE outcome = "runner-up" AND tournament = "mons, belgium"
sql_create_context
CREATE TABLE table_name_55 ( song VARCHAR, total_points VARCHAR, jury__points_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the song with more than 9 points and 44 (11) jury (points)?
SELECT song FROM table_name_55 WHERE total_points > 9 AND jury__points_ = "44 (11)"
sql_create_context
CREATE TABLE city ( Status VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different statuses do cities have?
SELECT COUNT(DISTINCT Status) FROM city
sql_create_context
CREATE TABLE table_name_97 ( time VARCHAR, rider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was valentino rossi's rider time?
SELECT time FROM table_name_97 WHERE rider = "valentino rossi"
sql_create_context
CREATE TABLE table_name_42 ( result VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result on week 6?
SELECT result FROM table_name_42 WHERE week = 6
sql_create_context
CREATE TABLE table_764 ( "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. -- When was the Tennessee 3 district incumbent first elected?
SELECT MAX("First elected") FROM table_764 WHERE "District" = 'Tennessee 3'
wikisql
CREATE TABLE table_20236726_2 ( serial_no VARCHAR, wd_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of serial number for 24 wd no
SELECT COUNT(serial_no) FROM table_20236726_2 WHERE wd_no = 24
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'atorvastatin calcium 20 mg po tabs' AND DATETIME(me...
eicu
CREATE TABLE table_1463383_1 ( social_democratic VARCHAR, socialist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If Socialist is at 46.1%, what are all percentages for social democratic?
SELECT social_democratic FROM table_1463383_1 WHERE socialist = "46.1%"
sql_create_context
CREATE TABLE table_204_567 ( id number, "team" text, "location" text, "stadium" text, "capacity" number, "manager" text, "captain" text, "kit manufacturer" text, "shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the stad...
SELECT "stadium" FROM table_204_567 WHERE "capacity" = 2500
squall
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId n...
SELECT TIME_TO_STR(CreationDate, '%d') AS "day", COUNT(Id) AS "count" FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##UserID:int##' AND TIME_TO_STR(CreationDate, '%Y') = '##Year:int##' AND TIME_TO_STR(CreationDate, '%M') = '##Month:int##' AND CommunityOwnedDate IS NULL GROUP BY TIME_TO_STR(CreationDate, '%d') ORDE...
sede
CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE college ( cname text, state text, enr number ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT cname, enr FROM college WHERE enr > 10000 AND state = "LA"
spider
CREATE TABLE table_62984 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Distance" text, "Time" text, "Purse" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the purse in 2003, which had a 1-1/16 distan...
SELECT "Purse" FROM table_62984 WHERE "Distance" = '1-1/16' AND "Year" = '2003'
wikisql
CREATE TABLE table_30308 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is listed under womens singles when year location is 1998 doha?
SELECT "Womens Singles" FROM table_30308 WHERE "Year Location" = '1998 Doha'
wikisql
CREATE TABLE table_18600760_19 ( township VARCHAR, latitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how is called the township where the latitude is 47.377790
SELECT township FROM table_18600760_19 WHERE latitude = "47.377790"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8562)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '.45% norm...
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.insurance = "Medicaid"
mimicsql_data
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 mzjzj...
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime tim...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32592)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label...
mimic_iii
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 from england were ranked in top 14 in the heats of 100m ...
SELECT COUNT("name") FROM table_204_71 WHERE "nationality" = 'england' AND "rank" <= 14
squall
CREATE TABLE procedures ( name VARCHAR, cost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the three most expensive procedures.
SELECT name FROM procedures ORDER BY cost LIMIT 3
sql_create_context
CREATE TABLE table_48963 ( "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 was the 1st leg score for the team with an Agg score of 151-134?
SELECT "1st leg" FROM table_48963 WHERE "Agg." = '151-134'
wikisql
CREATE TABLE table_66420 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location of the game with a score of 113-106?
SELECT "Location/Attendance" FROM table_66420 WHERE "Score" = '113-106'
wikisql
CREATE TABLE table_37290 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 7:30 has an 8:00 of movies & specials?
SELECT "7:30" FROM table_37290 WHERE "8:00" = 'movies & specials'
wikisql
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier ORDER BY Carrier DESC
nvbench
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT Openning_year, SUM(Capacity) FROM cinema GROUP BY Openning_year ORDER BY SUM(Capacity) DESC
nvbench
CREATE TABLE companies ( id number, name text, headquarters text, industry text, sales_billion number, profits_billion number, assets_billion number, market_value_billion text ) CREATE TABLE buildings ( id number, name text, city text, height number, stories number, ...
SELECT headquarters FROM companies GROUP BY headquarters HAVING COUNT(*) > 2
spider
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.number FROM course, program_course WHERE (course.number = 632 OR course.number = 532) AND course.department = 'EECS' AND program_course.course_id = course.course_id ORDER BY program_course.workload DESC LIMIT 1
advising
CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, ...
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id DESC
nvbench
CREATE TABLE table_2342078_6 ( original_airdate VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the airdate for the episode written by howard ostroff
SELECT original_airdate FROM table_2342078_6 WHERE written_by = "Howard Ostroff"
sql_create_context
CREATE TABLE table_4835 ( "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. -- How many people at Arden Street Oval?
SELECT COUNT("Crowd") FROM table_4835 WHERE "Venue" = 'arden street oval'
wikisql