instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area...
SELECT Grape, COUNT(Grape) FROM wine GROUP BY Grape ORDER BY COUNT(Grape)
nvbench
CREATE TABLE table_name_52 ( lunar_landing_site VARCHAR, duration_on_lunar_surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the landing site when the duration on the lunar surface was 21:31?
SELECT lunar_landing_site FROM table_name_52 WHERE duration_on_lunar_surface = "21:31"
sql_create_context
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY COUNT(roomName) DESC
nvbench
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.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "9258"
mimicsql_data
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY diagnoses_icd....
mimic_iii
CREATE TABLE table_71340 ( "Year" real, "Title" text, "Role" text, "Language" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What language is spoken after 2007 for the role of urvashi mathur?
SELECT "Language" FROM table_71340 WHERE "Year" > '2007' AND "Role" = 'urvashi mathur'
wikisql
CREATE TABLE table_32107 ( "Venue" text, "City" text, "First international" text, "Last international" text, "Played" real, "Draw" real, "Lost" real, "Average attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average...
SELECT AVG("Played") FROM table_32107 WHERE "City" = 'belgrade' AND "Average attendance" > '26,222'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY
nvbench
CREATE TABLE table_39855 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Interview subject was on a Date that is 11-92?
SELECT "Interview subject" FROM table_39855 WHERE "Date" = '11-92'
wikisql
CREATE TABLE table_35805 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent is on October of 29?
SELECT "Opponent" FROM table_35805 WHERE "October" = '29'
wikisql
CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE enzyme ( id number, name text, location text, product text, chromosom...
SELECT COUNT(*) FROM enzyme
spider
CREATE TABLE table_6589 ( "Release date" text, "Length" text, "Director(s)" text, "Character name" text, "Character type" text, "Leading lady" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the film that had phyllis welch as the lea...
SELECT "Director(s)" FROM table_6589 WHERE "Leading lady" = 'phyllis welch'
wikisql
CREATE TABLE table_64722 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent was on July 21, 2008?
SELECT "Opponent" FROM table_64722 WHERE "Date" = 'july 21, 2008'
wikisql
CREATE TABLE table_16729930_11 ( frequency VARCHAR, part_number_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the frequency for part number of ac80566ue041dw
SELECT frequency FROM table_16729930_11 WHERE part_number_s_ = "AC80566UE041DW"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13841 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'zidovudine' ORDER BY prescriptions.startdate LIMIT ...
mimic_iii
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalpe...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622')) AND microlab.culturesite = 'bronchial lavage' AND DATETIME(microl...
eicu
CREATE TABLE table_name_33 ( mecha VARCHAR, bird_uniform VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mecha with a condor bird uniform?
SELECT mecha FROM table_name_33 WHERE bird_uniform = "condor"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2023" AND procedures.short_title = "Cardiopulm resuscita NOS"
mimicsql_data
CREATE TABLE table_38876 ( "Year" text, "1801" text, "1811" text, "1821" text, "1841" text, "1851" text, "1861" text, "1871" text, "1881" text, "1891" text, "1901" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 1821 ...
SELECT "1821" FROM table_38876 WHERE "1861" = '3733'
wikisql
CREATE TABLE table_name_28 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is Greg Norman from?
SELECT country FROM table_name_28 WHERE player = "greg norman"
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Polymyalgia rheumatica" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
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 wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '袁幼怡' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2016-01-2...
css
CREATE TABLE table_test_6 ( "id" int, "scr" int, "anemia" bool, "blood_hemoglobin" int, "bleeding" int, "hemorrhagic_diseases" bool, "stroke" bool, "blood_platelet_counts" int, "trauma" bool, "renal_disease" bool, "hematocrit_hct" float, "hepatic_disease" bool, "polyg...
SELECT * FROM table_test_6 WHERE anemia = 1
criteria2sql
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 JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_77765 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What driver has a Time/Retired of 2:16:38.0?
SELECT "Driver" FROM table_77765 WHERE "Time/Retired" = '2:16:38.0'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'imatinib mesylate' AND STRFTIME('%y', prescriptions.startdate) >= '2104'
mimic_iii
CREATE TABLE table_43517 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Justin Wilson has what has his best time?
SELECT "Best" FROM table_43517 WHERE "Name" = 'justin wilson'
wikisql
CREATE TABLE table_53856 ( "Rank" real, "Club 1" text, "Seasons" real, "Spells" real, "Played 2" real, "Drawn" real, "Lost" real, "Goals" text, "Points 3" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons have goals of ...
SELECT COUNT("Seasons") FROM table_53856 WHERE "Goals" = '261-338' AND "Lost" > '111'
wikisql
CREATE TABLE table_name_67 ( quantity VARCHAR, seats VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the quantity when the seats number was 16 and the class was kss 1913?
SELECT quantity FROM table_name_67 WHERE seats = 16 AND class = "kss 1913"
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.MED_AMOUT) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '云承平' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-08-03' AND '2015-04-30' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PE...
css
CREATE TABLE accounts ( account_id number, customer_id number, account_name text, other_account_details text ) CREATE TABLE customers_cards ( card_id number, customer_id number, card_type_code text, card_number text, date_valid_from time, date_valid_to time, other_card_detai...
SELECT COUNT(*) FROM customers_cards WHERE card_type_code = "Debit"
spider
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.discharge_location, demographic.dischtime FROM demographic WHERE demographic.name = "Betty Campbell"
mimicsql_data
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTME...
SELECT LAST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC
nvbench
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_na...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CI...
atis
CREATE TABLE pilot ( POSITION VARCHAR, Team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the positions and teams of pilots?
SELECT POSITION, Team FROM pilot
sql_create_context
CREATE TABLE table_name_81 ( grid INTEGER, time_retired VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the average grid that has a time/retired piston and laps smaller than 15?
SELECT AVG(grid) FROM table_name_81 WHERE time_retired = "piston" AND laps < 15
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, Exp...
SELECT P.Id, P.Title, P.ViewCount FROM Posts AS P, PostTypes AS PT WHERE P.PostTypeId = PT.Id AND PT.Name = 'Question' ORDER BY P.ViewCount DESC LIMIT 10
sede
CREATE TABLE table_78719 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Venue, when Date is 'January 6, 1995'?
SELECT "Venue" FROM table_78719 WHERE "Date" = 'january 6, 1995'
wikisql
CREATE TABLE table_11062 ( "Name" text, "Bodyweight" real, "Snatch" real, "Clean & jerk" real, "Total (kg)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the biggest clean and jerk number when snatch was less than 150 and the bodyweight was...
SELECT MAX("Clean & jerk") FROM table_11062 WHERE "Snatch" < '150' AND "Bodyweight" > '93.13'
wikisql
CREATE TABLE table_name_80 ( language VARCHAR, service VARCHAR, network VARCHAR, origin_of_programming VARCHAR, genre VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which language has Programming from India, general genre, a network of ptc punjab...
SELECT language FROM table_name_80 WHERE origin_of_programming = "india" AND genre = "general" AND network = "ptc punjabi" AND service = "bell fibe tv"
sql_create_context
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_NM = '魏阳舒' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6027.88)
css
CREATE TABLE table_54899 ( "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. -- On what date did the away team have a score of 9...
SELECT "Date" FROM table_54899 WHERE "Away team score" = '9.10 (64)'
wikisql
CREATE TABLE table_name_71 ( year INTEGER, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest year the world championships were held in Thun?
SELECT MAX(year) FROM table_name_71 WHERE place = "thun"
sql_create_context
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.discharge_location = "HOME" AND diagnoses.short_title = "Hx of breast malignancy"
mimicsql_data
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
SELECT Grape, COUNT(Grape) FROM wine WHERE Price > 100 GROUP BY Grape
nvbench
CREATE TABLE table_17722 ( "Year" real, "Population (Region total)" real, "Population (Stanthorpe)" real, "Population (Warwick)" real, "Population (Allora)" real, "Population (Glengallan)" real, "Population (Rosenthal)" real ) -- Using valid SQLite, answer the following questions for the t...
SELECT MAX("Population (Stanthorpe)") FROM table_17722
wikisql
CREATE TABLE table_name_36 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Collingwood play?
SELECT date FROM table_name_36 WHERE home_team = "collingwood"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '2003934' AND jybgb.BGRQ BETWEEN '2012-08-24' AND '2015-07-31' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 12) AS T
css
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE...
SELECT COUNT(DISTINCT flight.flight_id) FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'WASHINGTON' AND flight.airline_code = 'US' AND flight.from_airport = airport_service.airport_code
atis
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
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 WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Morbid obesity"
mimicsql_data
CREATE TABLE table_18163 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which incumbent was first elected in 1984?
SELECT "Incumbent" FROM table_18163 WHERE "First elected" = '1984'
wikisql
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 (SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6009') AND NOT patient.unitdischargeti...
eicu
CREATE TABLE table_name_28 ( viewers__millions_ INTEGER, episode__number VARCHAR, share VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of million viewers that watched an episode before episode 11 with a share of 4?
SELECT AVG(viewers__millions_) FROM table_name_28 WHERE episode__number < 11 AND share = "4"
sql_create_context
CREATE TABLE table_30475 ( "Club" text, "Location" text, "Home Venue" text, "Capacity" text, "Founded" real, "Years Active" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How long has the team who owns North Shore Events Centre Vector Arena been...
SELECT "Years Active" FROM table_30475 WHERE "Home Venue" = 'North Shore Events Centre Vector Arena'
wikisql
CREATE TABLE table_6225 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Game site of miami orange bowl, and a Attendance larger than 49,754 happened on wha...
SELECT MAX("Week") FROM table_6225 WHERE "Game site" = 'miami orange bowl' AND "Attendance" > '49,754'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Endovascular (total) embolization or occlusion of head and neck vessels"
mimicsql_data
CREATE TABLE table_41031 ( "Tournament" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "Win %" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "2002" FROM table_41031 WHERE "2009" = '2r'
wikisql
CREATE TABLE table_15482 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Joined" real, "Nickname" text, "Colors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which type of institution is in Amherst, MA?
SELECT "Type" FROM table_15482 WHERE "Location" = 'amherst, ma'
wikisql
CREATE TABLE table_26004 ( "Round" real, "Finishing Date" text, "Rally Name" text, "Rally Base" text, "Surface" text, "Support Category" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the rally base for 5 round
SELECT "Rally Base" FROM table_26004 WHERE "Round" = '5'
wikisql
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7336183' GROUP BY qtb.MED_ORG_DEPT_CD UNION SELECT gyb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_...
css
CREATE TABLE table_204_584 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who came in first ?
SELECT "driver" FROM table_204_584 WHERE "pos" = 1
squall
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '9361498' AND BGRQ BETWEEN '2000-04-17' AND '2017-11-26' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) DESC
css
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Student...
SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY subject_name DESC
nvbench
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_204_320 ( 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 bronze medals did south korea and india receive , combin...
SELECT SUM("bronze") FROM table_204_320 WHERE "nation" IN ('south korea', 'india')
squall
CREATE TABLE table_71617 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year with a Kurtis Kraft 500a chassis, and less than 1.5 points?
SELECT SUM("Year") FROM table_71617 WHERE "Chassis" = 'kurtis kraft 500a' AND "Points" < '1.5'
wikisql
CREATE TABLE table_name_89 ( rank VARCHAR, name VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the rank for the name of Chen Yan in a lane less than 2?
SELECT COUNT(rank) FROM table_name_89 WHERE name = "chen yan" AND lane < 2
sql_create_context
CREATE TABLE table_name_34 ( class VARCHAR, team VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the class that team Honda Britain was in with points higher than 0?
SELECT class FROM table_name_34 WHERE team = "honda britain" AND points > 0
sql_create_context
CREATE TABLE table_6907 ( "Name" text, "Years" text, "Tests" real, "Drew" real, "Lost" real, "Win percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Tests when the lost is less than 9 for sir fred allen?
SELECT COUNT("Tests") FROM table_6907 WHERE "Lost" < '9' AND "Name" = 'sir fred allen'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'E21.594' AND jyjgzbb.JCZBMC = '降钙素原' UNION SELECT jyjgzbb.CKZFWXX,...
css
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE song ( so...
SELECT g_name, rating FROM genre ORDER BY g_name
nvbench
CREATE TABLE table_name_41 ( approximate_age VARCHAR, significant_relationship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you give me the age of the Significant Relationship of Family?
SELECT approximate_age FROM table_name_41 WHERE significant_relationship = "family"
sql_create_context
CREATE TABLE table_225093_4 ( date_successor_seated VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date successor seated where Massachusetts 2nd is the district?
SELECT date_successor_seated FROM table_225093_4 WHERE district = "Massachusetts 2nd"
sql_create_context
CREATE TABLE table_204_257 ( id number, "ethnicity" text, "1926 census" text, "1939 census" text, "1959 census" text, "1970 census" text, "1979 census" text, "1989 census" text, "2007 estimate" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "ethnicity" FROM table_204_257 ORDER BY "1926 census" DESC LIMIT 1
squall
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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '褚鸿云' AND t_kc22.STA_DATE BETWEEN '2003-01-30' AND '2014-02-02' AND t_kc22.SOC_SRT_DIRE_CD = '531213708-j' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE ...
css
CREATE TABLE table_31349 ( "Country" text, "Alternante title" text, "TV Network(s)" text, "Series premiere" text, "Series finale" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which TV network had its series finale on May 7, 2012?
SELECT "TV Network(s)" FROM table_31349 WHERE "Series finale" = 'May 7, 2012'
wikisql
CREATE TABLE table_204_1 ( id number, "season" text, "north" text, "south" text, "east" text, "west" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of seasons covered in the table ?
SELECT COUNT("season") FROM table_204_1
squall
CREATE TABLE table_name_23 ( third VARCHAR, home VARCHAR, skip VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the third on the team from Madison, Wisconsin that has Craig Brown as skip?
SELECT third FROM table_name_23 WHERE home = "madison, wisconsin" AND skip = "craig brown"
sql_create_context
CREATE TABLE table_name_47 ( name VARCHAR, license VARCHAR, platform VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which name has a License of gpl, and a Platform of windows?
SELECT name FROM table_name_47 WHERE license = "gpl" AND platform = "windows"
sql_create_context
CREATE TABLE table_name_21 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record of the match on 2009-07-18?
SELECT record FROM table_name_21 WHERE date = "2009-07-18"
sql_create_context
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
SELECT name, id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12 ORDER BY id
nvbench
CREATE TABLE table_name_53 ( surface VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which type of surface do Amer Delic Robert Kendrick's opponents have?
SELECT surface FROM table_name_53 WHERE opponents = "amer delic robert kendrick"
sql_create_context
CREATE TABLE table_name_42 ( city VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city has a venue of the Arco Arena?
SELECT city FROM table_name_42 WHERE venue = "arco arena"
sql_create_context
CREATE TABLE table_name_9 ( team VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team has a Score of 108-105 (ot)?
SELECT team FROM table_name_9 WHERE score = "108-105 (ot)"
sql_create_context
CREATE TABLE table_56773 ( "Date" text, "Opponents" text, "Score" text, "Competition" text, "Match Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the competition with a score of 1-5?
SELECT "Competition" FROM table_56773 WHERE "Score" = '1-5'
wikisql
CREATE TABLE table_78714 ( "Model" text, "First Year" real, "Distribution" text, "Engine" text, "Displacement cc" real, "Power hp (kW)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest First Year, when Model is 'Quattroporte (2....
SELECT MIN("First Year") FROM table_78714 WHERE "Model" = 'quattroporte (2.8)'
wikisql
CREATE TABLE table_61755 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MAX("Losses") FROM table_61755 WHERE "Goals for" = '45' AND "Played" < '38'
wikisql
CREATE TABLE table_204_539 ( id number, "date" text, "name" text, "moving from" text, "moving to" text, "fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many dates are listed as free ?
SELECT COUNT("date") FROM table_204_539 WHERE "fee" = 'free'
squall
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.admission_type = "EMERGENCY" AND diagnoses.icd9_code = "E8798"
mimicsql_data
CREATE TABLE table_25016824_2 ( eliminated VARCHAR, immunity VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was eliminated when immunity went to kent (j rgen)?
SELECT eliminated FROM table_25016824_2 WHERE immunity = "Kent (Jürgen)"
sql_create_context
CREATE TABLE table_name_85 ( won__pg_ INTEGER, goals_conceded__gc_ VARCHAR, played__pj_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of games won where less than 21 games were conceded and less than 18 games were actually pla...
SELECT MAX(won__pg_) FROM table_name_85 WHERE goals_conceded__gc_ < 21 AND played__pj_ < 18
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-39356') AND NOT patient.unitdischargetime IS NU...
eicu
CREATE TABLE table_58572 ( "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 was Richmond's highest attendance?
SELECT MAX("Crowd") FROM table_58572 WHERE "Home team" = 'richmond'
wikisql
CREATE TABLE buildings ( id int, name text, City text, Height int, Stories int, Status text ) CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value_billion text ) ...
SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry ORDER BY Industry DESC
nvbench
CREATE TABLE table_41004 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Away Team, when Tie No is 4?
SELECT "Away team" FROM table_41004 WHERE "Tie no" = '4'
wikisql
CREATE TABLE table_63236 ( "Engine" text, "Production" text, "Transmission" text, "Power" text, "Torque" text, "Acceleration 0\u2013100km/h (0\u201362mph)" text, "Top Speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the producti...
SELECT "Production" FROM table_63236 WHERE "Engine" = '2.7l' AND "Acceleration 0\u2013100km/h (0\u201362mph)" = '8.5 s'
wikisql
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '74604701' AND t_kc21.MED_SER_ORG_NO = '0359926' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%使用%'
css