instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_62549 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest money when the score was 69-68-67-69=273?
SELECT MAX("Money ( $ )") FROM table_62549 WHERE "Score" = '69-68-67-69=273'
wikisql
CREATE TABLE table_name_53 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the opponents during week 14?
SELECT opponent FROM table_name_53 WHERE week = 14
sql_create_context
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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABL...
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bands') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURR...
mimic_iii
CREATE TABLE table_name_64 ( entrant VARCHAR, points VARCHAR, year VARCHAR, engine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- After 1961, who as the Entrant when the engine was a Ferrari v8, and when the points were lower than 23?
SELECT entrant FROM table_name_64 WHERE year > 1961 AND engine = "ferrari v8" AND points < 23
sql_create_context
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 Nationality, SUM(Age) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE table_43430 ( "Year" text, "Award" text, "Production" text, "Role" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which award was given for the role of Elphaba in 2009?
SELECT "Award" FROM table_43430 WHERE "Role" = 'elphaba' AND "Year" = '2009'
wikisql
CREATE TABLE table_1342198_36 ( result VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result when incumbent Tom Steed was elected?
SELECT result FROM table_1342198_36 WHERE incumbent = "Tom Steed"
sql_create_context
CREATE TABLE table_5255 ( "Name" text, "Nationality" text, "Position" text, "Tenure Began" real, "Term Ending" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Term Ending smaller than 2018, and a Nationality of new zealand what is the name?
SELECT "Name" FROM table_5255 WHERE "Term Ending" < '2018' AND "Nationality" = 'new zealand'
wikisql
CREATE TABLE table_15187735_11 ( segment_c VARCHAR, series_ep VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of series episode 11-02's segment c?
SELECT segment_c FROM table_15187735_11 WHERE series_ep = "11-02"
sql_create_context
CREATE TABLE table_name_16 ( high_rebounds VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the High rebounds that has the Date of november 5?
SELECT high_rebounds FROM table_name_16 WHERE date = "november 5"
sql_create_context
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area...
SELECT Appelation, COUNT(Appelation) FROM wine WHERE Score > 93 GROUP BY Appelation ORDER BY Name
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "29" AND demographic.admityear >= "2107"
mimicsql_data
CREATE TABLE table_8542 ( "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. -- Which Surface has a Week of march 1?
SELECT "Surface" FROM table_8542 WHERE "Week" = 'march 1'
wikisql
CREATE TABLE CHARACTERISTICS ( characteristic_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of all the product characteristics.
SELECT DISTINCT characteristic_name FROM CHARACTERISTICS
sql_create_context
CREATE TABLE table_204_207 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- on what date did the bears win by a difference of 27 points ?
SELECT "date" FROM table_204_207 WHERE "result" = 'w' AND "result" - "result" = 27
squall
CREATE TABLE table_14219514_1 ( home__1st_leg_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was in 2nd leg when Boca Juniors was in home (1st leg)?
SELECT 2 AS nd_leg FROM table_14219514_1 WHERE home__1st_leg_ = "Boca Juniors"
sql_create_context
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, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '王向卉' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2021-05-03')
css
CREATE TABLE table_19722233_5 ( blocks VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times did debbie black block
SELECT blocks FROM table_19722233_5 WHERE player = "Debbie Black"
sql_create_context
CREATE TABLE table_name_83 ( decision VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the decision goal when the record was 7-7-2?
SELECT decision FROM table_name_83 WHERE record = "7-7-2"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( ro...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE driver ( name VARCHAR, home_city VARCHAR, age VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the name, home city, and age for all drivers.
SELECT name, home_city, age FROM driver
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Bilirubin, Direct"
mimicsql_data
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Percutaneous [endoscopic] gastrostomy [PEG]"
mimicsql_data
CREATE TABLE table_name_70 ( rd_1 INTEGER, province VARCHAR, rd_4 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is the highest Rd 1 has a Province of utrecht and a Rd 4 larger than 0?
SELECT MAX(rd_1) FROM table_name_70 WHERE province = "utrecht" AND rd_4 > 0
sql_create_context
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how old is the youngest per...
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job
nvbench
CREATE TABLE table_204_123 ( id number, "week" number, "date" text, "kickoff" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "game site" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "results\nteam record" FROM table_204_123 ORDER BY "week" DESC LIMIT 1
squall
CREATE TABLE table_name_23 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number in attendance on September 16?
SELECT AVG(attendance) FROM table_name_23 WHERE date = "september 16"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%CLARCH%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_23937219_3 ( original_air_date VARCHAR, prod_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many original air dates were there for the episode with production code 212?
SELECT COUNT(original_air_date) FROM table_23937219_3 WHERE prod_code = 212
sql_create_context
CREATE TABLE table_name_39 ( capacity VARCHAR, acceleration_0_100km_h VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the capacity when the acceleration 1-100km/h is 11.1 s?
SELECT capacity FROM table_name_39 WHERE acceleration_0_100km_h = "11.1 s"
sql_create_context
CREATE TABLE table_name_4 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the To par of payne stewart?
SELECT to_par FROM table_name_4 WHERE player = "payne stewart"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.days_stay = "20"
mimicsql_data
CREATE TABLE table_203_83 ( id number, "ranking" number, "company" text, "industry" text, "revenue (usd billions)" text, "fy" text, "capitalization (usd billions)" text, "employees" number, "listing" text, "headquarters" text, "ceo" text ) -- Using valid SQLite, answer the ...
SELECT "employees" FROM table_203_83 WHERE "company" = 'vitol'
squall
CREATE TABLE table_70516 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was E.J. 'Dutch' Harrison's lowest To Par?
SELECT MIN("To par") FROM table_70516 WHERE "Player" = 'e.j. "dutch" harrison'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Transplant cadaver donor"
mimicsql_data
CREATE TABLE table_20448 ( "Information" text, "Akimel A-al The name is Tohono Oodham for children of the river" text, "Altade\u00f1a" text, "Aprende" text, "Centennial" text, "Kyrene MS" text, "del Pueblo" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Centennial" FROM table_20448 WHERE "Information" = 'Location'
wikisql
CREATE TABLE financial_transactions ( transaction_id number, account_id number, invoice_number number, transaction_type text, transaction_date time, transaction_amount number, transaction_comment text, other_transaction_details text ) CREATE TABLE invoices ( invoice_number number, ...
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
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_44912 ( "Team" text, "Manager" text, "Home city" text, "Stadium" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the home city for the stadion src mladost?
SELECT "Home city" FROM table_44912 WHERE "Stadium" = 'stadion src mladost'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id ...
WITH CandidatePosts AS (SELECT ParentId AS postId FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 AND p.Score > 0) SELECT p1.Id AS "post_link", p1.OwnerUserId AS "user_link", Body FROM Posts AS p1 JOIN CandidatePosts AS cp ON cp.postId = p1.ParentId WHERE p1.OwnerUserId != '##UserId##' ORDER BY ...
sede
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varcha...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BALTIMORE' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_20094 ( "Name" text, "Position" text, "Number" real, "School/Club Team" text, "Season" text, "Acquisition via" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players are listed for the school/club team Washington?
SELECT COUNT("Name") FROM table_20094 WHERE "School/Club Team" = 'Washington'
wikisql
CREATE TABLE table_name_97 ( chipset VARCHAR, graphics VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of chipset is in the Precision t3400 model with the PCI Express graphics?
SELECT chipset FROM table_name_97 WHERE graphics = "pci express" AND model = "precision t3400"
sql_create_context
CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, a...
SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100
spider
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Clai...
SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa'
nvbench
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '95082544208' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '95082544208'
css
CREATE TABLE table_name_99 ( total INTEGER, horse VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the highest total when the horse is spender s
SELECT MAX(total) FROM table_name_99 WHERE horse = "spender s"
sql_create_context
CREATE TABLE table_19608 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production Code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the air date ...
SELECT "Original air date" FROM table_19608 WHERE "Title" = 'There Goes the Bride'
wikisql
CREATE TABLE mzb ( 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_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5387444' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_NM HAVING AVG(qtb.PERSON_AGE) > 24 UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5387444' GR...
css
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, applica...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND...
atis
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE t...
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC
nvbench
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '53607326' AND jyjgzbb.jybgb_BBCJBW = '踝部' UNION SELECT * FR...
css
CREATE TABLE table_44077 ( "Season" text, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the wins w...
SELECT "Wins" FROM table_44077 WHERE "F/Laps" = 'test driver' AND "Team" = 'lotus racing'
wikisql
CREATE TABLE table_21474 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What w...
SELECT "Record" FROM table_21474 WHERE "High points" = 'Dirk Nowitzki (19)'
wikisql
CREATE TABLE table_17290 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Record" FROM table_17290 WHERE "High assists" = 'Pierce (6)'
wikisql
CREATE TABLE table_45211 ( "English" text, "Pali" text, "Sanskrit" text, "Chinese" text, "Tibetan" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Chinese has a Pali of atappa?
SELECT "Chinese" FROM table_45211 WHERE "Pali" = 'atappa'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucose - d5ns' AND DATETIME(treatment.treat...
eicu
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'aneurysm resection / repair' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.long_title = "Suicide and self-inflicted injury by hanging"
mimicsql_data
CREATE TABLE table_11770 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of losses for the Team of Montrea...
SELECT COUNT("Losses") FROM table_11770 WHERE "Goals For" > '29' AND "Team" = 'montreal'
wikisql
CREATE TABLE table_55835 ( "Amino Acid" text, "3-Letter" text, "1-Letter" text, "Side-chain polarity" text, "Side-chain charge (pH 7.4)" text, "Hydropathy index" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the side-chain polarity for ...
SELECT "Side-chain polarity" FROM table_55835 WHERE "1-Letter" = 'v'
wikisql
CREATE TABLE table_name_93 ( cuts_made INTEGER, top_10 VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of cuts made in events with fewer than 1 win and exactly 11 top-10s?
SELECT AVG(cuts_made) FROM table_name_93 WHERE top_10 = 11 AND wins < 1
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2049"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND procedures.icd9_code = "5361"
mimicsql_data
CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE stock ( shop_id number, device_id number, quantity number ) CREATE TABLE shop ( shop_id number, shop_name text, location tex...
SELECT open_date, open_year FROM shop WHERE shop_name = "Apple"
spider
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 prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Digoxin"
mimicsql_data
CREATE TABLE domain_publication ( did int, pid int ) CREATE TABLE domain_conference ( cid int, did int ) CREATE TABLE publication_keyword ( kid int, pid int ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE author ( aid int, homepage varchar, name varchar, ...
SELECT publication.title FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.citation_num > 200 AND publication.year > 2000
academic
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, ...
SELECT DISTINCT course.department, course.name, course.number, semester.semester, semester.year, student_record.grade FROM course, semester, student_record WHERE student_record.course_id = course.course_id AND student_record.semester = semester.semester_id AND student_record.student_id = 1
advising
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Users ( Id number, Reputation number,...
SELECT Id AS "post_link", AnswerCount FROM Posts WHERE PostTypeId = 1 AND Tags = CONCAT('<', '##Tag:string##', '>') AND ClosedDate IS NULL ORDER BY CreationDate DESC
sede
CREATE TABLE happy_hour ( HH_ID int, Shop_ID int, Month text, Num_of_shaff_in_charge int ) CREATE TABLE member ( Member_ID int, Name text, Membership_card text, Age int, Time_of_purchase int, Level_of_membership int, Address text ) CREATE TABLE shop ( Shop_ID int, A...
SELECT Time_of_purchase, Age FROM member
nvbench
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TA...
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 ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BURBANK' AND date_day.day_number = 22 AND date_day.month_number = 5 AND ...
atis
CREATE TABLE table_name_63 ( shirt_no INTEGER, birth_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shirt No has a Birth Date of April 12, 1986 (age27)?
SELECT MIN(shirt_no) FROM table_name_63 WHERE birth_date = "april 12, 1986 (age27)"
sql_create_context
CREATE TABLE table_34592 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest lost when position is larg...
SELECT MIN("Lost") FROM table_34592 WHERE "Position" > '6' AND "Drawn" = '7' AND "Points" < '15'
wikisql
CREATE TABLE table_name_45 ( grid VARCHAR, team VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the grid for Bruno Junqueira for Dale Coyne Racing?
SELECT grid FROM table_name_45 WHERE team = "dale coyne racing" AND driver = "bruno junqueira"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = "Urine"
mimicsql_data
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "HYPERGLYCEMIA"
mimicsql_data
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 microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient...
eicu
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.days_stay > "9"
mimicsql_data
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE CloseAsO...
SELECT Id, Body, Tags FROM Posts WHERE CreationDate LIKE '%2018%' LIMIT 1000
sede
CREATE TABLE table_65006 ( "Municipality" text, "FIPS code" real, "Founded" real, "Population (2010)" real, "Area" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year was Yauco, which had over 42,043 people in 2010, founded?
SELECT AVG("Founded") FROM table_65006 WHERE "Municipality" = 'yauco' AND "Population (2010)" > '42,043'
wikisql
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(1...
SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number...
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient...
eicu
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND prescriptions.route = "INHALATION"
mimicsql_data
CREATE TABLE table_name_50 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team with scarborough as the away team?
SELECT home_team FROM table_name_50 WHERE away_team = "scarborough"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_76895 ( "Mode" text, "D\u00e9part de la main gauche" text, "Accord du 1st string" text, "2nd string" text, "3rd string" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the 2nd string of Do and an Accord du 1st string of FA what...
SELECT "D\u00e9part de la main gauche" FROM table_76895 WHERE "2nd string" = 'do' AND "Accord du 1st string" = 'fa'
wikisql
CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE prereq ( ...
SELECT T1.dept_name, COUNT(DISTINCT T2.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T2.ID) DESC
nvbench
CREATE TABLE table_204_113 ( id number, "rank" number, "area" text, "state/\nprovince" text, "csa/cma\n2009 population" number, "projected\n2025 population" number, "projected increase\n2009-2025" number ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'toronto') > (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'hamilton')
squall
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2108"
mimicsql_data
CREATE TABLE table_54761 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the draw number that has 59 points?
SELECT AVG("Draw") FROM table_54761 WHERE "Points" = '59'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '01456680839'
css
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 MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"
mimicsql_data
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-30850') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) = '2105-06' ORDER BY patient.unitadmittime DESC LIMIT ...
eicu
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 Team_Name, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_...
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 = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_tim...
atis
CREATE TABLE table_38483 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" real, "Best" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had a Qualifying 2 time over 58.669 for Team Australia?
SELECT "Name" FROM table_38483 WHERE "Qual 2" > '58.669' AND "Team" = 'team australia'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text,...
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 = 'WESTCHESTER COUNTY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_nam...
atis
CREATE TABLE vocals ( songid VARCHAR ) CREATE TABLE songs ( songid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many songs have a shared vocal?
SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = "shared"
sql_create_context
CREATE TABLE table_74485 ( "Year" real, "Azerbaijan" real, "Armenia" real, "Belarus" real, "Georgia" real, "Kazakhstan" real, "Kyrghizstan" real, "Latvia" real, "Lithuania" real, "Moldova" real, "Russia" real, "Tajikistan" real, "Turkmenikstan" real, "Uzbekistan" ...
SELECT MIN("Kazakhstan") FROM table_74485 WHERE "Kyrghizstan" = '4.62' AND "Belarus" < '2.46'
wikisql