instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_34384 ( "Rank" real, "Name" text, "Nation" text, "Points" real, "Places" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average rank of Wolfgang Schwarz with greater than 13 places?
SELECT AVG("Rank") FROM table_34384 WHERE "Name" = 'wolfgang schwarz' AND "Places" > '13'
wikisql
CREATE TABLE table_71074 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the place for ireland?
SELECT "Place" FROM table_71074 WHERE "Country" = 'ireland'
wikisql
CREATE TABLE table_14292 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country of origin for the player who plays on Tondena 65 Rhum?
SELECT "Country of origin*" FROM table_14292 WHERE "PBA team" = 'tondena 65 rhum'
wikisql
CREATE TABLE table_21146729_6 ( series__number INTEGER, original_airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the series# with the original airdate of october 23, 1967?
SELECT MAX(series__number) FROM table_21146729_6 WHERE original_airdate = "October 23, 1967"
sql_create_context
CREATE TABLE table_60132 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Competition has a Year smaller than 1983?
SELECT "Competition" FROM table_60132 WHERE "Year" < '1983'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.route = "NEB"
mimicsql_data
CREATE TABLE table_204_749 ( id number, "courthouse" text, "city" text, "street address" text, "jurisdiction" text, "dates of use" text, "named for" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where was the first court house built ?
SELECT "city" FROM table_204_749 ORDER BY "dates of use" LIMIT 1
squall
CREATE TABLE table_1074 ( "Nation" text, "Winners" real, "Runners-up" real, "Third Place" real, "Fourth Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did argentina win?
SELECT MAX("Winners") FROM table_1074 WHERE "Nation" = 'Argentina'
wikisql
CREATE TABLE table_name_23 ( runner_s__up VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner(s)-Up to winner Sarah Brice?
SELECT runner_s__up FROM table_name_23 WHERE winner = "sarah brice"
sql_create_context
CREATE TABLE table_203_697 ( id number, "player" text, "career" text, "nickname" text, "team inducted as" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long did cap anson play ?
SELECT "career" - "career" FROM table_203_697 WHERE "player" = 'cap anson'
squall
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Open liver biopsy"
mimicsql_data
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 86206 AND admissions.admission_location = 'phys referral/normal deli' AND STRFTIME('%y', admissions.admittime) <= '2104' ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_37033 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Year(s) won of 1994 , 1997 has what average total?
SELECT AVG("Total") FROM table_37033 WHERE "Year(s) won" = '1994 , 1997'
wikisql
CREATE TABLE table_name_44 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was Southend United the home team?
SELECT date FROM table_name_44 WHERE home_team = "southend united"
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.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 NOT ...
css
CREATE TABLE table_56435 ( "Tournament" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text...
SELECT "1989" FROM table_56435 WHERE "2002" = '4r' AND "2005" = '4r'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id
advising
CREATE TABLE gyb ( 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_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '章浩然' AND qtb.MED_SER_ORG_NO = '4333598' AND NOT qtb.IN_DIAG_DIS_NM LIKE '%癫痫%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '章浩然' AND gyb.MED_SER_ORG_NO = '4333598' AND NOT gyb.IN_DIAG_DIS_NM LIKE '%癫痫%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb WH...
css
CREATE TABLE table_name_21 ( year INTEGER, miss_fire__3rd_runner_up_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Caroline Medina Miss Fire (3rd Runner-up)?
SELECT AVG(year) FROM table_name_21 WHERE miss_fire__3rd_runner_up_ = "caroline medina"
sql_create_context
CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE lives_in ( stuid number, dormid number, room_numb...
SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')
spider
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 qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '51529676' AND t_kc22.STA_DATE BETWEEN '2001-12-07' AND '2006-04-08' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '5...
css
CREATE TABLE table_name_5 ( crowd VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people were in the crowd with the away team being collingwood?
SELECT COUNT(crowd) FROM table_name_5 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT 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 = '60198732' AND t_kc22.STA_DATE BETWEEN '2008-12-03' AND '2010-01-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC L...
css
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TA...
SELECT * FROM (SELECT Posts.Id AS "post_link", AVG(Posts.Score) AS "score", COUNT(*) AS "close_votes", MAX(Votes.CreationDate) AS "last_vote", MIN(Votes.CreationDate) AS "first_vote" FROM Posts JOIN Votes ON Posts.Id = Votes.PostId WHERE Votes.VoteTypeId = 6 AND Posts.ClosedDate IS NULL AND Posts.Tags LIKE '%<##Tag##>%...
sede
CREATE TABLE table_20124413_1 ( original_title VARCHAR, prod_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1.12 is the production code what is the original title?
SELECT original_title FROM table_20124413_1 WHERE prod_code = "1.12"
sql_create_context
CREATE TABLE table_1692 ( "Province" text, "Provincial capital" text, "Largest city" text, "Area (km 2 )" real, "Population (2013)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of provincial captial where the province is norther...
SELECT COUNT("Provincial capital") FROM table_1692 WHERE "Province" = 'Northern Cape'
wikisql
CREATE TABLE table_8650 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Points have a Date of march 19, 2009?
SELECT COUNT("Points") FROM table_8650 WHERE "Date" = 'march 19, 2009'
wikisql
CREATE TABLE table_26137 ( "Series episode" real, "Season episode" real, "Title" text, "U.S. viewers (millions)" text, "Original U.S. airdate" text, "Prod. code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest series episode wi...
SELECT MIN("Series episode") FROM table_26137 WHERE "Prod. code" = '406'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '97231052' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 9587.83)
css
CREATE TABLE table_4910 ( "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 game with the...
SELECT "Home team score" FROM table_4910 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE table_name_15 ( entrant VARCHAR, points VARCHAR, chassis VARCHAR, engine VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which entrant, with an Offenhauser L4 engine and a Kurtis Kraft KK500A chassis, scored 9 points bef...
SELECT entrant FROM table_name_15 WHERE engine = "offenhauser l4" AND year < 1955 AND chassis = "kurtis kraft kk500a" AND points = 9
sql_create_context
CREATE TABLE table_name_37 ( territory VARCHAR, acquired VARCHAR, capital VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the territory that was acquired past 1899 and has a capital of saipan?
SELECT territory FROM table_name_37 WHERE acquired > 1899 AND capital = "saipan"
sql_create_context
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, ...
SELECT meter_600, ID FROM swimmer
nvbench
CREATE TABLE table_name_90 ( winner VARCHAR, location VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the winner of the tournament in Georgia on Oct 3?
SELECT winner FROM table_name_90 WHERE location = "georgia" AND date = "oct 3"
sql_create_context
CREATE TABLE table_name_5 ( bronze INTEGER, total VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most Bronze medals won among the participants that won less than 22 medals overall and less than 5 silver medals?
SELECT MAX(bronze) FROM table_name_5 WHERE total < 22 AND silver < 5
sql_create_context
CREATE TABLE table_15194 ( "Name" text, "Race" text, "Current age" real, "Age at offense" real, "Years on death row" real, "Location of offense" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the prisoner's name that is currently 29 year...
SELECT "Name" FROM table_15194 WHERE "Current age" = '29'
wikisql
CREATE TABLE table_name_45 ( time VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time of sportfight 10?
SELECT time FROM table_name_45 WHERE event = "sportfight 10"
sql_create_context
CREATE TABLE table_45714 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record for April 13?
SELECT "Record" FROM table_45714 WHERE "Date" = 'april 13'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2076"
mimicsql_data
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, had...
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4
mimic_iii
CREATE TABLE countries ( country_id text, country_name text, region_id number ) CREATE TABLE jobs ( job_id text, job_title text, min_salary number, max_salary number ) CREATE TABLE regions ( region_id number, region_name text ) CREATE TABLE locations ( location_id number, ...
SELECT first_name, last_name, salary FROM employees WHERE salary < 6000
spider
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 is the number of films in this category that came from france dur...
SELECT COUNT("title") FROM table_204_652 WHERE "country" = 'france'
squall
CREATE TABLE table_58494 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" text, "Roll" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the roll number of Poroti school, which has a 6 decile?
SELECT "Roll" FROM table_58494 WHERE "Decile" = '6' AND "Name" = 'poroti school'
wikisql
CREATE TABLE table_2668367_7 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the incumbent in the Kentucky 8 district?
SELECT incumbent FROM table_2668367_7 WHERE district = "Kentucky 8"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE restriction ( restriction_code text, ...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'ATLANTA' AND ground_service.airp...
atis
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE o...
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 = 1902)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat...
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Heparin (IABP)"
mimicsql_data
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_DIRE_CD text, MED_DIRE_NM text,...
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 = '98736904' AND t_kc22.STA_DATE BETWEEN '2007-01-26' AND '2015-08-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC L...
css
CREATE TABLE table_15479 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Home Captain at Sabina Park?
SELECT "Home captain" FROM table_15479 WHERE "Venue" = 'sabina park'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( ...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-141930' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hosp...
eicu
CREATE TABLE table_74113 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many ...
SELECT COUNT("Team") FROM table_74113 WHERE "Date of appointment" = '11 April 2011'
wikisql
CREATE TABLE table_14293 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silver medals when the total was 2 and less than 1 bronze?
SELECT SUM("Silver") FROM table_14293 WHERE "Bronze" < '1' AND "Total" = '2'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coronary artery disease' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1) - (SELECT COU...
eicu
CREATE TABLE table_name_54 ( laps INTEGER, points VARCHAR, car__number VARCHAR, make VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of laps that has a car number of larger than 1, is a ford, and has 155 points?
SELECT SUM(laps) FROM table_name_54 WHERE car__number > 1 AND make = "ford" AND points = 155
sql_create_context
CREATE TABLE table_name_77 ( surface VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Surface of the match played on October 5, 1987?
SELECT surface FROM table_name_77 WHERE date = "october 5, 1987"
sql_create_context
CREATE TABLE table_204_319 ( id number, "mlb\nseason" number, "team\nseason" number, "league" text, "division" text, "finish" text, "wins" number, "losses" number, "win %" number, "gb" text, "postseason" text, "awards" text ) -- Using valid SQLite, answer the following ...
SELECT SUM("losses") FROM table_204_319 WHERE "mlb\nseason" = 1981
squall
CREATE TABLE buildings ( id int, name text, City text, Height int, Stories int, Status text ) CREATE TABLE Office_locations ( building_id int, company_id int, move_in_year int ) CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_...
SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name ORDER BY T3.name
nvbench
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER...
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*)
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Cor ath unsp vsl ntv/gft" AND prescriptions.route = "SL"
mimicsql_data
CREATE TABLE table_name_90 ( gold INTEGER, total INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest gold with a Total larger than 16?
SELECT MAX(gold) FROM table_name_90 WHERE total > 16
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, Par...
SELECT t.TagName, t.Count, Body FROM Tags AS t LEFT OUTER JOIN Posts AS p ON t.ExcerptPostId = p.Id WHERE LOWER(Body) LIKE '%ms-word%' OR LOWER(Body) LIKE '%excel%' OR LOWER(Body) LIKE '%powerpoint%' OR LOWER(Body) LIKE '%outlook%' OR LOWER(Body) LIKE '%ms access%' OR LOWER(Body) LIKE '%microsoft access%' OR LOWER(Body...
sede
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 zyjybgb.BGRQ FROM zyjybgb WHERE zyjybgb.BGDH = '18586184579' UNION SELECT mzjybgb.BGRQ FROM mzjybgb WHERE mzjybgb.BGDH = '18586184579'
css
CREATE TABLE table_1342249_32 ( first_elected VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the first elected for lost renomination democratic loss
SELECT first_elected FROM table_1342249_32 WHERE result = "Lost renomination Democratic loss"
sql_create_context
CREATE TABLE table_name_83 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance of april 17?
SELECT SUM(attendance) FROM table_name_83 WHERE date = "april 17"
sql_create_context
CREATE TABLE table_name_88 ( moving_from VARCHAR, transfer_window VARCHAR, source VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the moving from location with a transfer window of summer and the source kerkida.net?
SELECT moving_from FROM table_name_88 WHERE transfer_window = "summer" AND source = "kerkida.net"
sql_create_context
CREATE TABLE table_33016 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the 1967 Cleveland Browns season what is the total number of times they played the Minnesota Vikings...
SELECT COUNT("Week") FROM table_33016 WHERE "Opponent" = 'minnesota vikings' AND "Attendance" < '68,431'
wikisql
CREATE TABLE table_55597 ( "Year" real, "Network" text, "Play-by-play" text, "Color commentator(s)" text, "Ice level reporters" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the play-by-play before 1992 with the Ice level reporter Mike Emri...
SELECT "Play-by-play" FROM table_55597 WHERE "Year" < '1992' AND "Ice level reporters" = 'mike emrick'
wikisql
CREATE TABLE table_35747 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score with an Outcome of runner-up, and a Partner...
SELECT "Score" FROM table_35747 WHERE "Outcome" = 'runner-up' AND "Partner" = 'elizabeth little'
wikisql
CREATE TABLE table_45287 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lest amount of bronzes that ranked 2 and has less silvers than 0?
SELECT MIN("Bronze") FROM table_45287 WHERE "Rank" = '2' AND "Silver" < '0'
wikisql
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 hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info...
css
CREATE TABLE table_28224 ( "Region" text, "Land area (km 2 )" text, "Rainfall by depth (mm/year)" real, "Rainfall by volume (km 3 /year)" text, "Surface run off (km 3 /year)" text, "Infiltration (km 3 /year)" text, "Evapotranspiration (km 3 /year)" text ) -- Using valid SQLite, answer the ...
SELECT "Infiltration (km 3 /year)" FROM table_28224 WHERE "Region" = 'Central'
wikisql
CREATE TABLE table_name_11 ( losses INTEGER, goals_for VARCHAR, wins VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses altogether were had by teams that won 12 times, had 40-4 points, and more than 57 goals?
SELECT SUM(losses) FROM table_name_11 WHERE wins = 12 AND points = "40-4" AND goals_for > 57
sql_create_context
CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text ) -- Using valid SQLite, ans...
SELECT name, location FROM wrestler
spider
CREATE TABLE table_name_30 ( long VARCHAR, gain VARCHAR, avg_g VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total long for an avg/g over 0.2, fewer than 2 loss, and a gain less than 8?
SELECT COUNT(long) FROM table_name_30 WHERE avg_g > 0.2 AND loss < 2 AND gain < 8
sql_create_context
CREATE TABLE table_203_446 ( id number, "name" text, "gender" text, "age" number, "from" text, "occupation" text, "prize money (usd)" text, "status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what were the number of contestants that ...
SELECT COUNT("name") FROM table_203_446 WHERE "gender" = 'male'
squall
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.PERSON_NM = '昌娜兰' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-03-16' AND '2020-01-01' AND t_kc21.CLINIC_TYPE = '住院'
css
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13127' AND patient.hospi...
eicu
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 jybgb ( BBCJBW text, BBDM tex...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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_MZJZ...
css
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Molecular Anthropology%' OR course.description LIKE '%Molecular Anthropology%' OR course.name LI...
advising
CREATE TABLE table_name_30 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game from July 18?
SELECT score FROM table_name_30 WHERE date = "july 18"
sql_create_context
CREATE TABLE table_33755 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date before week 13 and Miami Dolphins as an opponent?
SELECT "Date" FROM table_33755 WHERE "Week" < '13' AND "Opponent" = 'miami dolphins'
wikisql
CREATE TABLE table_name_98 ( season_7 VARCHAR, season_6 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Season 7 has a Season 6 of jim treliving?
SELECT season_7 FROM table_name_98 WHERE season_6 = "jim treliving"
sql_create_context
CREATE TABLE table_13770460_3 ( type VARCHAR, transfer_fee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type of the player whose transfer fee was 20m?
SELECT type FROM table_13770460_3 WHERE transfer_fee = "€20M"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
advising
CREATE TABLE table_name_15 ( game VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which game number did they play the Chicago team?
SELECT game FROM table_name_15 WHERE team = "chicago"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-10559')) AND intakeoutput.cellpath LIKE '%output%...
eicu
CREATE TABLE table_61824 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Incumbent John Sullivan has what as biggest first elected?
SELECT MAX("First elected") FROM table_61824 WHERE "Incumbent" = 'john sullivan'
wikisql
CREATE TABLE table_45136 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the opponent after round number 1 with a method of decision ...
SELECT "Opponent" FROM table_45136 WHERE "Round" > '1' AND "Method" = 'decision (unanimous)'
wikisql
CREATE TABLE table_name_93 ( votes INTEGER, draw VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many votes did Yvetta Kadakas & Ivo Linna, who had less than 4 draws, have?
SELECT SUM(votes) FROM table_name_93 WHERE draw < 4 AND artist = "yvetta kadakas & ivo linna"
sql_create_context
CREATE TABLE table_51028 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Bonus Points" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What a...
SELECT "Points against" FROM table_51028 WHERE "Points difference" = 'points difference'
wikisql
CREATE TABLE table_37519 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team had an away ...
SELECT "Home team" FROM table_37519 WHERE "Away team" = 'brisbane lions'
wikisql
CREATE TABLE table_2603 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nation had the athlete sebastian...
SELECT "Nation" FROM table_2603 WHERE "Athlete" = 'Sebastian Coe Category:Articles with hCards'
wikisql
CREATE TABLE table_64490 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the Japanese title that had 11 episodes, what is the average ratings?
SELECT "Average Ratings" FROM table_64490 WHERE "Episodes" = '11' AND "Japanese Title" = 'サプリ'
wikisql
CREATE TABLE table_53719 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game where Dipietro earned a decision and ...
SELECT "Date" FROM table_53719 WHERE "Decision" = 'dipietro' AND "Visitor" = 'carolina'
wikisql
CREATE TABLE table_204_910 ( id number, "rank" number, "name" text, "nationality" text, "result" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which country came in first ?
SELECT "nationality" FROM table_204_910 WHERE id = 1
squall
CREATE TABLE table_77366 ( "Movie Title" text, "Year" real, "Role" text, "Director" text, "Producer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Jamboree made?
SELECT "Year" FROM table_77366 WHERE "Movie Title" = 'jamboree'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT 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 = '58996582' AND t_kc21.IN_HOSP_DATE BETWEEN...
css
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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 n...
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSDM = '903' AND zyjzjlb.RYDJSJ BETWEEN '2011-05-15' AND '2019-01-20'
css
CREATE TABLE table_44945 ( "The Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year has a Division larger than 3?
SELECT MAX("The Year") FROM table_44945 WHERE "Division" > '3'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name
nvbench