instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 Founder, T1.Name ORDER BY T1.Name DESC
nvbench
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.icd9_code = "42741"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-43717')) AND treatment.treatmentname = 'enteral feeds - oral ...
eicu
CREATE TABLE table_name_53 ( date VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date had the Hornets as the home team?
SELECT date FROM table_name_53 WHERE home = "hornets"
sql_create_context
CREATE TABLE table_67877 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is on tv at 10:00 on the same channel that had Infoman on at 7:30?
SELECT "10:00" FROM table_67877 WHERE "7:30" = 'infoman'
wikisql
CREATE TABLE table_204_699 ( id number, "district" text, "name" text, "party" text, "residence" text, "first served" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the last term year represented in the chart ?
SELECT MAX("first served") FROM table_204_699
squall
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 SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '云昂雄' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-08-10' AND '2011-12-12'
css
CREATE TABLE table_name_66 ( m60a3_patton VARCHAR, m1a1_abrams VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the M60A3 that has an M1A1 of Km (mi)?
SELECT m60a3_patton FROM table_name_66 WHERE m1a1_abrams = "km (mi)"
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program ( program_id int, name varchar...
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i...
advising
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT AVG(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-34579')) AND NOT vitalperiodic.sao2 IS NULL AND STRFT...
eicu
CREATE TABLE table_name_29 ( week INTEGER, visiting_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When were the Houston Texans the visiting team later in the season?
SELECT MAX(week) FROM table_name_29 WHERE visiting_team = "houston texans"
sql_create_context
CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_percent real ) CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_...
SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day
nvbench
CREATE TABLE table_38412 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the player with 51 caps from a Club/province of clermont born?
SELECT "Date of Birth (Age)" FROM table_38412 WHERE "Caps" = '51' AND "Club/province" = 'clermont'
wikisql
CREATE TABLE table_dev_12 ( "id" int, "systolic_blood_pressure_sbp" int, "creatinine_clearance_cl" float, "allergy_to_glucagon" bool, "platelet_count" float, "diastolic_blood_pressure_dbp" int, "insulin_requirement" float, "adverse_reaction_to_glucagon" bool, "NOUSE" float ) -- Usi...
SELECT * FROM table_dev_12 WHERE adverse_reaction_to_glucagon = 1 OR allergy_to_glucagon = 1
criteria2sql
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For e...
SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( ...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fx mult ri...
mimic_iii
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Open and other replacement of aortic valve with tissue graft"
mimicsql_data
CREATE TABLE table_204_979 ( id number, "place" number, "nation" text, "5 hoops" text, "3 balls,\n2 ribbons" text, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what nation was the top scoring in the games ?
SELECT "nation" FROM table_204_979 ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE Orders ( order_details VARCHAR, order_id VARCHAR ) CREATE TABLE Invoices ( invoice_date VARCHAR, order_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show invoice dates and order id and details for all invoices.
SELECT T1.invoice_date, T1.order_id, T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybg...
css
CREATE TABLE table_name_64 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for record 3-3
SELECT date FROM table_name_64 WHERE record = "3-3"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '58997444' AND IN_HOSP_DATE BETWEEN '2005-07-14' AND '2014-03-13' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_204_353 ( id number, "no." number, "date/time" text, "aircraft" text, "foe" text, "result" text, "location" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what number is previous to 13 february 1918 @ 091...
SELECT "no." FROM table_204_353 WHERE id = (SELECT id FROM table_204_353 WHERE "date/time" = '13 february 1918 @ 0915 hours') - 1
squall
CREATE TABLE table_72563 ( "Rank" text, "Common of" text, "Population" real, "Area (km 2 )" text, "Density (inhabitants/km 2 )" text, "Altitude (mslm)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How may population figures are given for Setti...
SELECT COUNT("Population") FROM table_72563 WHERE "Common of" = 'Settimo Torinese'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT COUNT(*) FROM Badges
sede
CREATE TABLE table_name_8 ( year INTEGER, structure VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the Mercury City Tower?
SELECT MIN(year) FROM table_name_8 WHERE structure = "mercury city tower"
sql_create_context
CREATE TABLE mill ( architect_id int, id int, location text, name text, type text, built_year int, notes text ) CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE bridge ( architect_id int, id int, name text, location t...
SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.name DESC
nvbench
CREATE TABLE table_name_80 ( saturday VARCHAR, sunday VARCHAR, evening VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Saturday has a Sunday of yes and a Evening of yes?
SELECT saturday FROM table_name_80 WHERE sunday = "yes" AND evening = "yes"
sql_create_context
CREATE TABLE table_15830 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the lowest top-25 when the events is less than 17 and top-5 is more than 0?...
SELECT MIN("Top-25") FROM table_15830 WHERE "Events" < '17' AND "Top-5" > '0'
wikisql
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMP...
atis
CREATE TABLE table_59638 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year has a Competition of european indoor championships, and a Venue of budapest , hungary?
SELECT SUM("Year") FROM table_59638 WHERE "Competition" = 'european indoor championships' AND "Venue" = 'budapest , hungary'
wikisql
CREATE TABLE table_5511 ( "RBIs" real, "Player" text, "Team" text, "Date" text, "Opponent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date is associated with the player Wilbert Robinson?
SELECT "Date" FROM table_5511 WHERE "Player" = 'wilbert robinson'
wikisql
CREATE TABLE table_train_108 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "deficiency_to_iga" bool, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "NOUSE" float ) -- Using valid SQLite, answer t...
SELECT * FROM table_train_108 WHERE mini_mental_state_examination_mmse >= 12 AND mini_mental_state_examination_mmse <= 22
criteria2sql
CREATE TABLE table_54011 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2008 club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the name for 2008 club of vol ro z rich
SELECT "Name" FROM table_54011 WHERE "2008 club" = 'voléro zürich'
wikisql
CREATE TABLE table_name_45 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2011 total with a 2008 value greater than 346.5, a 2009 value of 392, and a 2010 value bigger than 354.6?
SELECT COUNT(2011) FROM table_name_45 WHERE 2008 > 346.5 AND 2009 = 392 AND 2010 > 354.6
sql_create_context
CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Sales ( sales_transaction_id INTEG...
SELECT investor_id, COUNT(*) FROM Transactions GROUP BY investor_id
nvbench
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '6085358' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 12
css
CREATE TABLE table_name_57 ( name VARCHAR, constituency_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is constituency number 16?
SELECT name FROM table_name_57 WHERE constituency_number = "16"
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, ...
SELECT jybgb.BBCJBW 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 jy...
css
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- A bar chart about what is a...
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age) DESC
nvbench
CREATE TABLE Agreements ( Document_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Locations ( Location_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Channel_ID INTEGER, Event_Type_Code CHAR(15), Finance_ID INTEGER, Location_ID...
SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*)
nvbench
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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.ZZYSGH = '83321772' AND mzjzjlb.JZKSRQ BETWEEN '2001-10-05' AND '2003-01-20'
css
CREATE TABLE table_26825349_1 ( original_air_date VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The episode that had 8.62 million US viewers originally aired on which date?
SELECT original_air_date FROM table_26825349_1 WHERE us_viewers__millions_ = "8.62"
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, Po...
SELECT Posts.Id AS "post_link", ViewCount, OwnerUserId, Reputation, (CAST(Reputation AS FLOAT) / CAST(ViewCount AS FLOAT)) AS Ratio FROM Posts, Users WHERE OwnerUserId = Users.Id AND ViewCount > 200000 AND CommunityOwnedDate IS NULL
sede
CREATE TABLE table_30428 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the highest number of stude...
SELECT MAX("Enrollment") FROM table_30428 WHERE "Founded" = '1923'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ...
css
CREATE TABLE table_75340 ( "Station" text, "Services" text, "Local authority" text, "Zone 2007" text, "Zone 2008" text, "Zone 2010" text, "Zone 2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Station has a Zone 2010 of 7?
SELECT "Station" FROM table_75340 WHERE "Zone 2010" = '7'
wikisql
CREATE TABLE table_name_48 ( diff INTEGER, drawn VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the difference for 9 draws and over 18 played?
SELECT SUM(diff) FROM table_name_48 WHERE drawn = 9 AND played > 18
sql_create_context
CREATE TABLE table_dev_41 ( "id" int, "gender" string, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "serum_bicarbonate" int, "renal_disease" bool, "temperature" float, "diastolic_blood_pressure_dbp" int, "liver_disease" bool, "hdl" int, "serum_sodium_concentrat...
SELECT * FROM table_dev_41 WHERE uncontrolled_blood_pressure = 1 OR (systolic_blood_pressure_sbp > 140 OR diastolic_blood_pressure_dbp > 80) OR renal_disease = 1 OR ((serum_creatinine > 1.5 AND gender = 'male') OR (serum_creatinine > 1.4 AND gender = 'female'))
criteria2sql
CREATE TABLE table_name_83 ( entrant VARCHAR, points VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which entrant had fewer than 33 points in 1999?
SELECT entrant FROM table_name_83 WHERE points < 33 AND year = 1999
sql_create_context
CREATE TABLE table_name_19 ( team VARCHAR, players VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Players of amanda coetzer and marcos ondruska is what team?
SELECT team FROM table_name_19 WHERE players = "amanda coetzer and marcos ondruska"
sql_create_context
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE table_23512864_4 ( election_year INTEGER, speaker VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the speaker is Munu Adhi (2) K. Rajaram, what is the election year maximum?
SELECT MAX(election_year) FROM table_23512864_4 WHERE speaker = "Munu Adhi (2) K. Rajaram"
sql_create_context
CREATE TABLE table_12554 ( "Club" text, "City" text, "Arena" text, "Capacity" real, "Last Year" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city is Kara Ali Acar Sport Hall located in?
SELECT "City" FROM table_12554 WHERE "Arena" = 'kara ali acar sport hall'
wikisql
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
SELECT reactormodel FROM nuclear_power_plants GROUP BY reactormodel ORDER BY COUNT(*) DESC LIMIT 1
geonucleardata
CREATE TABLE table_name_35 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 1994 has a 1998 of 0 1?
SELECT 1994 FROM table_name_35 WHERE 1998 = "0–1"
sql_create_context
CREATE TABLE table_62439 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tournament, when 2012 is 'A', when 2011 is 'A', and when 2008 is 'A'?
SELECT "Tournament" FROM table_62439 WHERE "2012" = 'a' AND "2011" = 'a' AND "2008" = 'a'
wikisql
CREATE TABLE table_name_21 ( location VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location of record 5-3
SELECT location FROM table_name_21 WHERE record = "5-3"
sql_create_context
CREATE TABLE table_64417 ( "Match" real, "Date" text, "Competition or tour" text, "Ground" text, "Opponent" text, "Score1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the match that happened in Bishop's Stortford?
SELECT "Match" FROM table_64417 WHERE "Opponent" = 'bishop''s stortford'
wikisql
CREATE TABLE table_203_314 ( 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. -- how many nations received at least 3 medals total ?
SELECT COUNT("nation") FROM table_203_314 WHERE "total" >= 3
squall
CREATE TABLE table_26375386_20 ( rank VARCHAR, vote_percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times is the voting percentage 10.7%
SELECT COUNT(rank) FROM table_26375386_20 WHERE vote_percentage = "10.7%"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_1620397_2 ( author VARCHAR, series_sorted VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the author for 6y/ae
SELECT author FROM table_1620397_2 WHERE series_sorted = "6Y/AE"
sql_create_context
CREATE TABLE table_name_91 ( result VARCHAR, group VARCHAR, film_series VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for Thirst in 2010 at the Green Globe Film Awards?
SELECT result FROM table_name_91 WHERE film_series = "thirst" AND year = 2010 AND group = "green globe film awards"
sql_create_context
CREATE TABLE table_79727 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponent has a loss of McCaskill (9-11)?
SELECT "Opponent" FROM table_79727 WHERE "Loss" = 'mccaskill (9-11)'
wikisql
CREATE TABLE table_name_51 ( result VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the result in week 10?
SELECT result FROM table_name_51 WHERE week = 10
sql_create_context
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '59512324' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 9835.59) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '59512324' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI...
css
CREATE TABLE assignedto ( scientist number, project text ) CREATE TABLE scientists ( ssn number, name text ) CREATE TABLE projects ( code text, name text, hours number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Select the project names whic...
SELECT name FROM projects WHERE NOT code IN (SELECT project FROM assignedto)
spider
CREATE TABLE table_71324 ( "Club" text, "League" text, "Sport" text, "Venue" text, "Established" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Venue has Spartak St. Petersburg Club?
SELECT "Venue" FROM table_71324 WHERE "Club" = 'spartak st. petersburg'
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_Road, School_ID FROM basketball_match ORDER BY School_ID
nvbench
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 WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2060"
mimicsql_data
CREATE TABLE table_name_41 ( result VARCHAR, goal VARCHAR, venue VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for the 1966 fifa world cup qualification in mexico city, mexico and a goal over 8?
SELECT result FROM table_name_41 WHERE venue = "mexico city, mexico" AND competition = "1966 fifa world cup qualification" AND goal > 8
sql_create_context
CREATE TABLE table_1342370_39 ( first_elected VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was william francis stevenson first elected?
SELECT first_elected FROM table_1342370_39 WHERE incumbent = "William Francis Stevenson"
sql_create_context
CREATE TABLE table_name_64 ( title VARCHAR, left_office VARCHAR, entered_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the king who left office in 982 and entered office in 949?
SELECT title FROM table_name_64 WHERE left_office = "982" AND entered_office = "949"
sql_create_context
CREATE TABLE table_15187735_18 ( segment_d VARCHAR, segment_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the segment d for s cufflink
SELECT segment_d FROM table_15187735_18 WHERE segment_a = "s Cufflink"
sql_create_context
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255...
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_48943 ( "Rank" real, "Name" text, "Nation" text, "Points" real, "Placings" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name of the Players with a Rank of 18?
SELECT "Name" FROM table_48943 WHERE "Rank" = '18'
wikisql
CREATE TABLE table_33753 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the game where is was later than Week 4 of the season and the opponent was the New York...
SELECT "Date" FROM table_33753 WHERE "Week" > '4' AND "Opponent" = 'new york giants'
wikisql
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name ORDER BY COUNT(*)
nvbench
CREATE TABLE table_204_520 ( id number, "outcome" text, "no." number, "date" number, "championship" text, "surface" text, "opponent" text, "score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what opponent was competed against the most...
SELECT "opponent" FROM table_204_520 GROUP BY "opponent" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH ...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '87197835' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2013-01-25')
css
CREATE TABLE table_79999 ( "Name" text, "GP-GS" text, "Effic" real, "Att-Cmp-Int" text, "Avg/G" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Avg/G smaller than 225.5, and a GP-GS of 8 0 has what name?
SELECT "Name" FROM table_79999 WHERE "Avg/G" < '225.5' AND "GP-GS" = '8–0'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_i...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78131 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
mimic_iii
CREATE TABLE table_name_29 ( high_rebounds VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which High rebounds have High points of chris bosh (34)?
SELECT high_rebounds FROM table_name_29 WHERE high_points = "chris bosh (34)"
sql_create_context
CREATE TABLE table_73880 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are all winning drivers if winning team ...
SELECT "Winning driver" FROM table_73880 WHERE "Winning team" = 'Carlin Motorsport' AND "Circuit" = 'Croft'
wikisql
CREATE TABLE table_train_44 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "corticosteroid_therapy" bool, "immune_suppression" bool, "hepatic_disease" bool, "septic_shock" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for...
SELECT * FROM table_train_44 WHERE pregnancy_or_lactation = 1
criteria2sql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '027-154299' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '027-154299' AND patient.hospitaldischargetime IS NULL)) AND ...
eicu
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT q.Id AS "post_link", q.Tags FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##UserId##' AND (q.Title LIKE '%anyone%' OR q.Title LIKE '%difficult%' OR q.Title LIKE '%doubt%' OR q.Title LIKE '%easy%' OR q.Title LIKE '%exercise%' OR q.Title LIKE '%hard%' OR q.Title LIKE '%help%' OR...
sede
CREATE TABLE table_204_806 ( id number, "name" text, "date" text, "condition" text, "ownership\n/ access" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the only one built as a hunting lodge ?
SELECT "name" FROM table_204_806 WHERE "notes" = 'built as hunting lodge'
squall
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT wdmzjzjlb.MZBMLX, wdmzjzjlb.MZZDBM, wdmzjzjlb.MZZDMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '15486646572' UNION SELECT bdmzjzjlb.MZBMLX, bdmzjzjlb.MZZDBM, bdmzjzjlb.MZZDMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '15486646572'
css
CREATE TABLE club_rank ( Gold INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of gold medals for clubs?
SELECT AVG(Gold) FROM club_rank
sql_create_context
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 WHERE demographic.discharge_location = "SNF" AND demographic.admityear < "2133"
mimicsql_data
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
SELECT COUNT(*) FROM Posts WHERE Score > 5
sede
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
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 OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '范馨逸' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 6053.87)
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pleural effusion' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') ...
eicu
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 SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '83001466' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2005-05-20' AND '2014-06-18' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fg...
css
CREATE TABLE table_name_95 ( points INTEGER, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least amount of points when there is 1 win?
SELECT MIN(points) FROM table_name_95 WHERE wins = 1
sql_create_context
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.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '75327735' AND gwyjzb.MED_SER_ORG_NO = '3248711' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-02-24' AND '2012-09-26' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb...
css
CREATE TABLE table_14168 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Release price ( USD )" tex...
SELECT "Cores" FROM table_14168 WHERE "L3 cache" = '8 mb' AND "Frequency" = '2.5 ghz'
wikisql