instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_36 ( original_title VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Original Title of the movie directed by Aigars Grauba?
SELECT original_title FROM table_name_36 WHERE director = "aigars grauba"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT procedures.long_title FROM procedures WHERE procedures.subject_id = "29541"
mimicsql_data
CREATE TABLE table_48438 ( "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 "High rebounds" FROM table_48438 WHERE "Game" > '33' AND "Score" = 'w 132-101'
wikisql
CREATE TABLE table_6465 ( "English name" text, "Bulgarian name" text, "Bulgarian name ( Transliteration )" text, "Old Bulgarian Names" text, "Old Bulgarian name (Transliteration)" text, "Old Bulgarian name - Meaning" text ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT "Old Bulgarian name - Meaning" FROM table_6465 WHERE "Old Bulgarian Names" = 'тръвен'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '7227046' AND wdmzjzjlb.JZKSRQ BETWEEN '2008-05-20' AND '2021-03-15' AND wdmzjzjlb.ZZBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '7227046' AND bdmzjzjlb.JZKSRQ BETWEEN '2008-05-20' AND '2021-03-15' AND bdmzjzjlb.ZZBZ > 0
css
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
SELECT Country, AVG(Age) FROM artist GROUP BY Country ORDER BY AVG(Age)
nvbench
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 FLX_MED_ORG_ID FROM t_kc21 WHERE MED_CLINIC_ID = '26289441351'
css
CREATE TABLE table_67968 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MIN("Losses") FROM table_67968 WHERE "Goals against" > '59' AND "Position" > '17'
wikisql
CREATE TABLE table_name_63 ( black__both_hispanic_and_non_hispanic_ VARCHAR, municipality__2010_ VARCHAR, amerindian__both_hispanic_and_non_hispanic_ VARCHAR, white__both_hispanic_and_non_hispanic_ VARCHAR, n_asia__both_hispanic_and_non_hispanic_ VARCHAR ) -- Using valid SQLite, answer the followi...
SELECT black__both_hispanic_and_non_hispanic_ FROM table_name_63 WHERE white__both_hispanic_and_non_hispanic_ < 80.6 AND n_asia__both_hispanic_and_non_hispanic_ = 0.1 AND amerindian__both_hispanic_and_non_hispanic_ < 0.6000000000000001 AND municipality__2010_ = "vega baja"
sql_create_context
CREATE TABLE table_26439 ( "No. by series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production number" real, "U.S. viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many di...
SELECT COUNT("Written by") FROM table_26439 WHERE "No. by series" = '8'
wikisql
CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_phone_number text ...
SELECT phone_number, email_address FROM customers WHERE amount_outstanding > 2000
spider
CREATE TABLE table_74891 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Bronze with the Year of 1998?
SELECT "Bronze" FROM table_74891 WHERE "Year" = '1998'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2187" AND prescriptions.route = "TP"
mimicsql_data
CREATE TABLE table_58347 ( "Date and time ( UTC )" text, "Rocket" text, "Site" text, "Orbit" text, "Function" text, "Decay ( UTC )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What site has an orbit of Leo, a decay (UTC) of still in orbit, an...
SELECT "Site" FROM table_58347 WHERE "Orbit" = 'leo' AND "Decay ( UTC )" = 'still in orbit' AND "Function" = 'magnetosphere research'
wikisql
CREATE TABLE table_23632 ( "Candidate" text, "Office" text, "Home state" text, "Popular vote" real, "States \u2013 first place" real, "States \u2013 second place" real, "States \u2013 third place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT COUNT("States \u2013 first place") FROM table_23632 WHERE "Office" = 'Governor'
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 (SELECT COUNT(*) 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.person_info_XM = '韦嘉泽' AND mzjzjlb.JZKSRQ BETWEEN '2003-03-16' AND '2012-01-12') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AN...
css
CREATE TABLE table_name_32 ( club VARCHAR, number_of_seasons_in_liga_mx VARCHAR, number_of_seasons_in_top_division VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club has fewer than 40 seasons in Liga MX and 65 seasons in the top division?
SELECT club FROM table_name_32 WHERE number_of_seasons_in_liga_mx < 40 AND number_of_seasons_in_top_division = 65
sql_create_context
CREATE TABLE table_20294 ( "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_20294 WHERE "Team" = 'Boston'
wikisql
CREATE TABLE table_40331 ( "Eliminated" text, "Wrestler" text, "Entered" real, "Eliminated by" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number eliminated for the person with a time of 12:38?
SELECT "Eliminated by" FROM table_40331 WHERE "Time" = '12:38'
wikisql
CREATE TABLE table_51763 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the location of a team with a 3-2 record?
SELECT "Location" FROM table_51763 WHERE "Record" = '3-2'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Encephalopathy NOS"
mimicsql_data
CREATE TABLE table_name_31 ( method VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the method of resolution for the fight against akihiro gono?
SELECT method FROM table_name_31 WHERE opponent = "akihiro gono"
sql_create_context
CREATE TABLE table_51648 ( "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the number of gold for albania with a silver of 1 and total less than 1
SELECT COUNT("Gold") FROM table_51648 WHERE "Silver" = '1' AND "Nation" = 'albania' AND "Total" < '1'
wikisql
CREATE TABLE table_1333 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the order number for the theme of Mariah Carey?
SELECT "Order #" FROM table_1333 WHERE "Theme" = 'Mariah Carey'
wikisql
CREATE TABLE table_203_761 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the difference betwe...
SELECT ABS((SELECT "laps" FROM table_203_761 WHERE "driver" = 'alex figge') - (SELECT "laps" FROM table_203_761 WHERE "driver" = 'will power'))
squall
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL)) AND transfers....
mimic_iii
CREATE TABLE table_name_69 ( year INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the earliest year the venue is in gothenburg, sweden?
SELECT MIN(year) FROM table_name_69 WHERE venue = "gothenburg, sweden"
sql_create_context
CREATE TABLE table_name_6 ( date VARCHAR, winning_driver VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did Aymo Maggi win the Rome Grand Prix ?
SELECT date FROM table_name_6 WHERE winning_driver = "aymo maggi" AND name = "rome grand prix"
sql_create_context
CREATE TABLE table_67763 ( "Year" real, "Pick" text, "Player name" text, "College" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years have a Player name of ronnie bull?
SELECT SUM("Year") FROM table_67763 WHERE "Player name" = 'ronnie bull'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,...
SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_29717 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Table" text, "Incoming manager" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the outg...
SELECT "Outgoing manager" FROM table_29717 WHERE "Date of vacancy" = '10 October 2010'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "58" AND procedures.long_title = "Hemodialysis"
mimicsql_data
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
SELECT UserId AS "user_link", SUM(Score) AS "total_score", COUNT(*) AS "#comments" FROM Comments WHERE UserId IN ('##UserID##') GROUP BY UserId ORDER BY SUM(Score) DESC
sede
CREATE TABLE table_name_57 ( score VARCHAR, away VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the match with deportes savio as the away team?
SELECT score FROM table_name_57 WHERE away = "deportes savio"
sql_create_context
CREATE TABLE table_34783 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome for the match at the leipzig tournament with a score w/o?
SELECT "Outcome" FROM table_34783 WHERE "Tournament" = 'leipzig' AND "Score" = 'w/o'
wikisql
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 PostsWithDeleted ( Id number, PostTyp...
SELECT Posts.Id, Posts.Score, Posts.ParentId FROM Posts JOIN Comments ON Posts.Id = Comments.PostId
sede
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair ( repair_I...
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*)
nvbench
CREATE TABLE table_78157 ( "Year" text, "Competition" text, "Date" text, "Location" text, "Score" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the date for the game in prague for the world group, consolation round compet...
SELECT "Date" FROM table_78157 WHERE "Location" = 'prague' AND "Competition" = 'world group, consolation round'
wikisql
CREATE TABLE table_60537 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue number(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Label has a Country of canada, and a Format of cd/digital download?
SELECT "Label" FROM table_60537 WHERE "Country" = 'canada' AND "Format" = 'cd/digital download'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254182')) AND medication.drugname = 'thiamine 100 mg tab' ...
eicu
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE (LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IND') AND LENGTH(Location) > 1 LIMIT 100
sede
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
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 COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7826174' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-12-24' AND '2014-02-10' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_8169 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Date" text, "Crowd" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the Colonial Stadium?
SELECT "Date" FROM table_8169 WHERE "Ground" = 'colonial stadium'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
SELECT vitalperiodic.systemicdiastolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416') AND NOT patient.unitdischargetime IS ...
eicu
CREATE TABLE table_5696 ( "Model" text, "Engine" text, "Displacement" text, "Power" text, "Torque" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the displacement having a torque of n m (lb ft) @ 3000 rpm?
SELECT "Displacement" FROM table_5696 WHERE "Torque" = 'n·m (lb·ft) @ 3000 rpm'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.diagnosis = "COLANGITIS"
mimicsql_data
CREATE TABLE table_name_31 ( weight VARCHAR, club VARCHAR, date_of_birth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Weight of the person born 1981-02-24 from the Uralochka Zlatoust club ?
SELECT weight FROM table_name_31 WHERE club = "uralochka zlatoust" AND date_of_birth = "1981-02-24"
sql_create_context
CREATE TABLE table_name_5 ( appearances VARCHAR, goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the amount of apperances of the person who had 36 goals?
SELECT appearances FROM table_name_5 WHERE goals = 36
sql_create_context
CREATE TABLE table_name_21 ( level VARCHAR, position VARCHAR, season VARCHAR, division VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What level for seasons after 2003, a Division of kakkonen (second division), and a Position of 12th?
SELECT level FROM table_name_21 WHERE season > 2003 AND division = "kakkonen (second division)" AND position = "12th"
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 Price, Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '王傲冬' AND t_kc22.STA_DATE BETWEEN '2004-09-08' AND '2020-02-21' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.icd9_code = "4432"
mimicsql_data
CREATE TABLE table_78484 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the time/retired for constructor source:?
SELECT "Time/Retired" FROM table_78484 WHERE "Constructor" = 'source:'
wikisql
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date ORDER BY date
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "8847"
mimicsql_data
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistoryTypes ( Id number, ...
SELECT Id, CAST(DisplayName AS TEXT(150)) COLLATE Latin1_General_BIN FROM Users WHERE NOT LOWER(SUBSTRING(DisplayName, 1, 1)) IN ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0')
sede
CREATE TABLE train_station ( Train_ID int, Station_ID int ) 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, ...
SELECT Location, AVG(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location
nvbench
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '70148968' AND jybgb.BGRQ BETWEEN '2007-08-06' AND '2021-12-19' UNI...
css
CREATE TABLE table_name_87 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team for the Princes Park venue?
SELECT home_team FROM table_name_87 WHERE venue = "princes park"
sql_create_context
CREATE TABLE table_name_34 ( starts INTEGER, wins VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average start with wins larger than 0 and 32nd position?
SELECT AVG(starts) FROM table_name_34 WHERE wins > 0 AND position = "32nd"
sql_create_context
CREATE TABLE table_5458 ( "s Car plate (starting 1937)" text, "Voivodeship or city" text, "Capital" text, "Area (1930) in 1,000skm 2" text, "Population (1931) in 1,000s" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Area (1930) in 1,000skm 2 of 31....
SELECT "Capital" FROM table_5458 WHERE "Area (1930) in 1,000skm 2" = '31.7'
wikisql
CREATE TABLE store_district ( Store_ID int, District_ID int ) CREATE TABLE store_product ( Store_ID int, Product_ID int ) CREATE TABLE product ( product_id int, product text, dimensions text, dpi real, pages_per_minute_color real, max_page_size text, interface text ) CREAT...
SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City
nvbench
CREATE TABLE table_24578 ( "Round #" real, "Pick #" real, "Player" text, "Position" text, "Nationality" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player belongs to deerfield academy (Massachusetts) col...
SELECT "Player" FROM table_24578 WHERE "College/junior/club team" = 'Deerfield Academy (Massachusetts)'
wikisql
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 COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MKT' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE phone ( Company_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many phone hardware models are produced by the company named 'Nokia Corporation'?
SELECT COUNT(*) FROM phone WHERE Company_name = "Nokia Corporation"
sql_create_context
CREATE TABLE table_300283_1 ( official_name VARCHAR, name_in_basque VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the official name of the municipality whose name in Basque is Bilar?
SELECT official_name FROM table_300283_1 WHERE name_in_basque = "Bilar"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3516) AND STRFTIME('%y', procedures_icd.charttime) = '2103' ORDER BY procedures_icd.charttime LIMIT 1
mimic_iii
CREATE TABLE table_8049 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did the Melbourne Tigers score when they ...
SELECT "Score" FROM table_8049 WHERE "Away team" = 'melbourne tigers'
wikisql
CREATE TABLE table_name_25 ( mascot VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Mascot of Brook?
SELECT mascot FROM table_name_25 WHERE location = "brook"
sql_create_context
CREATE TABLE table_26672 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real, "Left" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year did the teams leave the co...
SELECT MAX("Left") FROM table_26672
wikisql
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones"
nvbench
CREATE TABLE table_name_59 ( time VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Time has a Grid of 19?
SELECT time FROM table_name_59 WHERE grid = 19
sql_create_context
CREATE TABLE table_name_74 ( attack VARCHAR, gerb VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Attack has a 30,00% GERB?
SELECT attack FROM table_name_74 WHERE gerb = "30,00%"
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21468) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND DATETIME(labevents.charttime, 'start of year') = DATE...
mimic_iii
CREATE TABLE table_203_3 ( id number, "province" text, "capital" text, "population" number, "density" text, "municipalities" text, "legal districts" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which province in andalusia has the highest...
SELECT "province" FROM table_203_3 ORDER BY "density" DESC LIMIT 1
squall
CREATE TABLE table_54803 ( "1961 Democratic primary" text, "Manhattan" text, "The Bronx" text, "Brooklyn" text, "Queens" text, "Richmond [Staten Is.]" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who got 189,524 votes?
SELECT "Queens" FROM table_54803 WHERE "Manhattan" = '189,524'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 T...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(SALARY)
nvbench
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY SUM(ID) DESC
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
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 = '027-100528')) AND STRFTIME('%y', treatment.treatmenttime) >= '210...
eicu
CREATE TABLE table_51145 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the ...
SELECT "Goal Difference" FROM table_51145 WHERE "Drawn" > '11' AND "Goals Against" < '63' AND "Goals For" < '87' AND "Lost" > '16'
wikisql
CREATE TABLE table_57960 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which region was on June 8, 2004?
SELECT "Region" FROM table_57960 WHERE "Date" = 'june 8, 2004'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '张智渊' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC
css
CREATE TABLE table_38260 ( "Elementary Schools" text, "Mascot" text, "Address" text, "Principal (2013-2014)" text, "Assistant Principal (2013-2014)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the mascot for the 2013-2014 principal named...
SELECT "Mascot" FROM table_38260 WHERE "Principal (2013-2014)" = 'frank hendricsen'
wikisql
CREATE TABLE table_name_7 ( score VARCHAR, place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score did Ed Furgol get to come in at T6?
SELECT score FROM table_name_7 WHERE place = "t6" AND player = "ed furgol"
sql_create_context
CREATE TABLE table_30951 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the home team Essendon?
SELECT "Date" FROM table_30951 WHERE "Home team" = 'Essendon'
wikisql
CREATE TABLE table_3628 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result in the virginia 11 district?
SELECT "Result" FROM table_3628 WHERE "District" = 'Virginia 11'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Neutral, School_ID FROM basketball_match ORDER BY All_Neutral DESC
nvbench
CREATE TABLE table_22941863_19 ( team_classification VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the stage is 9, what is the team classification name?
SELECT team_classification FROM table_22941863_19 WHERE stage = 9
sql_create_context
CREATE TABLE table_35589 ( "Year" text, "Winners" text, "Score" text, "Runner-up" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the match with UTC as the runner-up and Saint-Gaudens Bears as the winners?
SELECT "Score" FROM table_35589 WHERE "Runner-up" = 'utc' AND "Winners" = 'saint-gaudens bears'
wikisql
CREATE TABLE table_1965650_8 ( nhl_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What NHL team does Denis Desgagnes play for?
SELECT nhl_team FROM table_1965650_8 WHERE player = "Denis Desgagnes"
sql_create_context
CREATE TABLE table_10149 ( "Player" text, "Span" text, "Start" real, "Tries" real, "Conv" real, "Pens" real, "Drop" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player had more than 1 try, 0 drops over a span on 1992-2000?
SELECT "Player" FROM table_10149 WHERE "Tries" > '1' AND "Drop" = '0' AND "Span" = '1992-2000'
wikisql
CREATE TABLE table_37265 ( "School" text, "Location" text, "Mascot" text, "# / County" text, "Year joined" real, "Previous conference" text, "Year left" real, "New conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did ...
SELECT SUM("Year left") FROM table_37265 WHERE "Location" = 'culver'
wikisql
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 AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE <= 21)
css
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, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
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 = '50833760' AND hz_info.YLJGDM = '0729314' AND mzjzjlb.JZKSMC LIKE '%妇产科%'
css
CREATE TABLE table_10351 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest crowd at windy hill?
SELECT MAX("Crowd") FROM table_10351 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE table_train_55 ( "id" int, "ejection_fraction_ef" int, "systolic_dysfunction" bool, "language" string, "valvular_dysfunction" bool, "consent" bool, "heart_disease" bool, "left_bundle_branch_block" bool, "trauma" bool, "pericardial_disease" bool, "complete_fluid_c...
SELECT * FROM table_train_55 WHERE complete_fluid_challenge = 0
criteria2sql
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V4581" AND prescriptions.route = "ED"
mimicsql_data
CREATE TABLE table_204_209 ( id number, "released" text, "title" text, "label" text, "number" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- avalon was released in the same month as which other record ?
SELECT "title" FROM table_204_209 WHERE "title" <> 'avalon' AND "released" = (SELECT "released" FROM table_204_209 WHERE "title" = 'avalon')
squall
CREATE TABLE table_name_33 ( flagship VARCHAR, host_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Flagship of the Show Hosted by Rover (Shane French)?
SELECT flagship FROM table_name_33 WHERE host_s_ = "rover (shane french)"
sql_create_context