instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.Y...
css
CREATE TABLE table_41841 ( "Episode number" real, "Season" text, "Original airing" text, "Total viewers" text, "Audience share (average)" text, "Season viewer average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For episode number 2 what is t...
SELECT "Season viewer average" FROM table_41841 WHERE "Episode number" = '2'
wikisql
CREATE TABLE table_46994 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the method in round 1 of the UFC 20 event?
SELECT "Method" FROM table_46994 WHERE "Round" = '1' AND "Event" = 'ufc 20'
wikisql
CREATE TABLE table_name_25 ( rank INTEGER, total VARCHAR, jianshu VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest rank when Jianshu is smaller than 9.66, for Richard Devine ( gbr ), with a total smaller than 19.02?
SELECT MIN(rank) FROM table_name_25 WHERE jianshu < 9.66 AND athlete = "richard devine ( gbr )" AND total < 19.02
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 zyjzjlb ( YLJGDM text, JZLSH ...
SELECT BGJGDM, BGJGMC FROM jybgb WHERE BGDH = '36272042053'
css
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 Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%##word##%' ORDER BY CreationDate
sede
CREATE TABLE table_name_6 ( score VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score for the tie where Leeds United was the home team?
SELECT score FROM table_name_6 WHERE home_team = "leeds united"
sql_create_context
CREATE TABLE table_30422 ( "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. -- How ma...
SELECT COUNT("High rebounds") FROM table_30422 WHERE "Game" = '14'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zzmzjzjlb ( 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 person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE zzmzjzjlb.JZZDBM = 'C78.373' GROUP BY person_info.JGDM UNION SELECT...
css
CREATE TABLE table_name_18 ( owner_s_ VARCHAR, description VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Owner(s) has a Description of hunslet engine company 0-6-0st?
SELECT owner_s_ FROM table_name_18 WHERE description = "hunslet engine company 0-6-0st"
sql_create_context
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 person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '66920522667'
css
CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text ) -- Using valid SQLite, answer the ...
SELECT Date, Vote_Percent FROM election ORDER BY Date DESC
nvbench
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.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '苏...
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
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 = '009-5801')) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME()...
eicu
CREATE TABLE table_56786 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid value which has Time/Retired value of accident?
SELECT "Grid" FROM table_56786 WHERE "Time/Retired" = 'accident'
wikisql
CREATE TABLE table_name_9 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Geelong's score when they were the home team?
SELECT home_team AS score FROM table_name_9 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "NTG100PM"
mimicsql_data
CREATE TABLE table_name_88 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1988 value when the 1987 value was 1r?
SELECT 1988 FROM table_name_88 WHERE 1987 = "1r"
sql_create_context
CREATE TABLE table_train_255 ( "id" int, "ldl_cholesterol" int, "hemoglobin_a1c_hba1c" float, "body_weight" float, "urine_albumin_to_creatinine_ratio_uacr" int, "hba1c" float, "body_mass_index_bmi" float, "triglyceride_tg" float, "age" float, "NOUSE" float ) -- Using valid SQLi...
SELECT * FROM table_train_255 WHERE body_mass_index_bmi >= 27 AND body_mass_index_bmi <= 40 AND body_weight < 3
criteria2sql
CREATE TABLE table_246 ( "Model" text, "Engine make/Capacity" text, "Power kW@rpm" text, "Torque Nm@rpm" text, "Transmission Make/Type/Speed" text, "GVM (kg) Technical Capacity" text, "GCM (kg) Technical Capacity" text ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT "Model" FROM table_246 WHERE "Transmission Make/Type/Speed" = 'Eaton FS-6306 A Manual Synchromesh 6 Speed'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.days_stay > "4"
mimicsql_data
CREATE TABLE people ( people_id number, sex text, name text, date_of_birth text, height number, weight number ) CREATE TABLE candidate ( candidate_id number, people_id number, poll_source text, date text, support_rate number, consider_rate number, oppose_rate number,...
SELECT name FROM people ORDER BY date_of_birth
spider
CREATE TABLE table_1743 ( "Season" real, "Winners" text, "Total wins" real, "Runners-up" text, "Third-place" text, "fourth-placed" text, "Number of clubs" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was placed third in 2001?
SELECT "Third-place" FROM table_1743 WHERE "Season" = '2001'
wikisql
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '33964912' AND t_kc21.MED_SER_ORG_NO = '6431931' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%咽炎%'
css
CREATE TABLE table_79361 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Born" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the weight of Serhiy Alfyorov?
SELECT "Weight" FROM table_79361 WHERE "Name" = 'serhiy alfyorov'
wikisql
CREATE TABLE table_203_780 ( id number, "rank" number, "diver" text, "preliminary\npoints" number, "preliminary\nrank" number, "final\npoints" number, "final\nrank" number, "final\ntotal" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "diver" FROM table_203_780 WHERE "diver" <> 'juno stover-irwin' AND "diver" = (SELECT "diver" FROM table_203_780 WHERE "diver" = 'juno stover-irwin')
squall
CREATE TABLE table_19678 ( "Year" 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. -- How many womens doubles had champions the years broddi...
SELECT COUNT("Womens doubles") FROM table_19678 WHERE "Mixed doubles" = 'Broddi Kristjánsson Drífa Harðardóttir'
wikisql
CREATE TABLE employees ( first_name VARCHAR, last_name VARCHAR, birth_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the youngest employee in the company? List employee's first and last name.
SELECT first_name, last_name FROM employees ORDER BY birth_date DESC LIMIT 1
sql_create_context
CREATE TABLE table_40480 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most cuts made for events with 1 top-5, 2 top-10s, a...
SELECT MAX("Cuts made") FROM table_40480 WHERE "Top-5" = '1' AND "Top-10" = '2' AND "Events" > '13'
wikisql
CREATE TABLE table_48370 ( "Date of release" real, "Title" text, "Label" text, "Oricon peak" real, "RIAA cert." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE AVERAGE DATE OF RELEASE FOR THICKSKIN?
SELECT AVG("Date of release") FROM table_48370 WHERE "Title" = 'thickskin'
wikisql
CREATE TABLE table_16004 ( "Nomination" text, "Actors Name" text, "Film Name" text, "Director" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which actor from Serbia was nominated for best actor in a supporting role?
SELECT "Actors Name" FROM table_16004 WHERE "Nomination" = 'Best Actor in a Supporting Role' AND "Country" = 'Serbia'
wikisql
CREATE TABLE table_203_758 ( id number, "no." number, "dub no." number, "english dubbed title / english subbed title\noriginal japanese title" text, "original air date" text, "english air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what...
SELECT "english dubbed title / english subbed title\noriginal japanese title" FROM table_203_758 WHERE "english air date" = 9 AND "english air date" = 1995 ORDER BY "english air date" DESC LIMIT 1
squall
CREATE TABLE table_18328569_1 ( new_entries_this_round VARCHAR, winners_from_previous_round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many new entries started in the round where winners from the previous round is 16?
SELECT new_entries_this_round FROM table_18328569_1 WHERE winners_from_previous_round = "16"
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Polycythemia vera" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TA...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((((flight.departure_time > flight.arrival_time) AND date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.da...
atis
CREATE TABLE table_name_27 ( game_4 VARCHAR, game_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For which Game 4 did Michael O'Connor play during Game 1?
SELECT game_4 FROM table_name_27 WHERE game_1 = "michael o'connor"
sql_create_context
CREATE TABLE table_48152 ( "!Simple Present/Future" text, "Probable Future" text, "Simple Past" text, "Past Habitual" text, "Injunctive" text, "Imperative" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the probable future word for the s...
SELECT "Probable Future" FROM table_48152 WHERE "!Simple Present/Future" = 'high grade'
wikisql
CREATE TABLE table_name_68 ( democratic_ticket VARCHAR, office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The person who is on the Democratic ticket for the position of Office of U.S. Senator was who?
SELECT democratic_ticket FROM table_name_68 WHERE office = "u.s. senator"
sql_create_context
CREATE TABLE table_50669 ( "Character" text, "Code" text, "Name" text, "Version" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give the sum of the version with the coptic small letter sampi, and a year after 2005.
SELECT SUM("Version") FROM table_50669 WHERE "Name" = 'coptic small letter sampi' AND "Year" > '2005'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( ...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12927)) AND DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start o...
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 demographic.language FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-11660')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), ...
eicu
CREATE TABLE table_40279 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people were in attendance for the game week 15?
SELECT COUNT("Attendance") FROM table_40279 WHERE "Week" = '15'
wikisql
CREATE TABLE table_18355 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many instances are there of party in the situation where Robert Baum...
SELECT COUNT("Party") FROM table_18355 WHERE "Incumbent" = 'Robert Bauman'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME" AND procedures.short_title = "Cardiopulm resuscita NOS"
mimicsql_data
CREATE TABLE table_name_56 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did North Melbourne play as the away team?
SELECT venue FROM table_name_56 WHERE away_team = "north melbourne"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE table_36334 ( "ISSN" text, "Language" text, "Country" text, "Frequency" text, "Publication range" text, "Status" text, "Document Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status for a journal with the ISSN...
SELECT "Status" FROM table_36334 WHERE "ISSN" = '0149-1830'
wikisql
CREATE TABLE table_name_65 ( israel_bowl VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Israel Bowl for march 30, 2012
SELECT israel_bowl FROM table_name_65 WHERE date = "march 30, 2012"
sql_create_context
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 Office_locations ( building_id int, company_id int, move_in_year int ) 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
nvbench
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops 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, fare, flight, flight_fare WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day...
atis
CREATE TABLE table_189 ( "Team" text, "Head Coach" text, "President" text, "Home Ground" text, "Location" text, "Founded" real, "Website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The president, peter williamson, had how many home groun...
SELECT COUNT("Home Ground") FROM table_189 WHERE "President" = 'Peter Williamson'
wikisql
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "3799"
mimicsql_data
CREATE TABLE table_204_792 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who did the astros...
SELECT "opponent" FROM table_204_792 WHERE "#" > (SELECT MAX("#") FROM table_204_792 WHERE "opponent" = 'reds') ORDER BY "#" LIMIT 1
squall
CREATE TABLE table_name_58 ( school VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the school with the location of alexandria?
SELECT school FROM table_name_58 WHERE location = "alexandria"
sql_create_context
CREATE TABLE table_66136 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the country for rank 6?
SELECT "Country" FROM table_66136 WHERE "Rank" = '6'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 9833)) ORDER BY inputevents_cv.chart...
mimic_iii
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE T...
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 = 'cd4 cells, percent') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(...
mimic_iii
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
nvbench
CREATE TABLE table_51364 ( "Year" real, "Property Taxes" text, "Investment Earnings" text, "Other Local Sources" text, "State & Federal" text, "Total Revenue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the investment earnings in th...
SELECT "Investment Earnings" FROM table_51364 WHERE "State & Federal" = '8,549,565'
wikisql
CREATE TABLE table_62897 ( "Title" text, "Type" text, "Artist" text, "Label" text, "Standard number" text, "Release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Type has the Artist of Hiroyuki Takami?
SELECT "Type" FROM table_62897 WHERE "Artist" = 'hiroyuki takami'
wikisql
CREATE TABLE table_name_54 ( start VARCHAR, tries VARCHAR, conv VARCHAR, pens VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Start has a 0 Conv, 0 Pens and 8 Tries?
SELECT start FROM table_name_54 WHERE conv = "0" AND pens = "0" AND tries = "8"
sql_create_context
CREATE TABLE table_1973729_1 ( joined INTEGER, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year did the Lions join?
SELECT MIN(joined) FROM table_1973729_1 WHERE nickname = "Lions"
sql_create_context
CREATE TABLE table_70814 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nationality has a lane larger than 4 and a Time of 2:00.37?
SELECT "Nationality" FROM table_70814 WHERE "Lane" > '4' AND "Time" = '2:00.37'
wikisql
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 ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE 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. -- how many times did kelkar play himself ?
SELECT COUNT(*) FROM table_203_173 WHERE "role" = 'himself'
squall
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 prescriptions ( row_id number, subject_id number, h...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'd12.5w') AND STRFTIME('%y', cost.chargetime) <= '2104' GROUP BY cost.hadm_id) AS t1
mimic_iii
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.BGRQ FROM jybgb WHERE jybgb.BGDH = '42948232740'
css
CREATE TABLE table_name_27 ( game VARCHAR, road_team VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Road Team of utah jazz, and a Result of 81-83 (3-2) involved what game?
SELECT game FROM table_name_27 WHERE road_team = "utah jazz" AND result = "81-83 (3-2)"
sql_create_context
CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE aircraft ( aid number, name text, di...
SELECT origin, destination FROM flight WHERE price > 300
spider
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Abnrml coagultion prfile"
mimicsql_data
CREATE TABLE table_name_25 ( goals_for VARCHAR, played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of goals that has been played less than 38 times?
SELECT COUNT(goals_for) FROM table_name_25 WHERE played < 38
sql_create_context
CREATE TABLE table_name_54 ( played INTEGER, percentage VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average of games played with a percentage of 3.33% and less than 29 losses?
SELECT AVG(played) FROM table_name_54 WHERE percentage = "3.33%" AND lost < 29
sql_create_context
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 ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents...
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11823)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ostomy (output)' A...
mimic_iii
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 demographic.dob, demographic.diagnosis FROM demographic WHERE demographic.name = "Caren Obrien"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
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.short_title = "Acute uri NOS"
mimicsql_data
CREATE TABLE table_name_24 ( pick INTEGER, team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum total of picks for drake players from the tri-cities blackhawks?
SELECT SUM(pick) FROM table_name_24 WHERE team = "tri-cities blackhawks" AND college = "drake"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.age < "70"
mimicsql_data
CREATE TABLE table_43254 ( "Season" text, "Staffel A" text, "Staffel B" text, "Staffel C" text, "Staffel D" text, "Staffel E" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which season has a Staffel E of Stahl Riesa?
SELECT "Season" FROM table_43254 WHERE "Staffel E" = 'stahl riesa'
wikisql
CREATE TABLE table_name_43 ( round VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round was Robert Deciantis taken in?
SELECT round FROM table_name_43 WHERE player = "robert deciantis"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS va...
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees ORDER BY FIRST_NAME DESC
nvbench
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 lab ( subject_id text, hadm_id text, ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "20" AND demographic.dod_year < "2165.0"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2164" AND lab.label = "WBC"
mimicsql_data
CREATE TABLE Ref_budget_codes ( budget_type_description VARCHAR, budget_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the description for the budget type with code ORG?
SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = "ORG"
sql_create_context
CREATE TABLE table_name_98 ( record VARCHAR, game_site VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Bronco's record when they played the Detroit Lions at Mile High Stadium?
SELECT record FROM table_name_98 WHERE game_site = "mile high stadium" AND opponent = "detroit lions"
sql_create_context
CREATE TABLE table_name_7 ( sport VARCHAR, gold VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What sport has a Gold larger than 0, and a Silver of 2?
SELECT sport FROM table_name_7 WHERE gold > 0 AND silver = 2
sql_create_context
CREATE TABLE table_15302 ( "Driver" text, "Entrant" text, "Chassis" text, "Engine" text, "Tyres" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine was in the Theodore n183?
SELECT "Engine" FROM table_15302 WHERE "Chassis" = 'theodore n183'
wikisql
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, round_trip_required varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name ...
SELECT DISTINCT fare.fare_id FROM airport, airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (airport.airport_code = 'DEN' AND DATE_DAY_1.day_number = 27 AND DATE_DAY_1.month_number = 8 AND DATE_DAY_1.year = 1991 AND DAYS_1...
atis
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 jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '沈...
css
CREATE TABLE table_9681 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week is the highest one that has a Result of w 23-20, and an Attendance smaller than 34,127?
SELECT MAX("Week") FROM table_9681 WHERE "Result" = 'w 23-20' AND "Attendance" < '34,127'
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 Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Home
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_14342592_8 ( field_goals INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most field goals
SELECT MAX(field_goals) FROM table_14342592_8
sql_create_context
CREATE TABLE table_26362472_1 ( left_office VARCHAR, election_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date in which a politician who left office on 1840-10-11 for a politician whose election number was 11?
SELECT left_office FROM table_26362472_1 WHERE election_number = 11
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 patient ( uniquep...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-43966')) AND intakeoutput.cellpath LIKE '%output%' AND D...
eicu
CREATE TABLE table_24632 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT COUNT("Position") FROM table_24632 WHERE "Avg. Start" = '23.7'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '012-169'
eicu
CREATE TABLE table_62523 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Fiji's lowest total?
SELECT MIN("Total") FROM table_62523 WHERE "Country" = 'fiji'
wikisql
CREATE TABLE table_25530 ( "Name" text, "Platform" text, "License" text, "Windows builders" text, "Java builders" text, "Other builders" text, "SCM system" text, "Notification" text, "IDE Integration" text, "Other Integration" text ) -- Using valid SQLite, answer the following ...
SELECT COUNT("SCM system") FROM table_25530 WHERE "Windows builders" = 'NAnt, Visual Studio'
wikisql
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE EMPLOYEE...
SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*) DESC
nvbench