instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_47442 ( "Year" real, "Nominated/Won" text, "Award/category" text, "Festival/organization" text, "Role" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was nominated for the Jury Award?
SELECT "Nominated/Won" FROM table_47442 WHERE "Award/category" = 'jury award'
wikisql
CREATE TABLE table_73368 ( "Former country name" text, "Former codes" text, "Period of validity" text, "ISO 3166-3 code" text, "New country names and codes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number for period of validity ...
SELECT COUNT("Period of validity") FROM table_73368 WHERE "Former country name" = 'Upper Volta'
wikisql
CREATE TABLE table_10960039_6 ( pick__number INTEGER, cfl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest selection number for the saskatchewan roughriders team?
SELECT MAX(pick__number) FROM table_10960039_6 WHERE cfl_team = "Saskatchewan Roughriders"
sql_create_context
CREATE TABLE table_34389 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many picks does chad owens have?
SELECT COUNT("Pick #") FROM table_34389 WHERE "Name" = 'chad owens'
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '02068561850' UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '02068561850'
css
CREATE TABLE table_23117208_3 ( no_in_series INTEGER, viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when the number of spectator are 5.28 millions, which is the smallest number of the episode in series?
SELECT MIN(no_in_series) FROM table_23117208_3 WHERE viewers__millions_ = "5.28"
sql_create_context
CREATE TABLE table_name_3 ( engine VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the engine for the Bettenhausen Motorsports team?
SELECT engine FROM table_name_3 WHERE team = "bettenhausen motorsports"
sql_create_context
CREATE TABLE table_40057 ( "Club" text, "Wins" real, "Loses" real, "Points For" real, "Points Against" real, "Percentage" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club has losses greater than 1, 4 for the wins, with...
SELECT "Club" FROM table_40057 WHERE "Loses" > '1' AND "Wins" = '4' AND "Points Against" < '894'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedb...
SELECT u.Id AS "user_link", SUM(p.Score) AS "answer_score" FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 2 GROUP BY u.Id ORDER BY 'answer_score' DESC LIMIT 100
sede
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl...
css
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 SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8016) AND prescriptions.drug = 'atenolol' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month')
mimic_iii
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '1195150' AND t_kc22.STA_DATE BETWEEN '2003-02-04' AND '2004-12-30'
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row_id number, sub...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'total protein, urine')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY...
mimic_iii
CREATE TABLE customers ( id number, first_name text, last_name text, company text, address text, city text, state text, country text, postal_code text, phone text, fax text, email text, support_rep_id number ) CREATE TABLE tracks ( id number, name text, a...
SELECT T1.first_name, T1.last_name, COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10
spider
CREATE TABLE table_name_61 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game on November 6, 1988?
SELECT result FROM table_name_61 WHERE date = "november 6, 1988"
sql_create_context
CREATE TABLE ref_service_types ( service_type_code text, parent_service_type_code text, service_type_description text ) CREATE TABLE bookings_services ( order_id number, product_id number ) CREATE TABLE customers ( customer_id text, address_id number, customer_name text, customer_p...
SELECT T1.state_county FROM addresses AS T1 JOIN stores AS T2 ON T1.address_id = T2.address_id WHERE T2.marketing_region_code = "CA"
spider
CREATE TABLE table_1341568_48 ( party VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many parties is Tom Foley a member of?
SELECT COUNT(party) FROM table_1341568_48 WHERE incumbent = "Tom Foley"
sql_create_context
CREATE TABLE table_name_25 ( laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many laps were there when the grid was 24?
SELECT COUNT(laps) FROM table_name_25 WHERE grid = 24
sql_create_context
CREATE TABLE table_name_90 ( laps VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps did the team with a time/retired of +1.906 have?
SELECT COUNT(laps) FROM table_name_90 WHERE time_retired = "+1.906"
sql_create_context
CREATE TABLE table_7361 ( "University" text, "Men's" real, "Women's" real, "Junior's" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average total of the university with more than 3 junior's championships?
SELECT AVG("Total") FROM table_7361 WHERE "Junior's" > '3'
wikisql
CREATE TABLE table_204_194 ( id number, "outcome" text, "edition" number, "round" text, "opponent team" text, "surface" text, "opponent" text, "score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- number of games in the match against do...
SELECT "score" FROM table_204_194 WHERE "opponent" = 'dominika cibulkova'
squall
CREATE TABLE table_140297_1 ( population_2011_census VARCHAR, local_government_area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people live in the area of Sorell according to the Census of 2011?
SELECT population_2011_census FROM table_140297_1 WHERE local_government_area = "Sorell"
sql_create_context
CREATE TABLE table_8000 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did Ernie Els par?
SELECT "To par" FROM table_8000 WHERE "Player" = 'ernie els'
wikisql
CREATE TABLE table_14955 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the game site for october 18, 1992
SELECT "Game site" FROM table_14955 WHERE "Date" = 'october 18, 1992'
wikisql
CREATE TABLE table_2417445_4 ( reason_for_vacancy VARCHAR, successor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When rudolph kleberg (d) is the successor is the reason for vacancy?
SELECT reason_for_vacancy FROM table_2417445_4 WHERE successor = "Rudolph Kleberg (D)"
sql_create_context
CREATE TABLE table_train_233 ( "id" int, "serum_bicarbonate" int, "language" string, "hemoglobin_a1c_hba1c" float, "creatinine_clearance_cl" float, "admission_blood_glucose" int, "urine_albumin" int, "ketoacidosis" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answe...
SELECT * FROM table_train_233 WHERE urine_albumin < 300 OR creatinine_clearance_cl < 300
criteria2sql
CREATE TABLE table_name_30 ( city VARCHAR, aam_member VARCHAR, astc_member VARCHAR, state VARCHAR, aam_accredited VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is City, when State is California, when AAM Accredited is No, when ASTC Member i...
SELECT city FROM table_name_30 WHERE state = "california" AND aam_accredited = "no" AND astc_member = "yes" AND aam_member = "no"
sql_create_context
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2089"
mimicsql_data
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'cpk-mb index')
eicu
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Famvir"
mimicsql_data
CREATE TABLE table_name_70 ( gold INTEGER, silver VARCHAR, total VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Gold, when Total is greater than 2, when Bronze is greater than 1, and when Silver is less than 1?
SELECT SUM(gold) FROM table_name_70 WHERE total > 2 AND bronze > 1 AND silver < 1
sql_create_context
CREATE TABLE table_20967430_2 ( ep INTEGER, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least episode for november 29, 1985
SELECT MIN(ep) FROM table_20967430_2 WHERE original_air_date = "November 29, 1985"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id ...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'total protein, body fluid') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27392) AND STRFTIME('%y', labevents.charttime) = '2105'
mimic_iii
CREATE TABLE table_name_94 ( partner VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which partner was on 14 april 2013?
SELECT partner FROM table_name_94 WHERE date = "14 april 2013"
sql_create_context
CREATE TABLE table_6050 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the series standing after game 1?
SELECT "Series" FROM table_6050 WHERE "Game" = '1'
wikisql
CREATE TABLE table_name_62 ( years_for_grizzlies VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which years did the player from Providence play for Memphis?
SELECT years_for_grizzlies FROM table_name_62 WHERE school_club_team = "providence"
sql_create_context
CREATE TABLE table_40812 ( "Year" real, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Co-Drivers, when Laps is greater than 196, and when Year is before 2010?
SELECT "Co-Drivers" FROM table_40812 WHERE "Laps" > '196' AND "Year" < '2010'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
SELECT u.Id AS userID, u.Location AS userLocation, u.UpVotes AS userUpvotes, u.DownVotes AS userDownVotes, p.Id AS postID, p.ParentId AS parentPostID, p.CreationDate AS postCreationDate, p.DeletionDate AS postDeletionDate, p.Score AS postScore, p.ViewCount AS postViews, p.AnswerCount AS postAnswers, p.CommentCount AS p...
sede
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(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '许乐游' AND t_kc22.STA_DATE BETWEEN '2000-10-24' AND '2010-02-06' AND t_kc22.SELF_PAY_AMO > 7502.91 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '许乐游' AND ...
css
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(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_NM = '酒精依赖综合征'
css
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_...
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 = 24 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
CREATE TABLE table_28081876_6 ( written_by VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the authors of the episode first broadcast on August 10, 2012?
SELECT written_by FROM table_28081876_6 WHERE original_air_date = "August 10, 2012"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT questions.Id AS "post_link", questions.Score AS "Q score", MAX(answers.Score) AS "max A score", COUNT(*) AS "answer count", (SELECT GROUP_CONCAT(COALESCE(DisplayName, 'N/A'), ',') AS csv FROM Posts JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Posts.ParentId = questions.Id) FROM Posts AS questions JOIN Posts ...
sede
CREATE TABLE table_name_18 ( yeast_ortholog VARCHAR, mouse_ortholog VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the yeast ortholog of mouse ortholog MMS19?
SELECT yeast_ortholog FROM table_name_18 WHERE mouse_ortholog = "mms19"
sql_create_context
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2167" AND lab.itemid = "51300"
mimicsql_data
CREATE TABLE table_204_211 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many nations are there ?
SELECT COUNT("nation") FROM table_204_211
squall
CREATE TABLE table_70865 ( "Goal" real, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Score where Goal is larger than 11, and a Competition of 2009 nehru cup, an...
SELECT "Score" FROM table_70865 WHERE "Goal" > '11' AND "Competition" = '2009 nehru cup' AND "Date" = '24 august 2009'
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.diagnosis = "S/P HANGING"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ...
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 = '021-43538')) AND medication.drugname = 'hydralazine 20 mg/1 ml 1 ml inj' A...
eicu
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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, UNIVALENT FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '21485538' AND MED_SER_ORG_NO = '1900114') ORDER BY UNIVALENT DESC LIMIT 1
css
CREATE TABLE table_15419 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player had a place of T4?
SELECT "Player" FROM table_15419 WHERE "Place" = 't4'
wikisql
CREATE TABLE table_46595 ( "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 is the time before round 2, and the ko (knee t...
SELECT "Time" FROM table_46595 WHERE "Round" < '2' AND "Method" = 'ko (knee to the body)'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14397)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'...
mimic_iii
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11579 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev...
mimic_iii
CREATE TABLE table_36658 ( "Pos. in 2007" text, "Club" text, "City" text, "Best Position" text, "Seasons in league" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which City has Seasons in league of 17, and a Club of shakhter?
SELECT "City" FROM table_36658 WHERE "Seasons in league" = '17' AND "Club" = 'shakhter'
wikisql
CREATE TABLE table_name_67 ( sleeves VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Sleeves have a Year of 2006-2008?
SELECT sleeves FROM table_name_67 WHERE year = "2006-2008"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID
nvbench
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Chronic liver dis NEC"
mimicsql_data
CREATE TABLE table_49630 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for Boston's road team in game 4?
SELECT "Result" FROM table_49630 WHERE "Road Team" = 'boston' AND "Game" = 'game 4'
wikisql
CREATE TABLE companies ( id number, name text, headquarters text, industry text, sales_billion number, profits_billion number, assets_billion number, market_value_billion text ) CREATE TABLE office_locations ( building_id number, company_id number, move_in_year number ) CRE...
SELECT name FROM buildings WHERE NOT id IN (SELECT building_id FROM office_locations)
spider
CREATE TABLE table_18884 ( "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 "Location Attendance" FROM table_18884 WHERE "Team" = 'Portland'
wikisql
CREATE TABLE table_57358 ( "Player" text, "Car." real, "Yards" text, "Avg." text, "TD's" real, "Long" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the long for charles frederick
SELECT "Long" FROM table_57358 WHERE "Player" = 'charles frederick'
wikisql
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY Type
nvbench
CREATE TABLE Staff ( staff_id INTEGER, staff_address_id INTEGER, nickname VARCHAR(80), first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), date_of_birth DATETIME, date_joined_staff DATETIME, date_left_staff DATETIME ) CREATE TABLE Vehicles ( vehicle_id INTEGE...
SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_73106 ( "C_{low}" text, "C_{high}" text, "I_{low}" real, "I_{high}" real, "Category" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the i_{high} value when C_{low} is 250.5?
SELECT MIN("I_{high}") FROM table_73106 WHERE "C_{low}" = '250.5'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '61753289782'
css
CREATE TABLE table_name_83 ( place INTEGER, draw VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest place for song that was draw number 6?
SELECT MAX(place) FROM table_name_83 WHERE draw = 6
sql_create_context
CREATE TABLE table_61676 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT "Try bonus" FROM table_61676 WHERE "Lost" = '13' AND "Drawn" = '2'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId n...
SELECT pf.Id AS "id", pf.PostId AS "post_link" FROM PendingFlags AS pf WHERE pf.CloseReasonTypeId != 0
sede
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%brazil%' OR UPPER(Location) LIKE '%BRA' ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE table_16443 ( "Series #" real, "Episode #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode called 'Tell-tale Heart'?
SELECT "Directed by" FROM table_16443 WHERE "Title" = 'Tell-Tale Heart'
wikisql
CREATE TABLE table_52333 ( "Rank" real, "Airline" text, "Country" text, "Remarks" text, "Alliance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the country for airline of gol
SELECT "Country" FROM table_52333 WHERE "Airline" = 'gol'
wikisql
CREATE TABLE table_71156 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Pts." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year with 16 points?
SELECT MIN("Year") FROM table_71156 WHERE "Pts." = '16'
wikisql
CREATE TABLE table_45953 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "No. 3" FROM table_45953 WHERE "No. 7" = 'abigail' AND "No. 2" = 'olivia'
wikisql
CREATE TABLE table_name_55 ( team VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team of winner Dick Johnson?
SELECT team FROM table_name_55 WHERE winner = "dick johnson"
sql_create_context
CREATE TABLE table_name_55 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Player is 'Jos Mar a Olaz bal'?
SELECT country FROM table_name_55 WHERE player = "josé maría olazábal"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "2"
mimicsql_data
CREATE TABLE table_59563 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status with the opposing team of Scotland?
SELECT "Status" FROM table_59563 WHERE "Opposing Teams" = 'scotland'
wikisql
CREATE TABLE table_48528 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Part 3, when Part 1 is 'frj sa'?
SELECT "Part 3" FROM table_48528 WHERE "Part 1" = 'frjósa'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE airport ( airport_code varchar, airport_name 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, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DAYS_0.day_name = 'SUNDAY' AND DAYS_1.day_name = 'SU...
atis
CREATE TABLE table_name_88 ( nominee VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nominee has a Category of outstanding musical?
SELECT nominee FROM table_name_88 WHERE category = "outstanding musical"
sql_create_context
CREATE TABLE table_name_61 ( team__number1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the 2nd leg for alemannia aachen
SELECT 2 AS nd_leg FROM table_name_61 WHERE team__number1 = "alemannia aachen"
sql_create_context
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'GEOSCI' AND c...
advising
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 FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_name_52 ( average INTEGER, swimsuit VARCHAR, evening_gown VARCHAR, state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean average score when the evening gown score is more than 9.35, the state is South Carolina, and ...
SELECT AVG(average) FROM table_name_52 WHERE evening_gown > 9.35 AND state = "south carolina" AND swimsuit > 9.4
sql_create_context
CREATE TABLE table_name_80 ( date_of_birth VARCHAR, party VARCHAR, house_term VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of birth of a republican member of the United States House of Representatives who held the term of 1863-1865?
SELECT date_of_birth FROM table_name_80 WHERE party = "republican" AND house_term = "1863-1865"
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGD...
SELECT JYKSBM, JYKSMC FROM jybgb WHERE BGDH = '40675785383'
css
CREATE TABLE table_204_778 ( id number, "code" number, "county" text, "former province" text, "area (km2)" number, "population\ncensus 2009" number, "capital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which county has the most area ?
SELECT "county" FROM table_204_778 ORDER BY "area (km2)" DESC LIMIT 1
squall
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '58577341155' GROUP BY SHRGH HAVING COUNT(*) > 7
css
CREATE TABLE invoice_items ( invoice_item_id number, invoice_id number, order_id number, order_item_id number, product_id number, order_quantity number, other_item_details text ) CREATE TABLE marketing_regions ( marketing_region_code text, marketing_region_name text, marketing_r...
SELECT status_code FROM bookings GROUP BY status_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_23 ( position INTEGER, country VARCHAR, pilot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest position of pilot mario kiessling from Germany?
SELECT MIN(position) FROM table_name_23 WHERE country = "germany" AND pilot = "mario kiessling"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offeri...
SELECT AVG(workload) FROM program_course WHERE category LIKE '%Other%'
advising
CREATE TABLE table_name_21 ( notes VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Notes have a Date of 2008-01-27?
SELECT notes FROM table_name_21 WHERE date = "2008-01-27"
sql_create_context
CREATE TABLE table_51876 ( "D 41" text, "D 42" text, "D 43" text, "D 44" text, "D 45" text, "D 46" text, "R 54" text, "R 53" text, "R 52" text, "R 51" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the D 41 which has a D 46 ...
SELECT "D 41" FROM table_51876 WHERE "D 46" = 'r 6'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'drainage procedure - surgical' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 year'...
eicu
CREATE TABLE table_name_87 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for princes park
SELECT date FROM table_name_87 WHERE venue = "princes park"
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '牙列缺失' AND jyjgzbb.JCZBDM = '492909'
css
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number...
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27964)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'...
mimic_iii
CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID int, Date text, Year real, Location text, Country text, Killed int, Injured int ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, "Home Town" text ) -- Using valid SQLite, answer the...
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country
nvbench
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'protein, total') AND STRFTIME('%y', labevents.charttime) >= '2105')
mimic_iii