instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_84 ( mark VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Mark has an Athlete of tatyana lebedeva?
SELECT mark FROM table_name_84 WHERE athlete = "tatyana lebedeva"
sql_create_context
CREATE TABLE procedures_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 TABLE d_icd_procedures ( row_id number, icd9_code text, short_title te...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'rt/left heart card ca...
mimic_iii
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb 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 AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '俞...
css
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 * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '云炎彬' AND gwyjzb.MED_SER_ORG_NO = '1632814' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%前%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '云炎彬' AND fgwyjzb.MED_SER_ORG_NO = '1632814' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%前%'
css
CREATE TABLE table_name_77 ( opponent VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent for the game that had 90,287 in attendance?
SELECT opponent FROM table_name_77 WHERE attendance = "90,287"
sql_create_context
CREATE TABLE table_24807774_1 ( arabic VARCHAR, colombian VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many arabic in colobians is finnish
SELECT arabic FROM table_24807774_1 WHERE colombian = "Finnish"
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 jybgb.BGDH FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '21625825' AND jybgb.BGRQ BETWEEN '2002-07-09' AND '2012-...
css
CREATE TABLE table_name_30 ( home_team VARCHAR, date VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Home Team, when Date is '1 February 1984', and when Tie No is '5'?
SELECT home_team FROM table_name_30 WHERE date = "1 february 1984" AND tie_no = "5"
sql_create_context
CREATE TABLE table_name_45 ( time VARCHAR, record VARCHAR, round VARCHAR, method VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Time, when Round is '3', when Method is 'Decision (unanimous)', and when Record is '7-3'?
SELECT time FROM table_name_45 WHERE round = 3 AND method = "decision (unanimous)" AND record = "7-3"
sql_create_context
CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE ...
SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50
spider
CREATE TABLE table_21501565_1 ( song_choice VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With theme the Year They Were Born, what is the song of choice?
SELECT song_choice FROM table_21501565_1 WHERE theme = "Year They Were Born"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-3992')) AND treatment.treatmentname = 'ferrous iron compound' AND STRFTIME('...
eicu
CREATE TABLE table_55291 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyres" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Driver has an Entrant of Arrows Racing Team and Rounds 1...
SELECT "Driver" FROM table_55291 WHERE "Entrant" = 'arrows racing team' AND "Rounds" = '1-3'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT meter_300, ID FROM swimmer
nvbench
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.label = "Red Blood Cells"
mimicsql_data
CREATE TABLE table_name_91 ( year INTEGER, nominee_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- That is the total year that Neal Baer is a nominee?
SELECT SUM(year) FROM table_name_91 WHERE nominee_s_ = "neal baer"
sql_create_context
CREATE TABLE table_32820 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff" text, "Game site" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has a Game site of bye?
SELECT "Date" FROM table_32820 WHERE "Game site" = 'bye'
wikisql
CREATE TABLE table_48695 ( "Year" real, "Character" text, "Title" text, "Author" text, "Artist" text, "Imprint" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the author of Bludgeoning Angel Dokuro-Chan?
SELECT "Author" FROM table_48695 WHERE "Title" = 'bludgeoning angel dokuro-chan'
wikisql
CREATE TABLE table_name_37 ( location VARCHAR, date VARCHAR, rank VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Rank smaller than 5, and a Time larger than 10.7, and a Date of 10 july 2009 has what location?
SELECT location FROM table_name_37 WHERE rank < 5 AND time > 10.7 AND date = "10 july 2009"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
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 = "Chronic pulmonary heart disease, unspecified"
mimicsql_data
CREATE TABLE table_31176 ( "Player" text, "Starts" real, "Cuts made" real, "Best finish" text, "Money list rank" real, "Earnings ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the best finish record for Sean O'hair?
SELECT "Best finish" FROM table_31176 WHERE "Player" = 'Sean O''Hair'
wikisql
CREATE TABLE table_name_7 ( ihsaa_class VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the IHSAA Class Football if the panthers are the mascot?
SELECT ihsaa_class AS Football FROM table_name_7 WHERE mascot = "panthers"
sql_create_context
CREATE TABLE table_72012 ( "Season" text, "Level" text, "Division" text, "Section" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which section has a level of Tier 3, is in the 6th position, and is in the 1937-38 season?
SELECT "Section" FROM table_72012 WHERE "Level" = 'tier 3' AND "Position" = '6th' AND "Season" = '1937-38'
wikisql
CREATE TABLE table_24669 ( "Year (Ceremony)" text, "English title" text, "Spanish title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was Viva Cuba submitted?
SELECT "Year (Ceremony)" FROM table_24669 WHERE "Spanish title" = 'Viva Cuba'
wikisql
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 JYKSBM, JYKSMC FROM jybgb WHERE JZLSH = '32751875737'
css
CREATE TABLE table_13849 ( "Elector" text, "Place of birth" text, "Cardinalatial title" text, "Elevated" text, "Elevator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place of birth when the elevator is Nicholas IV, and elector is Napo...
SELECT "Place of birth" FROM table_13849 WHERE "Elevator" = 'nicholas iv' AND "Elector" = 'napoleone orsini frangipani'
wikisql
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(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_55273 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college has a linebacker from Lessburg High School?
SELECT "College" FROM table_55273 WHERE "Position" = 'linebacker' AND "School" = 'lessburg high school'
wikisql
CREATE TABLE table_name_47 ( local_location VARCHAR, resident_country VARCHAR, mission VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the local location that has senegal as the resident county, and a mission of mali?
SELECT local_location FROM table_name_47 WHERE resident_country = "senegal" AND mission = "mali"
sql_create_context
CREATE TABLE table_69959 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the mixed doubles in 1957 when judy devlin...
SELECT "Mixed doubles" FROM table_69959 WHERE "Women's singles" = 'judy devlin' AND "Year" = '1957'
wikisql
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text...
SELECT COUNT(DISTINCT flight.flight_id) FROM fare, flight, flight_fare WHERE fare.fare_basis_code = 'F' AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = 'AA' AND flight.flight_id = flight_fare.flight_id
atis
CREATE TABLE artwork ( artwork_id number, type text, name text ) CREATE TABLE nomination ( artwork_id number, festival_id number, result text ) CREATE TABLE festival_detail ( festival_id number, festival_name text, chair_name text, location text, year number, num_of_aud...
SELECT name FROM artwork WHERE type <> "Program Talent Show"
spider
CREATE TABLE market ( market_id number, country text, number_cities number ) CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE TABLE film ( film_id number,...
SELECT T1.title, T2.type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.film_id = T2.film_id
spider
CREATE TABLE table_name_39 ( head_of_household VARCHAR, task_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the head of household for task number 7?
SELECT head_of_household FROM table_name_39 WHERE task_no = 7
sql_create_context
CREATE TABLE table_name_50 ( silver INTEGER, bronze VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Silver medals were won in total by all those with more than 3 bronze and exactly 16 gold?
SELECT SUM(silver) FROM table_name_50 WHERE bronze > 3 AND gold = 16
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '22200311' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2021-07-01')
css
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT Openning_year, SUM(Capacity) FROM cinema GROUP BY Openning_year ORDER BY SUM(Capacity) DESC
nvbench
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 regions ( REGION_ID decimal(5,0), ...
SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_12221135_3 ( arrival VARCHAR, operator VARCHAR, calling_at VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many trains call at Castor, Overton, Peterborough East and are operated by LNWR?
SELECT COUNT(arrival) FROM table_12221135_3 WHERE operator = "LNWR" AND calling_at = "Castor, Overton, Peterborough East"
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, Dup...
SELECT Id AS "comment_link", Text, UserId AS "user_link", CreationDate FROM Comments WHERE Text LIKE '%##string##%' AND CreationDate >= '##Date1##' AND CreationDate <= '##Date2##' ORDER BY CreationDate
sede
CREATE TABLE table_name_23 ( player_name VARCHAR, matches VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the player name with matches of 51
SELECT player_name FROM table_name_23 WHERE matches = "51"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '吕...
css
CREATE TABLE 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 text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jybgb JOIN jyjgzbb ON jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE jybgb.JZLSH = '60506395740' AND jyjgzbb.JCRXM LIKE '陶%'
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ...
css
CREATE TABLE GRAPES ( Grape VARCHAR, Color VARCHAR ) CREATE TABLE WINE ( Name VARCHAR, Grape VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the names of all distinct wines that are made of red color grape.
SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red"
sql_create_context
CREATE TABLE table_75450 ( "Year" real, "Film" text, "Award" text, "Category" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result associated with the cinemaa awards, and gabbar singh film?
SELECT "Result" FROM table_75450 WHERE "Award" = 'cinemaa awards' AND "Film" = 'gabbar singh'
wikisql
CREATE TABLE table_67016 ( "Date" text, "Opponent" text, "Score" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What record was reached with a score of 7 - 2?
SELECT "Record" FROM table_67016 WHERE "Score" = '7 - 2'
wikisql
CREATE TABLE table_name_43 ( power VARCHAR, capacity VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the power when the capacity is 898cc?
SELECT power FROM table_name_43 WHERE capacity = "898cc"
sql_create_context
CREATE TABLE table_name_81 ( crew_chief VARCHAR, primary_sponsor_s_ VARCHAR, car_s_ VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the crew chief of team Joe Gibbs Racing, which has a Chevrolet Monte Carlo and Fedex as the primar...
SELECT crew_chief FROM table_name_81 WHERE car_s_ = "chevrolet monte carlo" AND team = "joe gibbs racing" AND primary_sponsor_s_ = "fedex"
sql_create_context
CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, Location_Code CHAR(15) ) CREATE TABLE Things ( thing_id INTEGER, organization_id INTEGER, Type_of_Thing_Code CHAR(15), service_type_code CHAR(10), service_details VARCHAR(255) ) CREATE TABLE Properties (...
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events ORDER BY COUNT(date_moved_in) DESC
nvbench
CREATE TABLE table_204_652 ( id number, "title" text, "year" number, "director" text, "country" text, "genre" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what movie directed this year by angela evers hughey was made in the s...
SELECT "title" FROM table_204_652 WHERE "director" = 'angela evers hughey'
squall
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(hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '6451963' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 15
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2144" AND lab.label = "Lipase"
mimicsql_data
CREATE TABLE table_228973_3 ( no_in_season VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the number of the season episode whose premiere was in january 3, 1997?
SELECT COUNT(no_in_season) FROM table_228973_3 WHERE original_air_date = "January 3, 1997"
sql_create_context
CREATE TABLE table_55811 ( "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 is the home team score for the team that pl...
SELECT "Home team score" FROM table_55811 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_17522854_6 ( miss_united_continent INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least number of miss united continents?
SELECT MIN(miss_united_continent) FROM table_17522854_6
sql_create_context
CREATE TABLE table_31257 ( "Rank by average" real, "Place" real, "Couple" text, "Total points" text, "Number of dances" real, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times is the rank by average 4?
SELECT COUNT("Place") FROM table_31257 WHERE "Rank by average" = '4'
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '61340309' AND gwyjzb.MED_SER_ORG_NO = '8931708' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '郑%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '61340309' AND fgwyjzb.MED_SER_ORG_NO = '8...
css
CREATE TABLE table_6135 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Time" text, "Purse" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the trainer in 2013?
SELECT "Trainer" FROM table_6135 WHERE "Year" = '2013'
wikisql
CREATE TABLE table_63446 ( "Locks & Dam" text, "Location [L ]" text, "River Mile" real, "Lock Side" text, "Lock Lift/Drop (in feet)" text, "Pool Length (miles)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the River Mile with a RDB loc...
SELECT "River Mile" FROM table_63446 WHERE "Lock Side" = 'rdb' AND "Pool Length (miles)" = '55.4'
wikisql
CREATE TABLE table_28036 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many figures are provided for Weeks' field goa...
SELECT COUNT("Field goals") FROM table_28036 WHERE "Player" = 'Weeks'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE diagnoses_icd ( ...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'rt/left heart card cath') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825 AND N...
mimic_iii
CREATE TABLE table_name_43 ( release_date VARCHAR, socket VARCHAR, voltage VARCHAR, mult VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the microprocessor with 1.65 1.7 v, a mult of 4.5 , and a slot 1 socket released?
SELECT release_date FROM table_name_43 WHERE voltage = "1.65–1.7 v" AND mult = "4.5×" AND socket = "slot 1"
sql_create_context
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 MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '潘向荣' AND IN_HOSP_DATE BETWEEN '2011-03-13' AND '2013-06-11' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_14483 ( "Name" text, "Number" real, "Released" real, "Film" text, "Pieces" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Raiders of the Lost Ark had pieces of 277 for what lowest number?
SELECT MIN("Number") FROM table_14483 WHERE "Film" = 'raiders of the lost ark' AND "Pieces" = '277'
wikisql
CREATE TABLE Documents ( project_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the id of the project with least number of documents?
SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) LIMIT 1
sql_create_context
CREATE TABLE table_name_54 ( heat VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Jin Hao had what amount of heat?
SELECT heat FROM table_name_54 WHERE name = "jin hao"
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, ...
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, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.arrival_time <= 2000 AND flight.to_airport = AIRPORT_SERVICE_1....
atis
CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, Hosts text ) CREATE TABLE competition_record ( Competition_ID int, Farm_ID int, Rank int ) CREATE TABLE city ( City_ID int, Official_Name text, Status text, Area_km_2 real, P...
SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY Year
nvbench
CREATE TABLE table_204_786 ( id number, "riding" text, "candidate" text, "gender" text, "residence" text, "occupation" text, "votes" number, "%" number, "rank" text, "biographical notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT COUNT("candidate") FROM table_204_786 WHERE "votes" > (SELECT "votes" FROM table_204_786 WHERE "candidate" = 'tamara lorincz')
squall
CREATE TABLE table_62851 ( "Year" text, "Subject" text, "Party" text, "Votes" real, "Opponent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which party has a voting total greater than 4,478?
SELECT "Party" FROM table_62851 WHERE "Votes" > '4,478'
wikisql
CREATE TABLE table_699 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the incumbent for 1954
SELECT "Incumbent" FROM table_699 WHERE "First elected" = '1954'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.ethnicity = "ASIAN"
mimicsql_data
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 All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY School_ID
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.BGDH 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 = '马欣怿' AND jybg...
css
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 mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '窦嘉美' UNION SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb...
css
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) 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 = 'L64.876' AND jyjgzbb.JCZBMC = '...
css
CREATE TABLE table_58400 ( "Event Name" text, "Established" real, "Category" text, "Sub Category" text, "Main Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the category of the touchdown atlantic?
SELECT "Category" FROM table_58400 WHERE "Event Name" = 'touchdown atlantic'
wikisql
CREATE TABLE table_name_51 ( paper_type VARCHAR, illustration VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Paper Type with an Illustration with martin dee, ubc public affairs?
SELECT paper_type FROM table_name_51 WHERE illustration = "martin dee, ubc public affairs"
sql_create_context
CREATE TABLE table_55348 ( "Candidate" text, "Money Raised, 2Q" text, "Loans Received, 2Q" text, "Money Spent, 2Q" text, "Total Receipts" text, "Cash On Hand" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much money was spent in 2Q when the...
SELECT "Money Spent, 2Q" FROM table_55348 WHERE "Total Receipts" = '$1,117,566'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "V4986"
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 prescriptions.drug, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.subject_id = "76446"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_17271495_1 ( grid VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of grid for 30
SELECT COUNT(grid) FROM table_17271495_1 WHERE points = "30"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, H...
SELECT * FROM t_kc21 WHERE t_kc21.PERSON_NM = '韩子安' AND t_kc21.MED_SER_ORG_NO = '1397845' AND t_kc21.MED_ORG_DEPT_NM LIKE '%普外科%'
css
CREATE TABLE table_1307 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season number correspond...
SELECT MAX("Season #") FROM table_1307 WHERE "Series #" = '102'
wikisql
CREATE TABLE table_10874596_1 ( original_title VARCHAR, film_title_used_in_nomination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original title of the film submitted with the title A Woman in Flames?
SELECT original_title FROM table_10874596_1 WHERE film_title_used_in_nomination = "A Woman in Flames"
sql_create_context
CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE head ( head_ID int, name text, born_state tex...
SELECT Creation, SUM(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation DESC
nvbench
CREATE TABLE table_name_46 ( week INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value of the lowest Week with a Record of 2 9?
SELECT MIN(week) FROM table_name_46 WHERE record = "2–9"
sql_create_context
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 HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_name_51 ( long INTEGER, yards VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest long with 26 yards?
SELECT MIN(long) FROM table_name_51 WHERE yards = 26
sql_create_context
CREATE TABLE review ( rank INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the highest rank of all reviews.
SELECT MIN(rank) FROM review
sql_create_context
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 demographic.language FROM demographic WHERE demographic.subject_id = "52118"
mimicsql_data
CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, Wheels text, Location text, ObjectNumber text ) CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int ) CREATE TABLE train ( Tra...
SELECT Builder, COUNT(*) FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC
nvbench
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 prescriptions ( subject_id text, hadm_id...
SELECT prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "CEFA10I"
mimicsql_data
CREATE TABLE table_name_34 ( third_place VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won third place in the Zurich Tournament?
SELECT third_place FROM table_name_34 WHERE tournament = "zurich"
sql_create_context
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, ...
SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor ORDER BY Governor DESC
nvbench
CREATE TABLE table_1681535_1 ( narrator VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which narrator has the bonus interview with Frazer Hines?
SELECT narrator FROM table_1681535_1 WHERE notes = "Bonus interview with Frazer Hines"
sql_create_context