instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_36422 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Record on September 21?
SELECT "Record" FROM table_36422 WHERE "Date" = 'september 21'
wikisql
CREATE TABLE table_13006 ( "Mountain" text, "Height (m)" real, "Height (ft)" real, "Range" text, "Prominence (m)" real, "Parent mountain" text, "First ascent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest height when the...
SELECT MAX("Height (m)") FROM table_13006 WHERE "Prominence (m)" = '3,118'
wikisql
CREATE TABLE table_11570261_2 ( margin_of_victory VARCHAR, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the margin of victory over Justin Leonard, phillip price?
SELECT COUNT(margin_of_victory) FROM table_11570261_2 WHERE runner_s__up = "Justin Leonard, Phillip Price"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
WITH firstrev_cte AS (SELECT p.Id AS pid, MIN(ph.Id) AS MinId FROM PostHistory AS ph INNER JOIN Posts AS p ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId IN (3, 6, 9) AND ph.Text LIKE '%<##tagName##>%' GROUP BY p.Id) SELECT pid AS "post_link", url = 'site://posts/' + CAST(PostId AS TEXT) + '/revisions', UserId AS "user...
sede
CREATE TABLE table_name_41 ( place VARCHAR, country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Place, when Country is 'United States', and when Player is 'Lee Trevino'?
SELECT place FROM table_name_41 WHERE country = "united states" AND player = "lee trevino"
sql_create_context
CREATE TABLE table_name_65 ( English VARCHAR, winning_song VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which winning song was sung by aku tetap milikmu?
SELECT WINNING_SONG(English AS Title) FROM table_name_65 WHERE winning_song = "aku tetap milikmu"
sql_create_context
CREATE TABLE table_58028 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what tournament was there an extra of 400 m hurdles?
SELECT "Tournament" FROM table_58028 WHERE "Extra" = '400 m hurdles'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
nvbench
CREATE TABLE table_26048 ( "Years led" text, "Span of years led" real, "Player" text, "Titles won at point of lead" real, "Total Career titles" real, "Tournament at which lead began" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At which tourna...
SELECT "Tournament at which lead began" FROM table_26048 WHERE "Player" = 'William Renshaw' AND "Titles won at point of lead" = '7'
wikisql
CREATE TABLE table_204_846 ( id number, "tie no" number, "home team" text, "score" text, "away team" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which tie number did not have any attendance ?
SELECT "tie no" FROM table_204_846 WHERE "attendance" IS NULL
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(*) FROM zzmzjzjlb WHERE zzmzjzjlb.JZKSMC = '小儿骨质疏松科' AND zzmzjzjlb.JZKSRQ BETWEEN '2007-07-31' AND '2007-12-11' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZKSMC = '小儿骨质疏松科' AND fzzmzjzjlb.JZKSRQ BETWEEN '2007-07-31' AND '2007-12-11'
css
CREATE TABLE table_24027 ( "Ep." real, "Season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. Code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes had a production code of 5m13?...
SELECT COUNT("Ep.") FROM table_24027 WHERE "Prod. Code" = '5M13'
wikisql
CREATE TABLE table_61659 ( "7:00 am" text, "7:30 am" text, "8:00 am" text, "9:00 am" text, "10:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "4:00 pm" text, "4:30 pm"...
SELECT "4:30 pm" FROM table_61659 WHERE "8:00 am" = 'cbs this morning'
wikisql
CREATE TABLE table_71100 ( "Language" text, "Number" text, "percentage (%)" text, "males" text, "females" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the number of males that had the number females 62 331?
SELECT "males" FROM table_71100 WHERE "females" = '62 331'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT diagnoses.short_title, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Josette Orr"
mimicsql_data
CREATE TABLE table_10975034_4 ( player VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which players have a pick number of 27?
SELECT player FROM table_10975034_4 WHERE pick__number = 27
sql_create_context
CREATE TABLE table_31250 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air d...
SELECT "Original air date" FROM table_31250 WHERE "Directed by" = 'Bruce Seth Green'
wikisql
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2157" AND procedures.long_title = "Open reduction of fracture with internal fixation, femur"
mimicsql_data
CREATE TABLE table_21748 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many locations have the call signs dxjp-fm?
SELECT COUNT("Location") FROM table_21748 WHERE "Callsign" = 'DXJP-FM'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '10534580' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2006-06-18' AND '2014-10-26' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
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 labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59275) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-40 month'...
mimic_iii
CREATE TABLE table_name_93 ( overall INTEGER, position VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Overall for the wide receiver in a round less than 2?
SELECT MIN(overall) FROM table_name_93 WHERE position = "wide receiver" AND round < 2
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, ni...
SELECT DISTINCT flight.arrival_time, flight.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_cod...
atis
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '83111468' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 9559.88)
css
CREATE TABLE table_261642_3 ( frequency__hz_ VARCHAR, g__μs_km_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the frequency (hz) when the g ( s/km) is 53.205?
SELECT frequency__hz_ FROM table_261642_3 WHERE g__μs_km_ = "53.205"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'cerebral mass of unknown etiology')) GROUP B...
eicu
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
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 = 26799)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirat...
mimic_iii
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 d_icd_procedures ( ...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cor ath un...
mimic_iii
CREATE TABLE table_29635868_1 ( object_date VARCHAR, origin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many object dates have origin in Samoa?
SELECT COUNT(object_date) FROM table_29635868_1 WHERE origin = "Samoa"
sql_create_context
CREATE TABLE Staff ( staff_id INTEGER, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255) ) CREATE TABLE Product ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255) ) CREATE TABLE Problem_Log ( problem_log_id INTEGER, ...
SELECT log_entry_date, COUNT(log_entry_date) FROM Problem_Log WHERE problem_id = 10 ORDER BY COUNT(log_entry_date) DESC
nvbench
CREATE TABLE table_name_53 ( position INTEGER, club VARCHAR, points VARCHAR, draws VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position when the points were less than 34, draws of 7, and a Club of sd eibar?
SELECT AVG(position) FROM table_name_53 WHERE points < 34 AND draws = 7 AND club = "sd eibar"
sql_create_context
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(SALARY)
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7301608' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-10-30' AND '2011-09-16' AND t_kc21.IN_DIAG_DIS_CD <> t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ...
SELECT DISTINCT course.department, course.name, course.number, semester.semester, semester.year, student_record.grade FROM course, semester, student_record WHERE student_record.course_id = course.course_id AND student_record.semester = semester.semester_id AND student_record.student_id = 1
advising
CREATE TABLE table_name_16 ( wins INTEGER, draws VARCHAR, scored VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest wins that has fewer than 23 goals scored, team of 2 de Mayo, and fewer than 7 draws?
SELECT MIN(wins) FROM table_name_16 WHERE scored < 23 AND team = "2 de mayo" AND draws < 7
sql_create_context
CREATE TABLE playlists ( id INTEGER, name VARCHAR(120) ) CREATE TABLE invoice_lines ( id INTEGER, invoice_id INTEGER, track_id INTEGER, unit_price NUMERIC(10,2), quantity INTEGER ) CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20), first_name VARCHAR(20), title VAR...
SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*)
nvbench
CREATE TABLE procedures ( cost INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the highest cost, lowest cost and average cost of procedures?
SELECT MAX(cost), MIN(cost), AVG(cost) FROM procedures
sql_create_context
CREATE TABLE table_204_392 ( id number, "#" number, "stadium" text, "capacity" number, "city" text, "country" text, "domed or retractable roof" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many more seats does at & t stadium have than ...
SELECT (SELECT "capacity" FROM table_204_392 WHERE "stadium" = 'at&t stadium') - (SELECT "capacity" FROM table_204_392 WHERE "stadium" = 'ford field')
squall
CREATE TABLE table_1341690_18 ( result VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the results when the incumbent was John Breaux?
SELECT result FROM table_1341690_18 WHERE incumbent = "John Breaux"
sql_create_context
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 treatment ( ...
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605' AND patient.hospitaldischargetime IS NULL)) ORDER BY lab.labresulttime DESC L...
eicu
CREATE TABLE table_27313 ( "Region" text, "Preschool (0\u20135 years)" text, "Primary (6\u201313 years)" text, "Secondary (14\u201317 years)" text, "Tertiary (18\u201324 years)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the enrollment r...
SELECT "Preschool (0\u20135 years)" FROM table_27313 WHERE "Tertiary (18\u201324 years)" = '29.55'
wikisql
CREATE TABLE table_name_18 ( score VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the score of the friendly competition?
SELECT score FROM table_name_18 WHERE competition = "friendly"
sql_create_context
CREATE TABLE table_203_99 ( id number, "season" number, "date" text, "driver" text, "team" text, "chassis" text, "engine" text, "race distance\nlaps" number, "race distance\nmiles (km)" text, "race time" text, "average speed\n(mph)" number, "report" text ) -- Using vali...
SELECT COUNT(*) FROM table_203_99 WHERE "chassis" = 'dallara'
squall
CREATE TABLE table_name_87 ( rank INTEGER, notes VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest rank for the team that raced a time of 6:17.62 and a notes of sa/b?
SELECT MIN(rank) FROM table_name_87 WHERE notes = "sa/b" AND time = "6:17.62"
sql_create_context
CREATE TABLE table_name_21 ( attendance INTEGER, date VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most attendance for november 17, 1946 and week more than 8
SELECT MAX(attendance) FROM table_name_21 WHERE date = "november 17, 1946" AND week > 8
sql_create_context
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 jybgb.JYSQJGMC, jybgb.JYJGMC FROM jybgb WHERE jybgb.BGDH = '45721416246'
css
CREATE TABLE table_1213511_7 ( player VARCHAR, position VARCHAR, nhl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which players have the position of centre and play for the nhl team new york rangers
SELECT player FROM table_1213511_7 WHERE position = "Centre" AND nhl_team = "New York Rangers"
sql_create_context
CREATE TABLE table_5934 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the Los Angeles open?
SELECT "Date" FROM table_5934 WHERE "Tournament" = 'los angeles open'
wikisql
CREATE TABLE table_203_522 ( id number, "week" number, "date" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "venue" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the team ...
SELECT "results\nteam record" FROM table_203_522 WHERE "week" = 10
squall
CREATE TABLE table_name_42 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Date of march 16?
SELECT opponent FROM table_name_42 WHERE date = "march 16"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id num...
SELECT AVG(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 = 25796)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'hear...
mimic_iii
CREATE TABLE table_name_24 ( player VARCHAR, position VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the forward from Grambling State?
SELECT player FROM table_name_24 WHERE position = "forward" AND school_club_team = "grambling state"
sql_create_context
CREATE TABLE table_name_20 ( format VARCHAR, label VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the format when the label was loen entertainment?
SELECT format FROM table_name_20 WHERE label = "loen entertainment"
sql_create_context
CREATE TABLE table_7586 ( "1900s" real, "1920s" real, "1930s" real, "1940s" real, "1950s" real, "1960s" real, "1970s" real, "1980s" real, "1990s" real, "2000s to date" real, "Total to date" real ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT MIN("1930s") FROM table_7586 WHERE "1940s" > '1' AND "1990s" < '1' AND "Total to date" < '17'
wikisql
CREATE TABLE table_23472 ( "Language" text, "Concepci\u00f3n Municipality (%)" real, "San Javier Municipality (%)" real, "San Ram\u00f3n Municipality (%)" real, "San Juli\u00e1n Municipality (%)" real, "San Antonio de Lomer\u00edo Municipality (%)" text, "Cuatro Ca\u00f1adas Municipality (%)...
SELECT "San Javier Municipality (%)" FROM table_23472 WHERE "Cuatro Ca\u00f1adas Municipality (%)" = '202'
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 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.admityear < "2135" AND diagnoses.icd9_code = "V1009"
mimicsql_data
CREATE TABLE table_204_415 ( id number, "season" text, "tier" number, "division" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- after the 1994/95 season , how many first place finishes did the club have ?
SELECT COUNT(*) FROM table_204_415 WHERE "season" > '1994/95' AND "place" = 1
squall
CREATE TABLE table_name_41 ( score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Player is 'Vijay Singh'?
SELECT score FROM table_name_41 WHERE player = "vijay singh"
sql_create_context
CREATE TABLE table_name_78 ( year VARCHAR, total VARCHAR, competitors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Year did Yugoslavia have 4 Competitors with 0 medals Total?
SELECT year FROM table_name_78 WHERE total = "0" AND competitors = "4"
sql_create_context
CREATE TABLE table_name_83 ( country VARCHAR, iata VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country that has a IATA of bal?
SELECT country FROM table_name_83 WHERE iata = "bal"
sql_create_context
CREATE TABLE hall_of_fame ( player_id TEXT, yearid INTEGER, votedby TEXT, ballots NUMERIC, needed NUMERIC, votes NUMERIC, inducted TEXT, category TEXT, needed_note TEXT ) CREATE TABLE pitching ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id...
SELECT year, AVG(attendance) FROM home_game GROUP BY year ORDER BY year DESC
nvbench
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE DE...
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY STU_FNAME
nvbench
CREATE TABLE table_name_81 ( external_affairs VARCHAR, human_resources_ VARCHAR, _operations VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was in external affairs when Jakki Doyle was in Human Resources & Operations?
SELECT external_affairs FROM table_name_81 WHERE human_resources_ & _operations = "jakki doyle"
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 demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "4589"
mimicsql_data
CREATE TABLE table_name_10 ( record VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Record of the game with a Score of 118 105?
SELECT record FROM table_name_10 WHERE score = "118–105"
sql_create_context
CREATE TABLE table_29301050_1 ( train_name VARCHAR, arrival_lonavla VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which train name arrives in lonavla at 17:45
SELECT train_name FROM table_29301050_1 WHERE arrival_lonavla = "17:45"
sql_create_context
CREATE TABLE table_name_47 ( gold INTEGER, bronze VARCHAR, silver VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nation with Rank 1 won the fewest gold medals while winning more than 11 silver but fewer than 7 bronze medals?
SELECT MIN(gold) FROM table_name_47 WHERE silver > 11 AND rank = "1" AND bronze < 7
sql_create_context
CREATE TABLE table_name_5 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result and score of the game on February 22?
SELECT result FROM table_name_5 WHERE date = "february 22"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.admityear < "2197"
mimicsql_data
CREATE TABLE table_78765 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has 289 as the total?
SELECT "Player" FROM table_78765 WHERE "Total" = '289'
wikisql
CREATE TABLE table_name_89 ( report VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which report corresponds to the State Sports Centre?
SELECT report FROM table_name_89 WHERE venue = "state sports centre"
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 outputevents ( row_id number, subject_id number, hadm_id number,...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28099) AND prescriptions.drug = 'glucagon' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-6 year')
mimic_iii
CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ) CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ...
SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue ORDER BY COUNT(Venue)
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND procedures.icd9_code = "4576"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "7" AND procedures.short_title = "Opn rt hemicolectomy NEC"
mimicsql_data
CREATE TABLE table_name_71 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Score of 72-69-73=214?
SELECT player FROM table_name_71 WHERE score = 72 - 69 - 73 = 214
sql_create_context
CREATE TABLE table_1723080_1 ( run_time VARCHAR, viewers__in_millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is run time when there were 7.4 million viewers?
SELECT run_time FROM table_1723080_1 WHERE viewers__in_millions_ = "7.4"
sql_create_context
CREATE TABLE table_1626 ( "Series" text, "Title" text, "Broadcasts (TV) 1" real, "Episodes (TV+extra) 2" text, "Directors" text, "Aired in Japan 3" text, "US Release Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When galaxy angel aa i...
SELECT "Series" FROM table_1626 WHERE "Title" = 'Galaxy Angel AA'
wikisql
CREATE TABLE table_name_64 ( partial_failures INTEGER, failures VARCHAR, successes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Failures larger than 0, and a Successes of 1 has what lowest partial failures?
SELECT MIN(partial_failures) FROM table_name_64 WHERE failures > 0 AND successes = 1
sql_create_context
CREATE TABLE table_name_78 ( runner_s__up VARCHAR, margin_of_victory VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which runner(s)-up had a Winning score of 13 (68-70-66-71=275) and a Margin of victory of 3 strokes?
SELECT runner_s__up FROM table_name_78 WHERE margin_of_victory = "3 strokes" AND winning_score = –13(68 - 70 - 66 - 71 = 275)
sql_create_context
CREATE TABLE table_name_40 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was home team North Melbourne's opponents score?
SELECT away_team AS score FROM table_name_40 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE table_name_60 ( status VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status where the notes are possible jr synonym of sapeornis?
SELECT status FROM table_name_60 WHERE notes = "possible jr synonym of sapeornis"
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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 te...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '水兴平' AND hz_info.YLJGDM = '5237390' AND NOT zyjzjlb.JZKSMC LIKE '%免疫%'
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABL...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'endo polpectomy lrge int') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
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(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'parenteral feeds - tpn' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 ...
eicu
CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DATE ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGE...
SELECT Payment_Method_Code, AVG(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY AVG(Amount_Payment) DESC
nvbench
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.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '76308065306' INTERSECT SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '53442751434'
css
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH...
css
CREATE TABLE table_name_16 ( label VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the label of the Year before 1979?
SELECT label FROM table_name_16 WHERE year < 1979
sql_create_context
CREATE TABLE table_204_490 ( id number, "position" text, "name" text, "height" text, "weight" text, "birthdate" text, "birthplace" text, "2009-10 team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the tallest player born in july...
SELECT "name" FROM table_204_490 WHERE "birthdate" = 7 ORDER BY "height" DESC LIMIT 1
squall
CREATE TABLE Complaints ( complaint_id INTEGER, product_id INTEGER, customer_id INTEGER, complaint_outcome_code VARCHAR(20), complaint_status_code VARCHAR(20), complaint_type_code VARCHAR(20), date_complaint_raised DATETIME, date_complaint_closed DATETIME, staff_id INTEGER ) CREATE ...
SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY product_name DESC
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 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 WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.diagnosis = "RUQ PAIN"
mimicsql_data
CREATE TABLE table_71009 ( "Institution" text, "Main Campus Location" text, "Founded" real, "Mascot" text, "School Colors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college was founded in 1967?
SELECT "Main Campus Location" FROM table_71009 WHERE "Founded" = '1967'
wikisql
CREATE TABLE table_name_99 ( nationality VARCHAR, name VARCHAR, lane VARCHAR, rank VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nationality has a Rank larger than 1, and a Time smaller than 22.12, and a Lane smaller than 4, ...
SELECT nationality FROM table_name_99 WHERE rank > 1 AND time < 22.12 AND lane < 4 AND name = "ashley callus"
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 prescriptions...
SELECT demographic.dob, demographic.gender FROM demographic WHERE demographic.name = "Bessie Giordano"
mimicsql_data
CREATE TABLE table_name_18 ( season VARCHAR, points VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season has a 6th north finish and more than 21 points?
SELECT season FROM table_name_18 WHERE points > 21 AND finish = "6th north"
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se...
advising
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
SELECT DISTINCT T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.class_president_vote
spider
CREATE TABLE table_29659 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How m...
SELECT COUNT("Series #") FROM table_29659 WHERE "Directed by" = 'Sean McNamara' AND "Title" = 'Blue in the Face'
wikisql
CREATE TABLE table_12020 ( "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 away team at lake oval?
SELECT "Away team" FROM table_12020 WHERE "Venue" = 'lake oval'
wikisql