instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_20704243_6 ( title VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which episode aired on august19,2012?
SELECT title FROM table_20704243_6 WHERE original_air_date = "August19,2012"
sql_create_context
CREATE TABLE table_27721131_2 ( high_rebounds VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's in the high rebounds in the verizon center 9,263 location attendance?
SELECT high_rebounds FROM table_27721131_2 WHERE location_attendance = "Verizon Center 9,263"
sql_create_context
CREATE TABLE table_train_26 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "allergy_to_penicillin" bool, "active_infection" bool, "allergy_to_cephalosporin" bool, "receiving_anticoagulants" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following ...
SELECT * FROM table_train_26 WHERE allergy_to_penicillin = 1 OR allergy_to_cephalosporin = 1
criteria2sql
CREATE TABLE table_35291 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the winning score of the tournament on 16 May 1993?
SELECT "Winning score" FROM table_35291 WHERE "Date" = '16 may 1993'
wikisql
CREATE TABLE table_27756164_2 ( date VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the Roy Hibbert (27) did the high points?
SELECT date FROM table_27756164_2 WHERE high_points = "Roy Hibbert (27)"
sql_create_context
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.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter
nvbench
CREATE TABLE table_204_135 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number ) -- Using valid SQLite, answer the following quest...
SELECT "club" FROM table_204_135 WHERE "losses" > 21
squall
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "DIVORCED" AND prescriptions.route = "IV"
mimicsql_data
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(zzmzjzjlb.ZZYSGH) 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 person_info.XM = '张嘉惠' AND zzmzjzjlb.JZKSRQ BETWEEN '2005-11-03' AND '2007-09-11' UNION SELECT COUNT(fz...
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number...
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6134') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2103-07' ORDER BY patient.unitadmittime DESC LIMIT ...
eicu
CREATE TABLE table_48972 ( "Player" text, "Country" text, "Year(s) won" text, "Total" text, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has a total of 158/
SELECT "Player" FROM table_48972 WHERE "Total" = '158'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT DOSE_FORM, SPEC FROM t_kc22 WHERE MED_CLINIC_ID = '30755778025' AND SOC_SRT_DIRE_NM = '奥卡西平片(薄膜衣)'
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, s...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE table_2668367_21 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the distrct for thomas wilson
SELECT district FROM table_2668367_21 WHERE incumbent = "Thomas Wilson"
sql_create_context
CREATE TABLE table_17453 ( "Pick #" real, "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. -- what college has nhl team chicago black hawks?
SELECT "College/junior/club team" FROM table_17453 WHERE "NHL team" = 'Chicago Black Hawks'
wikisql
CREATE TABLE table_name_16 ( population__2010_census_ INTEGER, administrative_division VARCHAR, area__km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the sum of the population in 2010 for the division of japeri with an area of 82.9 squared k...
SELECT SUM(population__2010_census_) FROM table_name_16 WHERE administrative_division = "japeri" AND area__km²_ < 82.9
sql_create_context
CREATE TABLE table_name_20 ( country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2013 press freedom index of the country Egypt?
SELECT 2013 AS _press_freedom_index FROM table_name_20 WHERE country = "egypt"
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '陈雅惠' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLIN...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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.expire_flag = "0" AND diagnoses.short_title = "Cl skul base fx-coma NOS"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
SELECT wdmzjzjlb.JZZDBM, wdmzjzjlb.JZZDSM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '69348543973' UNION SELECT bdmzjzjlb.JZZDBM, bdmzjzjlb.JZZDSM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '69348543973'
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.days_stay = "15"
mimicsql_data
CREATE TABLE table_name_67 ( decile VARCHAR, authority VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Decile has State Authority and Raumati South Area?
SELECT decile FROM table_name_67 WHERE authority = "state" AND area = "raumati south"
sql_create_context
CREATE TABLE table_57503 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronze medals were won when the total was larger than 2 and the more than 2 gold me...
SELECT SUM("Bronze") FROM table_57503 WHERE "Total" > '2' AND "Gold" > '2'
wikisql
CREATE TABLE table_name_99 ( place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place did Keith Clearwater get?
SELECT place FROM table_name_99 WHERE player = "keith clearwater"
sql_create_context
CREATE TABLE table_39459 ( "Year" real, "Class" text, "Team" text, "Machine" text, "Points" real, "Rank" text, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What class has nsr250 as the machine, with points greater than 97?
SELECT "Class" FROM table_39459 WHERE "Machine" = 'nsr250' AND "Points" > '97'
wikisql
CREATE TABLE table_68600 ( "Outcome" text, "Year" real, "Tournament" text, "Partner" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament has an opponent jung jae-sung lee yong-dae?
SELECT "Tournament" FROM table_68600 WHERE "Opponent" = 'jung jae-sung lee yong-dae'
wikisql
CREATE TABLE table_35508 ( "Dish" text, "Callsign" text, "Network" text, "Resolution" text, "City of License" text, "Official Website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the resolution of the network Carismatv?
SELECT "Resolution" FROM table_35508 WHERE "Network" = 'carismatv'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-70851') AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_1594 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the parish where the area is 508.30?
SELECT COUNT("Official Name") FROM table_1594 WHERE "Area km 2" = '508.30'
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6176731' AND gwyjzb.IN_HOSP_DATE BETWEEN '2009-12-18' AND '2011-08-05' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6176731' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2009-12-18' AND '2011-08-05' AND fgwyjzb.CLINIC_TY...
css
CREATE TABLE table_12564 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total attendance when Stourbridge is the home team?
SELECT COUNT("Attendance") FROM table_12564 WHERE "Home team" = 'stourbridge'
wikisql
CREATE TABLE table_name_98 ( original_canadian_air_date VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Original Canadian air-date that was directed by Michael Tolkin?
SELECT original_canadian_air_date FROM table_name_98 WHERE director = "michael tolkin"
sql_create_context
CREATE TABLE table_name_43 ( record VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record at WEC 24?
SELECT record FROM table_name_43 WHERE event = "wec 24"
sql_create_context
CREATE TABLE table_8578 ( "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. -- Who has...
SELECT "High assists" FROM table_8578 WHERE "Game" = '72'
wikisql
CREATE TABLE table_19294812_2 ( team_1 VARCHAR, team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is team 1 when team 2 is koper?
SELECT team_1 FROM table_19294812_2 WHERE team_2 = "Koper"
sql_create_context
CREATE TABLE table_name_1 ( player VARCHAR, country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Player, when Country is United States, and when Score is 70-72-70=212?
SELECT player FROM table_name_1 WHERE country = "united states" AND score = 70 - 72 - 70 = 212
sql_create_context
CREATE TABLE table_16904 ( "number" real, "date of debut" text, "name" text, "date of birth" text, "number of caps" real, "number of goals" real, "date of death\u2020" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of Henk ...
SELECT "date of death\u2020" FROM table_16904 WHERE "name" = 'Henk Hordijk'
wikisql
CREATE TABLE table_26662 ( "Province, Community" text, "Contestant" text, "Age" real, "Height" text, "Hometown" text, "Geographical Regions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How old is the person with the height of m (ft 3 4 in)?
SELECT "Age" FROM table_26662 WHERE "Height" = 'm (ft 3⁄4 in)'
wikisql
CREATE TABLE table_80429 ( "Season" text, "Team Name" text, "Games" real, "Losses" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the sum of points for the 1963 season when there are more than 30 games?
SELECT SUM("Points") FROM table_80429 WHERE "Season" = '1963' AND "Games" > '30'
wikisql
CREATE TABLE table_49639 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real, "2000 result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of other candidates did the ...
SELECT MAX("Others#") FROM table_49639 WHERE "Kerry%" = '52.1%'
wikisql
CREATE TABLE table_name_87 ( league VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what League is the Reed School?
SELECT league FROM table_name_87 WHERE school = "reed"
sql_create_context
CREATE TABLE Staff ( staff_id INTEGER, staff_address_id INTEGER, nickname VARCHAR(80), first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), date_of_birth DATETIME, date_joined_staff DATETIME, date_left_staff DATETIME ) CREATE TABLE Customers ( customer_id INTE...
SELECT date_of_birth, COUNT(date_of_birth) FROM Customers WHERE customer_status_code = 'Good Customer'
nvbench
CREATE TABLE table_9376 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Place of t1, and a Player of scott simpson?
SELECT COUNT("Score") FROM table_9376 WHERE "Place" = 't1' AND "Player" = 'scott simpson'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( la...
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '018-81471' ORDER BY patient.hospitaldischargetime LIMIT 1
eicu
CREATE TABLE table_54128 ( "Date of Issue" text, "Denomination" text, "Design" text, "Paper Type" text, "First Day Cover Cancellation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Denomination listed for the Date of Issue 12 April 2005?...
SELECT "Denomination" FROM table_54128 WHERE "Date of Issue" = '12 april 2005'
wikisql
CREATE TABLE table_203_131 ( id number, "pos." number, "car #" number, "driver" text, "make" text, "team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the number of cars finishing in the top ten for braun racing .
SELECT COUNT(*) FROM table_203_131 WHERE "team" = 'braun racing'
squall
CREATE TABLE table_2507 ( "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 provi...
SELECT "Avg. Finish" FROM table_2507 WHERE "Year" = '2007'
wikisql
CREATE TABLE table_25748 ( "#" text, "Original title" text, "Directed by" text, "Written by" text, "Original air dates" text, "Prod. code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the written by for prod code being 206
SELECT "Written by" FROM table_25748 WHERE "Prod. code" = '206'
wikisql
CREATE TABLE table_43108 ( "Team" text, "Dance" text, "Music" text, "Points jury" text, "Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Music for Team anna guzik & rafa kami ski that has a Points Jury of 24 (7,5,6,6)?
SELECT "Music" FROM table_43108 WHERE "Team" = 'anna guzik & rafał kamiński' AND "Points jury" = '24 (7,5,6,6)'
wikisql
CREATE TABLE table_203_793 ( id number, "#" 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 date of the last game ?
SELECT "date" FROM table_203_793 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_5401 ( "Score" real, "Opposition" text, "Venue" text, "City" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opposition has a Year smaller than 1977, and a City of manchester?
SELECT "Opposition" FROM table_5401 WHERE "Year" < '1977' AND "City" = 'manchester'
wikisql
CREATE TABLE table_3270 ( "Episode Number" text, "Episode" text, "Original Airdate" text, "Rating" text, "Share" text, "Rating/Share (18\u201349)" text, "Viewers (millions)" text, "Weekly Rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Rating/Share (18\u201349)" FROM table_3270 WHERE "Episode" = 'Week 6, Part 1'
wikisql
CREATE TABLE table_51345 ( "Year" real, "Award" text, "Category" text, "Type" text, "Title" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What award was won in the best sound category for the exorcist before 1998?
SELECT "Award" FROM table_51345 WHERE "Year" < '1998' AND "Type" = 'won' AND "Category" = 'best sound' AND "Title" = 'the exorcist'
wikisql
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '27333560' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '963819') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '27333560' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE...
css
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY Carrier DESC
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_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(25...
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT * 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 = '32609286' AND hz_info.YLJGDM = '6643812' AND NOT zyjzjlb.JZKSMC LIKE '%其它%'
css
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )...
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 DIEGO' AND CITY_2....
atis
CREATE TABLE table_78242 ( "Model" text, "Build year" text, "Total produced" real, "Wheel arrangement" text, "Prime mover" text, "Power output" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is the smallest Total produced with a model of F...
SELECT MIN("Total produced") FROM table_78242 WHERE "Model" = 'fm h-15-44'
wikisql
CREATE TABLE table_name_26 ( record VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Record that has the Home of ny islanders?
SELECT record FROM table_name_26 WHERE home = "ny islanders"
sql_create_context
CREATE TABLE table_11677100_12 ( school VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school did the catcher attend?
SELECT school FROM table_11677100_12 WHERE position = "Catcher"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId numb...
SELECT P.Id AS "post_link" FROM Posts AS P INNER JOIN Users AS U ON P.OwnerUserId = U.Id AND P.Body LIKE '%img src%' AND NOT P.Body LIKE '%imgur%'
sede
CREATE TABLE table_name_11 ( votes VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the Votes for the Song by Artist Filipa Batista?
SELECT votes FROM table_name_11 WHERE artist = "filipa batista"
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.age < "54" AND lab.label = "Specific Gravity"
mimicsql_data
CREATE TABLE employees ( first_name VARCHAR, last_name VARCHAR, id VARCHAR ) CREATE TABLE customers ( support_rep_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the full name of employee who supported the most number of customers.
SELECT T1.first_name, T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_32 ( attendance VARCHAR, visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance at the game where San Jose was the visitor on May 4?
SELECT attendance FROM table_name_32 WHERE visitor = "san jose" AND date = "may 4"
sql_create_context
CREATE TABLE table_256862_1 ( finish VARCHAR, entries VARCHAR, winning_yacht VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of finishes for 15 entries 15 and l'esprit d'equipe
SELECT COUNT(finish) FROM table_256862_1 WHERE entries = "15" AND winning_yacht = "L'Esprit d'Equipe"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '2003934' AND jybgb.BGRQ BETWEEN '2012-08-24' AND '2015-07-31' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 12 UNION SELECT jybgb.KSBM FROM bdmzjzjlb ...
css
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, "Home Town" text ) CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID int, Date text, Year real, Location text, Country text, Killed int, Injured int ) -- Using valid SQLite, answer the...
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE table_33344 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance of the game in week 6?
SELECT "Attendance" FROM table_33344 WHERE "Week" = '6'
wikisql
CREATE TABLE table_name_38 ( crowd INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest crowd for a game when Melbourne is the home team?
SELECT MIN(crowd) FROM table_name_38 WHERE home_team = "melbourne"
sql_create_context
CREATE TABLE table_203_364 ( id number, "year" number, "driver" text, "nation of citizenship" text, "racing series" text, "type of vehicle" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- jimmy johnson won how many consecutive espy awards ?
SELECT COUNT(*) FROM table_203_364 WHERE "driver" = 'jimmie johnson'
squall
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
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 = 'BALTIMORE' AND date_day.day_number = 20 AND date_day.month_number = 1 AND...
atis
CREATE TABLE table_26250199_1 ( theme VARCHAR, episode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In episode Top 16 (8 Men), what are the themes?
SELECT theme FROM table_26250199_1 WHERE episode = "Top 16 (8 Men)"
sql_create_context
CREATE TABLE table_name_84 ( order VARCHAR, species_authority VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What order has the Species Authority of hydrochaeris hydrochaeris (linnaeus, 1766)?
SELECT order FROM table_name_84 WHERE species_authority = "hydrochaeris hydrochaeris (linnaeus, 1766)"
sql_create_context
CREATE TABLE table_name_35 ( extra_points INTEGER, field_goals VARCHAR, touchdowns VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many extra points are there that Herrnstein had with less than 2 touchdowns and less than 0 field go...
SELECT AVG(extra_points) FROM table_name_35 WHERE touchdowns < 2 AND player = "herrnstein" AND field_goals < 0
sql_create_context
CREATE TABLE table_69599 ( "Event" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real, "Ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Gold has a Silver greater than 30 and a Total less than 107?
SELECT "Gold" FROM table_69599 WHERE "Silver" > '30' AND "Total" < '107'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, ...
SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_name_42 ( type VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Type has the Artist of Hiroyuki Takami?
SELECT type FROM table_name_42 WHERE artist = "hiroyuki takami"
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 COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-198713')) AND STRFTIME('%y-%m', allergy.allergytime) >= '2105-06'
eicu
CREATE TABLE table_name_4 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Venue on November 26?
SELECT venue FROM table_name_4 WHERE date = "november 26"
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 jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZL...
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '77333677' AND t_kc22.STA_DATE BETWEEN '2008-05-03' AND '2011-05-06' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_29793 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code(s)" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Written by" FROM table_29793 WHERE "Production code(s)" = '225560'
wikisql
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 COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-03'
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 COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '1540750' AND wdmzjzjlb.JZKSRQ BETWEEN '2004-04-22' AND '2008-12-14' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '1540750' AND bdmzjzjlb.JZKSRQ BETWEEN '2004-04-22' AND '2008-12-14' AND bdmzjzjlb.ZSEBZ > 0
css
CREATE TABLE table_10015132_14 ( no VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which number was Patrick O'Bryant?
SELECT no FROM table_10015132_14 WHERE player = "Patrick O'Bryant"
sql_create_context
CREATE TABLE table_name_98 ( attendance INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Attendance in a match which scores 0:0 - 4:1 (pen)
SELECT AVG(attendance) FROM table_name_98 WHERE score = "0:0 - 4:1 (pen)"
sql_create_context
CREATE TABLE table_80096 ( "Round" text, "Date" text, "Opponent" text, "Venue" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was the game held at Firhill against AYR United?
SELECT "Date" FROM table_80096 WHERE "Venue" = 'firhill' AND "Opponent" = 'ayr united'
wikisql
CREATE TABLE table_name_16 ( points INTEGER, performer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total sum of points for songs performed by Partners in Crime?
SELECT SUM(points) FROM table_name_16 WHERE performer = "partners in crime"
sql_create_context
CREATE TABLE table_name_61 ( date_of_birth VARCHAR, pos VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of Birth of the CB Player with a Height of m (ft 4in)?
SELECT date_of_birth FROM table_name_61 WHERE pos = "cb" AND height = "m (ft 4in)"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
(SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '53751020' AND jybgb.BGRQ BETWEEN '2000-10-30' AND '2002-02-06') U...
css
CREATE TABLE table_name_39 ( lost VARCHAR, points VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Lost has Points smaller than 12, and a Drawn larger than 1?
SELECT COUNT(lost) FROM table_name_39 WHERE points < 12 AND drawn > 1
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TA...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '16:30' AND course.course_id = course_offering.course_id AND course.department = 'PHYSIOL' AND course.number = 545 AND semester.semester = 'WN' A...
advising
CREATE TABLE table_name_10 ( circuit VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Circuit has an Event of international procar meeting?
SELECT circuit FROM table_name_10 WHERE event = "international procar meeting"
sql_create_context
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, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Na...
SELECT Id, TagName FROM Tags LIMIT 90
sede
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id...
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7241)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' ...
mimic_iii
CREATE TABLE table_29400 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number o...
SELECT COUNT("Points for") FROM table_29400 WHERE "Played" = 'Played'
wikisql
CREATE TABLE table_name_25 ( opponent VARCHAR, week VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the Giants play before week 7 in Tulane Stadium?
SELECT opponent FROM table_name_25 WHERE week < 7 AND game_site = "tulane stadium"
sql_create_context