instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Uric Acid"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, g...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 55729 AND STRFTIME('%y', admissions.admittime) <= '2103'
mimic_iii
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, j...
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'ashutosh saxena' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_32568 ( "Rank" real, "Stadium" text, "Capacity" text, "City" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country is ranked higher than 68, with a city named Santa Fe and a stadium that has a capacity of 32...
SELECT "Country" FROM table_32568 WHERE "Rank" > '68' AND "Capacity" = '32,000' AND "City" = 'santa fe'
wikisql
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.insurance = "Self Pay"
mimicsql_data
CREATE TABLE table_24575253_4 ( season VARCHAR, division_four VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the wallington new foresters are in division four what is the season?
SELECT season FROM table_24575253_4 WHERE division_four = "Wallington New Foresters"
sql_create_context
CREATE TABLE bdmzjzjlb ( 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 wdmzjzjlb.JZZDBM, wdmzjzjlb.JZZDSM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '91671154792' UNION SELECT bdmzjzjlb.JZZDBM, bdmzjzjlb.JZZDSM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '91671154792'
css
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2150" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2110" AND lab.label = "Asparate Aminotransferase (AST)"
mimicsql_data
CREATE TABLE table_14332 ( "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silvers have 2 as gold, and a bronze less than 2?
SELECT SUM("Silver") FROM table_14332 WHERE "Gold" = '2' AND "Bronze" < '2'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_name_89 ( studio_s_ VARCHAR, movie VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the studio of ra.one?
SELECT studio_s_ FROM table_name_89 WHERE movie = "ra.one"
sql_create_context
CREATE TABLE table_4174 ( "Episode" text, "First broadcast" text, "Andrew and Georgies guest" text, "Jamie and Johns guest" text, "Scores" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the scores when Jamie and Johns guest was Phillips Id...
SELECT "Scores" FROM table_4174 WHERE "Jamie and Johns guest" = 'Phillips Idowu'
wikisql
CREATE TABLE table_name_53 ( series__number INTEGER, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the highest series # for september 22, 1976
SELECT MAX(series__number) FROM table_name_53 WHERE original_air_date = "september 22, 1976"
sql_create_context
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
SELECT COUNT(*) FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = class_senator_vote WHERE T1.city_code = "NYC" AND T2.election_cycle = "Spring"
spider
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, ...
SELECT Id AS "comment_link", Text, UserId AS "user_link", CreationDate FROM Comments WHERE Text LIKE '%##Word##%' ORDER BY CreationDate DESC
sede
CREATE TABLE table_10706879_3 ( fastest_lap VARCHAR, rd VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many fastest laps were there for a rd that equals 10?
SELECT COUNT(fastest_lap) FROM table_10706879_3 WHERE rd = 10
sql_create_context
CREATE TABLE table_name_77 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1995 when the 1991 is Grand Slams?
SELECT 1995 FROM table_name_77 WHERE 1991 = "grand slams"
sql_create_context
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 zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '40691396989' GROUP BY zyjybgb.SHRGH HAVING COUNT(*) > 11 UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '40691396989' GROUP BY mzjybgb.SHRGH HAVING COUNT(*) > 11
css
CREATE TABLE table_41958 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the Visitor when the Nets were the Home team?
SELECT "Visitor" FROM table_41958 WHERE "Home" = 'nets'
wikisql
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_labitems ( row_id number, itemid number, label te...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ...
mimic_iii
CREATE TABLE table_3081 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who write episode number 48...
SELECT "Written by" FROM table_3081 WHERE "No. in series" = '48'
wikisql
CREATE TABLE table_73989 ( "Name" text, "Park" text, "Length (ft)" real, "Height (ft)" real, "Speed (mph)" text, "Opened" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many parks is Zippin Pippin located in
SELECT COUNT("Park") FROM table_73989 WHERE "Name" = 'Zippin Pippin'
wikisql
CREATE TABLE table_name_54 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance on 1997-12-14?
SELECT attendance FROM table_name_54 WHERE date = "1997-12-14"
sql_create_context
CREATE TABLE table_name_12 ( club_team VARCHAR, round INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club team was the player from who was selected in a round under 4?
SELECT club_team FROM table_name_12 WHERE round < 4
sql_create_context
CREATE TABLE table_name_17 ( player VARCHAR, pick__number VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHo is the Player got a Pick # smaller than 61, and a College of texas?
SELECT player FROM table_name_17 WHERE pick__number < 61 AND college = "texas"
sql_create_context
CREATE TABLE table_53897 ( "Name" text, "Original name" text, "Commissioned" text, "Final decommission" text, "Fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the ship originally named sachem finally decommissioned?
SELECT "Final decommission" FROM table_53897 WHERE "Original name" = 'sachem'
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 WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND demographic.dob_year < "2034"
mimicsql_data
CREATE TABLE table_63397 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What the round with the time 1:15?
SELECT AVG("Round") FROM table_63397 WHERE "Time" = '1:15'
wikisql
CREATE TABLE table_14356 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Great Britain's total time?
SELECT COUNT("Time") FROM table_14356 WHERE "Nationality" = 'great britain'
wikisql
CREATE TABLE table_13183076_3 ( original_air_date VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Original air date for the episode written by Peter Ocko?
SELECT original_air_date FROM table_13183076_3 WHERE written_by = "Peter Ocko"
sql_create_context
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier ORDER BY Carrier DESC
nvbench
CREATE TABLE table_name_27 ( agg VARCHAR, team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the aggregate in the match with a team 1 of Dinamo Minsk?
SELECT agg FROM table_name_27 WHERE team_1 = "dinamo minsk"
sql_create_context
CREATE TABLE table_2668264_22 ( first_elected VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first elected year that featured incumbent andrew r. govan?
SELECT first_elected FROM table_2668264_22 WHERE incumbent = "Andrew R. Govan"
sql_create_context
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 COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE IN_DIAG_DIS_NM = '牙隐裂'
css
CREATE TABLE marketing_regions ( marketing_region_code text, marketing_region_name text, marketing_region_descriptrion text, other_details text ) CREATE TABLE performers ( performer_id number, address_id number, customer_name text, customer_phone text, customer_email_address text, ...
SELECT T1.actual_delivery_date FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T2.order_quantity = 1
spider
CREATE TABLE table_43416 ( "Date" text, "Result" text, "Score" text, "Brazil scorers" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Brazil scorer who scored 6-0?
SELECT "Brazil scorers" FROM table_43416 WHERE "Score" = '6-0'
wikisql
CREATE TABLE table_49477 ( "Tongan" text, "Niuean" text, "S\u0101moan" text, "Takuu" text, "Tahitian" text, "Rarotongan" text, "M\u0101ori" text, "North Marquesan" text, "South Marquesan" text, "Hawai'ian" text, "Mangarevan" text ) -- Using valid SQLite, answer the followin...
SELECT "South Marquesan" FROM table_49477 WHERE "S\u0101moan" = '/matua/'
wikisql
CREATE TABLE table_name_92 ( try_bonus VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Try bonus with lost of 10
SELECT try_bonus FROM table_name_92 WHERE lost = "10"
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_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
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 qtb WHERE qtb.MED_SER_ORG_NO = '1037880' AND qtb.IN_HOSP_DATE BETWEEN '2008-02-22' AND '2009-05-23' AND qtb.SERVANT_FLG = '公务员' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1037880' AND gyb.IN_HOSP_DATE BETWEEN '2008-02-22' AND '2009-05-23' AND gyb.SERVANT_FLG = '公务员' UNION SELECT COU...
css
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
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 MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL"
mimicsql_data
CREATE TABLE table_name_4 ( location VARCHAR, days_held VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which location has 111 as the days held?
SELECT location FROM table_name_4 WHERE days_held = "111"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.diagnosis = "BOWEL OBSTRUCTION"
mimicsql_data
CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE ...
SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_train_102 ( "id" int, "autoimmune_disease" bool, "stroke" bool, "renal_disease" bool, "hepatic_disease" bool, "liver_disease" bool, "serum_creatinine" float, "seizure_disorder" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the ta...
SELECT * FROM table_train_102 WHERE stroke = 1 OR seizure_disorder = 1
criteria2sql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT (TIME_TO_STR(CreationDate, 'WEEKDA%Y') - 1) * 24 + TIME_TO_STR(CreationDate, '%-HOUR') AS WeekHour, CAST(SUM(Score) AS FLOAT) / CAST(COUNT(Id) AS FLOAT) FROM Posts WHERE PostTypeId = 1 AND Score >= 0 AND Score < 10 GROUP BY (TIME_TO_STR(CreationDate, 'WEEKDA%Y') - 1) * 24 + TIME_TO_STR(CreationDate, '%-HOUR') OR...
sede
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 SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3363279' AND t_kc22.STA_DATE BETWEEN '2000-02-01' AND '2018-10-31' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT COUNT(qtb.PERSON_ID) FROM qtb WHERE qtb.IN_DIAG_DIS_CD = 'L35.977' UNION SELECT COUNT(gyb.PERSON_ID) FROM gyb WHERE gyb.IN_DIAG_DIS_CD = 'L35.977' UNION SELECT COUNT(zyb.PERSON_ID) FROM zyb WHERE zyb.IN_DIAG_DIS_CD = 'L35.977' UNION SELECT COUNT(mzb.PERSON_ID) FROM mzb WHERE mzb.IN_DIAG_DIS_CD = 'L35.977'
css
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purc...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_name_82 ( attendance VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance of the match with rosso kumamoto as the away team?
SELECT attendance FROM table_name_82 WHERE away_team = "rosso kumamoto"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text,...
SELECT * FROM Users
sede
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE T...
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name ORDER BY T2.quality_rank
nvbench
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2186.0" AND diagnoses.icd9_code = "7778"
mimicsql_data
CREATE TABLE table_6456 ( "Race" text, "Trophy" text, "Rider(s)" text, "Machine" text, "Year" real, "Average speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time did bruce anstey complete in a honda 1000cc?
SELECT "Time" FROM table_6456 WHERE "Machine" = 'honda 1000cc' AND "Rider(s)" = 'bruce anstey'
wikisql
CREATE TABLE table_18052 ( "#" real, "Player" text, "Country" text, "Points" real, "Events" real, "Reset Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest reset points where the events is 23?
SELECT MAX("Reset Points") FROM table_18052 WHERE "Events" = '23'
wikisql
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
SELECT jyjgzbb.JYZBLSH 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_MZJZJLB AND zyjybgb.Y...
css
CREATE TABLE table_4519 ( "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 venue features a home team score of 10.14 (7...
SELECT "Venue" FROM table_4519 WHERE "Home team score" = '10.14 (74)'
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'C26.768' AND jyjgzbb.JCZBDM = '680382' UNION SELECT jyjgzbb.CKZFWX...
css
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 = '9557781' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_NM UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '9557781' GROUP BY gyb.MED_ORG_DEPT_NM, gyb....
css
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.gender = "M" AND diagnoses.icd9_code = "7242"
mimicsql_data
CREATE TABLE table_name_40 ( title VARCHAR, release_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was released on 1936-08-29?
SELECT title FROM table_name_40 WHERE release_date = "1936-08-29"
sql_create_context
CREATE TABLE table_68087 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country does miguel ngel jim nez player for and has a score of 69?
SELECT "Country" FROM table_68087 WHERE "Score" = '69' AND "Player" = 'miguel ángel jiménez'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar,...
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 = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWA...
atis
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 PostHistory ( Id number, PostHistoryT...
SELECT COUNT(Posts.Id) AS Answers FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId GROUP BY Posts.PostTypeId
sede
CREATE TABLE table_22644589_4 ( free_dance__fd_ VARCHAR, compulsory_dance__cd_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the free dance score in the event where compulsory dance score was 15.99?
SELECT free_dance__fd_ FROM table_22644589_4 WHERE compulsory_dance__cd_ = "15.99"
sql_create_context
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) 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 t...
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '14...
css
CREATE TABLE table_name_64 ( moving_from VARCHAR, country VARCHAR, transfer_fee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is moving from esp with transfer fee of youth system?
SELECT moving_from FROM table_name_64 WHERE country = "esp" AND transfer_fee = "youth system"
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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY SUM(Enrollment) DESC
nvbench
CREATE TABLE table_name_16 ( city___state VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the city/state of Hidden Valley Raceway?
SELECT city___state FROM table_name_16 WHERE circuit = "hidden valley raceway"
sql_create_context
CREATE TABLE Office_locations ( building_id int, company_id int, move_in_year int ) CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value_billion text ) CREATE TABLE building...
SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name ORDER BY COUNT(T3.name) DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, K...
SELECT jybgb.BGDH FROM hz_info JOIN wdmzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '61732704' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO...
css
CREATE TABLE table_30277 ( "Series no." real, "Season no." 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. ...
SELECT "Original air date" FROM table_30277 WHERE "U.S. viewers (millions)" = '1.57'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25951)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'portagen...
mimic_iii
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.drug = "NIFEdipine CR"
mimicsql_data
CREATE TABLE table_4919 ( "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 away team's score when north melbourn...
SELECT "Away team score" FROM table_4919 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_48256 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was Silva's Partner in the Amarante Tournament played on a Hard S...
SELECT "Partner" FROM table_48256 WHERE "Surface" = 'hard' AND "Tournament" = 'amarante'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId n...
SELECT Id AS "post_link", ViewCount, Score, Tags FROM Posts WHERE LOWER(Tags) LIKE '%<mathematica>%' ORDER BY ViewCount DESC, Score DESC LIMIT 20
sede
CREATE TABLE table_37849 ( "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. -- Team of corinthians, and a Lost larger than 15 ...
SELECT MAX("Drawn") FROM table_37849 WHERE "Team" = 'corinthians' AND "Lost" > '15'
wikisql
CREATE TABLE Hotels ( hotel_id INTEGER, star_rating_code CHAR(15), pets_allowed_yn CHAR(1), price_range real, other_hotel_details VARCHAR(255) ) CREATE TABLE Locations ( Location_ID INTEGER, Location_Name VARCHAR(255), Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE...
SELECT star_rating_code, AVG(price_range) FROM Hotels GROUP BY star_rating_code
nvbench
CREATE TABLE table_64 ( "Approximate Age" text, "Virtues" text, "Psycho Social Crisis" text, "Significant Relationship" text, "Existential Question [ not in citation given ]" text, "Examples" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How ma...
SELECT COUNT("Significant Relationship") FROM table_64 WHERE "Virtues" = 'Will'
wikisql
CREATE TABLE customer_events ( customer_event_id number, customer_id number, date_moved_in time, property_id number, resident_id number, thing_id number ) CREATE TABLE customer_event_notes ( customer_event_note_id number, customer_event_id number, service_type_code text, residen...
SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations
spider
CREATE TABLE table_18203 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Status" text, "Opponent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who opposed Marty Meehan in each election?
SELECT "Opponent" FROM table_18203 WHERE "Incumbent" = 'Marty Meehan'
wikisql
CREATE TABLE table_name_38 ( result VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Result, when Original Title is 'Qala'?
SELECT result FROM table_name_38 WHERE original_title = "qala"
sql_create_context
CREATE TABLE table_2794 ( "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. -- Name th...
SELECT "Score" FROM table_2794 WHERE "Team" = 'Chicago'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
SELECT meter_400, ID FROM swimmer ORDER BY meter_400 DESC
nvbench
CREATE TABLE table_14784 ( "Candidate" text, "Background" text, "Original Team" text, "Hometown" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the hometown of the candidate that had a result of 10 fired in week 6 (2-24-2005)?...
SELECT "Hometown" FROM table_14784 WHERE "Result" = '10 fired in week 6 (2-24-2005)'
wikisql
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_Games, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE table_33195 ( "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. -- Which was the highest crowd drawn by an Away tea...
SELECT MAX("Crowd") FROM table_33195 WHERE "Away team" = 'richmond'
wikisql
CREATE TABLE table_name_48 ( rank INTEGER, total VARCHAR, opposition VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In Limerick County, what is the Rank with a Total larger than 12 and Tipperary as the Opposition?
SELECT AVG(rank) FROM table_name_48 WHERE opposition = "tipperary" AND county = "limerick" AND total > 12
sql_create_context
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255) ) CREATE TAB...
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC
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 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.age < "64" AND demographic.dod_year <= "2174.0"
mimicsql_data
CREATE TABLE table_204_102 ( id number, "name" text, "location served" text, "governorate" text, "utilization" text, "helipads" number, "runways" number, "shelters" number, "squadrons" text, "coordinates" text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "name" FROM table_204_102 WHERE id = 1
squall
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.icd9_code = "E8889"
mimicsql_data
CREATE TABLE table_name_21 ( record VARCHAR, opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On August 10, what was the record against the Expos?
SELECT record FROM table_name_21 WHERE opponent = "expos" AND date = "august 10"
sql_create_context
CREATE TABLE table_80100 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points after 1956?
SELECT COUNT("Points") FROM table_80100 WHERE "Year" > '1956'
wikisql
CREATE TABLE table_name_15 ( points INTEGER, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of points for a 1981 team?
SELECT MIN(points) FROM table_name_15 WHERE year = 1981
sql_create_context
CREATE TABLE table_name_77 ( region VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which region had the year May 1974?
SELECT region FROM table_name_77 WHERE year = "may 1974"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( me...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-49193')) AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TI...
eicu