instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_4367 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the outcome of 2 6, 1 6
SELECT "Outcome" FROM table_4367 WHERE "Score" = '2–6, 1–6'
wikisql
CREATE TABLE table_25905 ( "Episode" text, "First broadcast" text, "Seans team" text, "Jons team" text, "Scores" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was on Jon's team when Sean's team had Matthew Crosby and Kimberly Wyatt?
SELECT "Jons team" FROM table_25905 WHERE "Seans team" = 'Matthew Crosby and Kimberly Wyatt'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
SELECT OwnerUserId AS "user_link", COUNT(Id) AS "posts" FROM Posts WHERE LOWER(Body) LIKE LOWER('%##word##%') AND CreationDate < '##date##' GROUP BY OwnerUserId ORDER BY COUNT(Id) DESC
sede
CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM location AS LOCATIONalias1, restaurant AS RESTAURANTalias1 W...
restaurants
CREATE TABLE table_name_23 ( time_retired VARCHAR, laps INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the time/retired when the laps is less than 4?
SELECT time_retired FROM table_name_23 WHERE laps < 4
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '秦惜玉' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-05-21' AND '2007-11-29' AND t_kc24.MED_AMOUT <= 10
css
CREATE TABLE table_28891 ( "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 was the result of Samuel Smith's race?
SELECT "Result" FROM table_28891 WHERE "Incumbent" = 'Samuel Smith'
wikisql
CREATE TABLE table_203_179 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the number of goals that elvir balji &#...
SELECT "score" FROM table_203_179 WHERE "opponent" = 'lithuania'
squall
CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_by_staff_id INTEGER, fault_log_entry_datetime DATETIME, fault_description VARCHAR(255), other_fault_details VARCHAR(255) ) CREATE TABLE Fault_Log_Parts ( fault_log_entry_id INTEGER, part_fault_id INTEGER, ...
SELECT staff_name, COUNT(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name ORDER BY COUNT(*)
nvbench
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.person_i...
css
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 zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '69886935' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2014-06-18')
css
CREATE TABLE table_name_52 ( location_attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location attendance of the game on February 25?
SELECT location_attendance FROM table_name_52 WHERE date = "february 25"
sql_create_context
CREATE TABLE table_train_123 ( "id" int, "bleeding" int, "systolic_blood_pressure_sbp" int, "anticoagulation" bool, "lumbar_puncture" bool, "blood_pressure_problem" bool, "stroke" bool, "substance_dependence" bool, "schizophrenia" bool, "major_mental_illness" bool, "multiple_...
SELECT * FROM table_train_123 WHERE neurological_disease = 1 OR (alzheimer_disease_ad = 1 OR parkinson_disease = 1 OR stroke = 1 OR brain_tumor = 1 OR multiple_sclerosis = 1 OR seizure_disorder = 1)
criteria2sql
CREATE TABLE table_name_86 ( winning_jockey VARCHAR, track VARCHAR, winning_horse VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Winning Jockey ran in the Tampa Bay Downs Track on Winning Horse Barkley Sound?
SELECT winning_jockey FROM table_name_86 WHERE track = "tampa bay downs" AND winning_horse = "barkley sound"
sql_create_context
CREATE TABLE table_name_11 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player had a Score of 70-69-75=214?
SELECT player FROM table_name_11 WHERE score = 70 - 69 - 75 = 214
sql_create_context
CREATE TABLE table_58089 ( "Date" text, "Venue" text, "Opposition" text, "Score" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the game on 8 Sep 1990?
SELECT "Score" FROM table_58089 WHERE "Date" = '8 sep 1990'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT TIME_TO_STR(CreationDate, '%-mONT%-H') AS "month", SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) / 100.0 AS "downvotes_(hundred)", SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) / 100.0 AS "upvotes_(hundred)", SUM(CASE WHEN PostId = 1 THEN 1 ELSE 0 END) AS "questions", SUM(CASE WHEN PostId = 2 THEN 1 ELSE 0 E...
sede
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-73567')) AND treatment.treatmentname = 'anticonvulsant - lorazepam'
eicu
CREATE TABLE table_56779 ( "County" text, "Name" text, "Length (miles)" real, "West or south terminus" text, "East or north terminus" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the length (miles) when the name is l-56g?
SELECT MAX("Length (miles)") FROM table_56779 WHERE "Name" = 'l-56g'
wikisql
CREATE TABLE table_78031 ( "Source" text, "Date" text, "Cardwell" text, "Jones" text, "Knight" text, "Lanier" text, "Martin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What source has a Knight of 2%?
SELECT "Source" FROM table_78031 WHERE "Knight" = '2%'
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.dob_year < "2200"
mimicsql_data
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "4" AND procedures.long_title = "Extracorporeal circulation auxiliary to open heart surgery"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-7771')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.cel...
eicu
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-40638' AND NOT patient.hospit...
eicu
CREATE TABLE table_name_25 ( result VARCHAR, director VARCHAR, film_title_used_in_nomination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the result for director elia schneider's punto y raya?
SELECT result FROM table_name_25 WHERE director = "elia schneider" AND film_title_used_in_nomination = "punto y raya"
sql_create_context
CREATE TABLE table_dev_36 ( "id" int, "gender" string, "prediabetes" bool, "leukopenia" int, "hemoglobin_a1c_hba1c" float, "cd4_count" int, "platelets" int, "hematocrit_hct" float, "fasting_triglycerides" int, "hyperlipidemia" bool, "lymphopenia" int, "fasting_ldl_cholest...
SELECT * FROM table_dev_36 WHERE hematocrit_hct < 30 OR hematocrit_hct > 55
criteria2sql
CREATE TABLE table_23670057_6 ( height__f_ VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the height for steffen hamann
SELECT height__f_ FROM table_23670057_6 WHERE player = "Steffen Hamann"
sql_create_context
CREATE TABLE table_train_128 ( "id" int, "vascular" bool, "mania" bool, "pulmonary_disease" bool, "cardiac" bool, "stroke" bool, "substance_dependence" bool, "schizophrenia" bool, "cerebrovascular_disease" bool, "hematologic_disease" bool, "adverse_reactions_venlaflaxine" boo...
SELECT * FROM table_train_128 WHERE cerebrovascular_disease = 1 OR ((CASE WHEN stroke = 1 THEN 1 ELSE 0 END + CASE WHEN neuropathology = 1 THEN 1 ELSE 0 END) >= 1)
criteria2sql
CREATE TABLE table_203_416 ( id number, "school name" text, "city" text, "grades" text, "establishment" number, "charter" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the last public middle school founded in hawaii ?
SELECT "school name" FROM table_203_416 ORDER BY "establishment" DESC LIMIT 1
squall
CREATE TABLE table_name_66 ( outgoing_manager VARCHAR, replaced_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Outgoing Manager replaced by Sandy Clark?
SELECT outgoing_manager FROM table_name_66 WHERE replaced_by = "sandy clark"
sql_create_context
CREATE TABLE table_422 ( "Symbol" text, "Description" text, "Success" text, "Date of completion" text, "Deadline for completion" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the success where deadline for completion is october 7, 2007
SELECT "Success" FROM table_422 WHERE "Deadline for completion" = 'October 7, 2007'
wikisql
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 T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id nu...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 13686 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE table_name_87 ( bats_throws VARCHAR, players VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What side does Clayton Allison Bat/Throw from?
SELECT bats_throws FROM table_name_87 WHERE players = "clayton allison"
sql_create_context
CREATE TABLE table_17205 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does Cody Ceci play?
SELECT "Position" FROM table_17205 WHERE "Player" = 'Cody Ceci'
wikisql
CREATE TABLE table_20581 ( "Platform" real, "Frequency (per hour)" real, "Destination" text, "Service Pattern" text, "Operator" text, "Line" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many frequency figures are given for next station ser...
SELECT COUNT("Frequency (per hour)") FROM table_20581 WHERE "Service Pattern" = 'Next station'
wikisql
CREATE TABLE table_25794532_1 ( position VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the position for eifelland racing
SELECT position FROM table_25794532_1 WHERE team = "Eifelland Racing"
sql_create_context
CREATE TABLE table_name_77 ( series_3 VARCHAR, seat INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series 3 with more than 4 seats?
SELECT series_3 FROM table_name_77 WHERE seat > 4
sql_create_context
CREATE TABLE table_26200568_16 ( percentage VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage listed for the team who scored 63 points?
SELECT percentage FROM table_26200568_16 WHERE points_for = 63
sql_create_context
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 diagnosis ( diagn...
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 = '015-94351')) AND DATETIME(treatment.treatmenttime, 'start of year...
eicu
CREATE TABLE table_73315 ( "School District" text, "Headquarters" text, "Sector" text, "Enrollment (2011-12)" real, "Teachers (2008-09" real, "Student-Teacher ratio (2008-09)" text, "French enrollment (2011-12)" text, "Graduation rate (2011-12)" text, "Withdrawal rate (2010-11)" text...
SELECT "Withdrawal rate (2010-11)" FROM table_73315 WHERE "Headquarters" = 'Truro'
wikisql
CREATE TABLE table_10725629_2 ( rnd VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which rounds were held on August 9?
SELECT rnd FROM table_10725629_2 WHERE date = "August 9"
sql_create_context
CREATE TABLE has_amenity ( dormid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of dorms that have some amenity.
SELECT COUNT(DISTINCT dormid) FROM has_amenity
sql_create_context
CREATE TABLE staff ( staff_id number, staff_gender text, staff_name text ) CREATE TABLE department_store_chain ( dept_store_chain_id number, dept_store_chain_name text ) CREATE TABLE customer_addresses ( customer_id number, address_id number, date_from time, date_to time ) CREATE ...
SELECT T1.staff_id, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Department Manager"
spider
CREATE TABLE table_name_63 ( bonus_points VARCHAR, drawn VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of bonus points for the team with 2 drawn games and 475 points?
SELECT bonus_points FROM table_name_63 WHERE drawn = "2" AND points_for = "475"
sql_create_context
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 diagnosis ( diagn...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) <= '2103'
eicu
CREATE TABLE table_11944282_1 ( integrated VARCHAR, allied_related VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many integrated allied-related are there?
SELECT integrated FROM table_11944282_1 WHERE allied_related = "Many"
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.diagnosis = "OVERDOSE"
mimicsql_data
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 gwyjzb.CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '34573036541' UNION SELECT fgwyjzb.CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '34573036541'
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(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '45075534' AND t_kc22.STA_DATE BETWEEN '2007-07-19' AND '2020-07-13' AND t_kc22.SELF_PAY_PRO < 0.3
css
CREATE TABLE table_13110459_2 ( overall VARCHAR, rating VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are all the overall with rating being 1.4
SELECT overall FROM table_13110459_2 WHERE rating = "1.4"
sql_create_context
CREATE TABLE table_10420426_1 ( wins VARCHAR, series VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of wins for gp2 series for racing engineering?
SELECT COUNT(wins) FROM table_10420426_1 WHERE series = "GP2 series" AND team = "Racing Engineering"
sql_create_context
CREATE TABLE fgwyjzb ( 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 SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '0329082' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-10-07' AND '2013-08-28' UNION SELECT SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyj...
css
CREATE TABLE table_75893 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the HDTV when the content shows a timeshift +1 di disney ...
SELECT "HDTV" FROM table_75893 WHERE "Content" = 'timeshift +1 di disney junior'
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.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb...
css
CREATE TABLE table_name_56 ( tie_no VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Tie Number when the home team was West Ham United?
SELECT tie_no FROM table_name_56 WHERE home_team = "west ham united"
sql_create_context
CREATE TABLE table_9110 ( "Title" text, "Lyricist(s)" text, "Composer(s)" text, "Arranger(s)" text, "Length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Title, when the Composer(s) is Sakdatorn, and when the Arranger(s) is Jitrakorn M...
SELECT "Title" FROM table_9110 WHERE "Composer(s)" = 'sakdatorn' AND "Arranger(s)" = 'jitrakorn mongkoltham'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-17834')) AND microlab.culturesite = 'sputum, tracheal specime...
eicu
CREATE TABLE table_name_63 ( height VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height of player James Stanton?
SELECT height FROM table_name_63 WHERE name = "james stanton"
sql_create_context
CREATE TABLE table_203_173 ( id number, "year(s)" text, "serial name" text, "role" text, "co-star" text, "note(s)" text, "channel" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was kelkar 's last role ?
SELECT "serial name" FROM table_203_173 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name text, Gender text, Residence text, Occupation text, Votes int, Rank text ) CREATE TABLE club ( Club_ID int, Club_name text, Region text, Start_year int ) CREATE TABLE coach ( Coach_ID int, Coach...
SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY COUNT(Gender) DESC
nvbench
CREATE TABLE table_13555999_1 ( junior_high_school__12_15_yrs_ VARCHAR, gender VARCHAR, specification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What amount is the junior high school where the gender is male and the specification is minimum diameter ...
SELECT junior_high_school__12_15_yrs_ FROM table_13555999_1 WHERE gender = "Male" AND specification = "Minimum diameter of sakigawa"
sql_create_context
CREATE TABLE table_name_12 ( score VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for the Tournament of Cordenons?
SELECT score FROM table_name_12 WHERE tournament = "cordenons"
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 prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Pneumococcal Vac Polyvalent"
mimicsql_data
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 Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2148"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2111" AND prescriptions.formulary_drug_cd = "MORP2-4"
mimicsql_data
CREATE TABLE table_52662 ( "Chemical class" text, "Group" text, "Formula" text, "Prefix" text, "Suffix" text, "Example" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which chemical class uses the example Chloroethane (ethyl chloride)?
SELECT "Chemical class" FROM table_52662 WHERE "Example" = 'chloroethane (ethyl chloride)'
wikisql
CREATE TABLE table_name_73 ( crowd VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the crowd attendance when the home team was Melbourne?
SELECT COUNT(crowd) FROM table_name_73 WHERE home_team = "melbourne"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9146044' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-10-14' AND '2021-03-06' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9146044' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-10-14' AND '2021-03-06' AND t_kc21.IN_DIAG_DIS_CD = t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE table_8943 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the nationality of the player with a score of 72-72-67=211?
SELECT "Country" FROM table_8943 WHERE "Score" = '72-72-67=211'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CLIMATE' AND course.number = 105 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of...
advising
CREATE TABLE table_19810459_1 ( contestant VARCHAR, background VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For how many contestants was the background internet dreamer?
SELECT COUNT(contestant) FROM table_19810459_1 WHERE background = "Internet dreamer"
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, ...
SELECT COUNT(*) FROM course, course_offering, semester WHERE course_offering.start_time > '10:00:00' AND course.course_id = course_offering.course_id AND course.department = 'RCNSCI' AND course.number = 104 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 17 AND date_day.month_number = 8...
atis
CREATE TABLE table_52951 ( "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 did st kilda score at home?
SELECT "Home team score" FROM table_52951 WHERE "Home team" = 'st kilda'
wikisql
CREATE TABLE table_14242137_4 ( oberliga_baden_württemberg VARCHAR, oberliga_bayern VARCHAR, oberliga_südwest VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the oberliga for where tsv 1860 munich and borussia neunkirchen
SELECT oberliga_baden_württemberg FROM table_14242137_4 WHERE oberliga_bayern = "TSV 1860 Munich" AND oberliga_südwest = "Borussia Neunkirchen"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '3026245' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-08-12' AND '2020-06-16' GROUP B...
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '030-7471' AND STRFTIME('%y', patient.hospitaldischargetime) >= '2104' ORDER BY patient.hospitaldischargetime DESC LIMIT 1
eicu
CREATE TABLE table_458 ( "Season" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the womens doubles in 2002?
SELECT "Womens doubles" FROM table_458 WHERE "Season" = '2002'
wikisql
CREATE TABLE table_9553 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the total 60 77?
SELECT "Date" FROM table_9553 WHERE "Total" = '60–77'
wikisql
CREATE TABLE table_15409403_1 ( regular_season VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the regular season from year 2012?
SELECT regular_season FROM table_15409403_1 WHERE year = 2012
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "0" AND lab.label = "Phosphate"
mimicsql_data
CREATE TABLE table_22731 ( "State and District of Columbia" text, "Obese adults" text, "Overweight (incl. obese) adults" text, "Obese children and adolescents" text, "Obesity rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all percenta...
SELECT "Overweight (incl. obese) adults" FROM table_22731 WHERE "Obesity rank" = '21'
wikisql
CREATE TABLE table_44419 ( "q > 1" real, "q > 1.05" real, "q > 1.1" real, "q > 1.2" real, "q > 1.3" real, "q > 1.4" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total q > 1.4 with a q > 1 less than 7,801,334, and a q > 1.05 greater...
SELECT SUM("q > 1.4") FROM table_44419 WHERE "q > 1" < '7,801,334' AND "q > 1.05" > '812,499'
wikisql
CREATE TABLE table_57403 ( "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. -- Who is Princes Park's home team?
SELECT "Home team" FROM table_57403 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, sequence_identity_to_human_protein text, Institution_id text ) CREATE TABLE Institution ( Institution_id text, Institution text, Location ...
SELECT COUNT(*), SUM(Enrollment) FROM Institution GROUP BY Type
nvbench
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 AVG(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-142620')) AND NOT vitalperiodic.sao2 IS NULL AND DATE...
eicu
CREATE TABLE table_name_20 ( content VARCHAR, television_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the content for la sorgente sat 3?
SELECT content FROM table_name_20 WHERE television_service = "la sorgente sat 3"
sql_create_context
CREATE TABLE table_54064 ( "Round" real, "Pick" text, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which School/Club Team does Andrew Jones play for?
SELECT "School/Club Team" FROM table_54064 WHERE "Player" = 'andrew jones'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433) AND prescriptions.route = 'nas' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
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 patient ( uniquep...
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'neurosurgery - therapeutic craniotomy' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-1 year')
eicu
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationD...
SELECT DATE(CreationDate), Id AS "post_link", Score, Tags FROM Posts WHERE Tags LIKE '%vba>%' AND AnswerCount = 0 AND ClosedDate IS NULL AND PostTypeId = 1 ORDER BY DATE(CreationDate) DESC, Score DESC
sede
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 demographic.days_stay, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "8323"
mimicsql_data
CREATE TABLE table_name_53 ( election VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2nd Party has an Election of 1885?
SELECT 2 AS nd_party FROM table_name_53 WHERE election = "1885"
sql_create_context
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '沈...
css
CREATE TABLE table_name_7 ( position VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position ranked 10th overall?
SELECT position FROM table_name_7 WHERE pick = "10th overall"
sql_create_context
CREATE TABLE table_203_824 ( id number, "pick #" number, "player" text, "position" text, "nationality" text, "nhl team" text, "college/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which nationality is both scott birnie an...
SELECT "nationality" FROM table_203_824 WHERE "player" = 'scott birnie'
squall
CREATE TABLE table_name_54 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which date was the score 0 - 0?
SELECT date FROM table_name_54 WHERE score = "0 - 0"
sql_create_context