instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 WHERE demographic.marital_status = "SINGLE" AND demographic.admityear < "2178"
mimicsql_data
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.marital_status FROM demographic WHERE demographic.name = "John Gartman"
mimicsql_data
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_test...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Derrick Sund%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = ...
advising
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 AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '小儿妇科内分泌' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-01-09' AND '2004-04-18' AND t_kc21.IN_DIAG_DIS_CD = 'Z32.698' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_name_90 ( score_in_the_final VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With Lindsay Lee-Waters as a partner, what was the final score?
SELECT score_in_the_final FROM table_name_90 WHERE partner = "lindsay lee-waters"
sql_create_context
CREATE TABLE table_name_32 ( year INTEGER, film VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year has a Film of baazigar?
SELECT MAX(year) FROM table_name_32 WHERE film = "baazigar"
sql_create_context
CREATE TABLE table_name_23 ( span_metres INTEGER, span_feet VARCHAR, rank VARCHAR, year_opened VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest amount of Span metres when the year opened is 2007, the country is C...
SELECT MIN(span_metres) FROM table_name_23 WHERE year_opened = "2007" AND country = "china" AND rank < 13 AND span_feet < 1378
sql_create_context
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WESTCHESTER COUNTY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na...
atis
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "77" AND lab.label = "Renal Epithelial Cells"
mimicsql_data
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, title text, studio text, director text, gross_in_dollar number ) CREATE ...
SELECT DISTINCT director FROM film
spider
CREATE TABLE table_name_4 ( competing_entities VARCHAR, first_held INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Competing entities that has the First held smaller than 1970?
SELECT competing_entities FROM table_name_4 WHERE first_held < 1970
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.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "15061"
mimicsql_data
CREATE TABLE diagnoses ( 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 WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "27"
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_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_SEX = '昌娜兰' AND zyb.IN_HOSP_DAYS BETWEEN '2007-03-16' AND '2020-01-01'
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "76" AND prescriptions.formulary_drug_cd = "IMDU30"
mimicsql_data
CREATE TABLE table_name_7 ( ground VARCHAR, score VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game played that had a score of 3-2 and a time of 15:00 cet?
SELECT ground FROM table_name_7 WHERE score = "3-2" AND time = "15:00 cet"
sql_create_context
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 SHRGH, SHRXM FROM jybgb WHERE JZLSH = '53717022339'
css
CREATE TABLE table_name_35 ( kinka_12 VARCHAR, kinka_pre_release VARCHAR, kinka_developer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the KINKA 1.2 when the pre-release is no and the developer is yes?
SELECT kinka_12 FROM table_name_35 WHERE kinka_pre_release = "no" AND kinka_developer = "yes"
sql_create_context
CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season re...
SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY Position
nvbench
CREATE TABLE table_62077 ( "Dam constructed" text, "Year completed" real, "Impounded body of water" text, "Reservoir capacity" text, "Dam wall height" text, "Dam type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Reservoir capacity has a...
SELECT "Reservoir capacity" FROM table_62077 WHERE "Impounded body of water" = 'tumut two pondage'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, De...
SELECT u.Id AS "user_link", SUM(Score) AS TotalScore FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE TagName = 'algorithm' AND p.CreationDate >= '2013-07-01' AND p.CreationDate < '2014-06-01' AND p.PostTypeId...
sede
CREATE TABLE table_name_45 ( stadium VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stadium was used on November 13?
SELECT stadium FROM table_name_45 WHERE date = "november 13"
sql_create_context
CREATE TABLE table_name_23 ( losses VARCHAR, geelong_fl VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Losses have a Geelong FL of newtown & chilwell, and more than 11 wins?
SELECT COUNT(losses) FROM table_name_23 WHERE geelong_fl = "newtown & chilwell" AND wins > 11
sql_create_context
CREATE TABLE table_204_646 ( id number, "location" text, "region" text, "coordinates\n(links to map & photo sources)" text, "population" number, "elevation" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- after lima , which location has the nex...
SELECT "location" FROM table_204_646 WHERE "population" < (SELECT "population" FROM table_204_646 WHERE "location" = 'lima') ORDER BY "population" DESC LIMIT 1
squall
CREATE TABLE table_37029 ( "Wrestler" text, "Reign" text, "Days held" text, "Location" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event has unknown as the days held.?
SELECT "Event" FROM table_37029 WHERE "Days held" = 'unknown'
wikisql
CREATE TABLE table_27303975_2 ( studio VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the studio for super callanetics
SELECT studio FROM table_27303975_2 WHERE title = "Super Callanetics"
sql_create_context
CREATE TABLE table_40640 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has an Opponent of at seattle seahawks?
SELECT "Week" FROM table_40640 WHERE "Opponent" = 'at seattle seahawks'
wikisql
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN program_...
advising
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2164" AND procedures.long_title = "Cardiac mapping"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Coronary arteriography using two catheters"
mimicsql_data
CREATE TABLE products ( product_category_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many products are there under the category 'Seeds'?
SELECT COUNT(*) FROM products WHERE product_category_code = "Seeds"
sql_create_context
CREATE TABLE table_12444 ( "Mininera DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which byes are high when losses are larger than 7, wins smaller than 6, and draws are...
SELECT MAX("Byes") FROM table_12444 WHERE "Losses" > '7' AND "Wins" < '6' AND "Draws" < '0'
wikisql
CREATE TABLE table_32683 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the listed attendance when north melbou...
SELECT "Crowd" FROM table_32683 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area...
SELECT Year, AVG(MAX(Price)) FROM wine ORDER BY AVG(MAX(Price)) DESC
nvbench
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE table_53540 ( "Driver" text, "Constructor" text, "Laps" real, "Time/retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the time/retired when the grid is less than 13, the constructor is alfa romeo and the laps ...
SELECT "Time/retired" FROM table_53540 WHERE "Grid" < '13' AND "Constructor" = 'alfa romeo' AND "Laps" > '12'
wikisql
CREATE TABLE table_23104 ( "Season #" real, "Episode #" real, "Title" text, "Director(s)" text, "Writer(s)" text, "Original Air Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the writer of the episode titled 'The Parachute of Heali...
SELECT "Writer(s)" FROM table_23104 WHERE "Title" = 'The Parachute of Healing'
wikisql
CREATE TABLE table_name_44 ( staterooms INTEGER, guests VARCHAR, comments VARCHAR, length VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Of the ships with diesel-electric hybrid engines, length of 443 feet, and over 190 guests, what is the lowest num...
SELECT MIN(staterooms) FROM table_name_44 WHERE comments = "diesel-electric hybrid engines" AND length = "443 feet" AND guests > 190
sql_create_context
CREATE TABLE table_name_54 ( attendance INTEGER, opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Opponent of at boston patriots, and a Week larger than 3 had what average attendance?
SELECT AVG(attendance) FROM table_name_54 WHERE opponent = "at boston patriots" AND week > 3
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '94504683785' AND t_kc22.MED_ORG_DEPT_NM LIKE '%儿童%'
css
CREATE TABLE table_name_59 ( height_in_ft VARCHAR, school_club_team_country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the height in ft for the player from wyoming
SELECT height_in_ft FROM table_name_59 WHERE school_club_team_country = "wyoming"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', medication.drugstarttime) = '2105' GROUP BY medication.drugname) AS t1 WH...
eicu
CREATE TABLE table_204_91 ( id number, "year" number, "original title" text, "english title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many years had passed from malberg 's first film to the first danish film ...
SELECT ((SELECT "year" FROM table_204_91 WHERE "notes" = 'first danish sound film') - (SELECT MIN("year") FROM table_204_91))
squall
CREATE TABLE table_name_84 ( poles INTEGER, position VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest poles of team comtec racing, which has a nc position?
SELECT MIN(poles) FROM table_name_84 WHERE position = "nc" AND team = "comtec racing"
sql_create_context
CREATE TABLE table_13062 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest to par of player len mattiace, who has a t7 place and a score of 73-74=147?
SELECT MAX("To par") FROM table_13062 WHERE "Place" = 't7' AND "Score" = '73-74=147' AND "Player" = 'len mattiace'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%Madhya Pradesh%' OR UPPER(Location) LIKE '%Madhya Pradesh%' OR Location LIKE '%Madhya Pradesh%' AND Reputation >= 1000 ORDER BY Reputation DESC LIMIT 15
sede
CREATE TABLE table_13012165_1 ( year VARCHAR, maryland VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year did Easton LL Easton play in Maryland?
SELECT COUNT(year) FROM table_13012165_1 WHERE maryland = "Easton LL Easton"
sql_create_context
CREATE TABLE table_48271 ( "Government" text, "Federal excise tax ( CAD\u00a2 / L )" real, "Total excise tax (CAD\u00a2/L)" real, "Minimum tax incl. sales taxes (CAD\u00a2/L)" real, "Min. tax (CAD\u00a2/US gal)" real ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT AVG("Federal excise tax ( CAD\u00a2 / L )") FROM table_48271 WHERE "Total excise tax (CAD\u00a2/L)" > '33.2' AND "Government" = 'vancouver, bc' AND "Minimum tax incl. sales taxes (CAD\u00a2/L)" < '41.01'
wikisql
CREATE TABLE game ( stadium_id number, id number, season number, date text, home_team text, away_team text, score text, competition text ) CREATE TABLE injury_accident ( game_id number, id number, player text, injury text, number_of_matches text, source text ) C...
SELECT player, number_of_matches, source FROM injury_accident WHERE injury <> 'Knee problem'
spider
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 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 = 'lt heart angiocardiogram') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 58649) AND...
mimic_iii
CREATE TABLE table_9457 ( "Outcome" text, "Date" real, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament has a clay surface ...
SELECT "Tournament" FROM table_9457 WHERE "Surface" = 'clay' AND "Partner" = 'henri leconte' AND "Date" = '1983'
wikisql
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
SELECT FIRST_NAME, SALARY FROM employees ORDER BY SALARY
nvbench
CREATE TABLE table_8101 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text, "Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What county is the St. Augustine bridge in?
SELECT "County" FROM table_8101 WHERE "Location" = 'st. augustine'
wikisql
CREATE TABLE table_name_45 ( winning_driver VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the winning driver for belgian grand prix
SELECT winning_driver FROM table_name_45 WHERE race = "belgian grand prix"
sql_create_context
CREATE TABLE table_60159 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Date has a Location Attendance of reunion arena?
SELECT "Date" FROM table_60159 WHERE "Location Attendance" = 'reunion arena'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, ...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE ((flight.departure_time <= 1600 AND flight.departure_time >= 1200) AND city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH' AND flight.from_airport = airport_service.airport_code) AND flight.airline_code = 'DL'
atis
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE table_57241 ( "Round" real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pole position of the...
SELECT "Pole Position" FROM table_57241 WHERE "Grand Prix" = 'belgian grand prix'
wikisql
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "56" AND procedures.short_title = "Endovasc embol hd/nk ves"
mimicsql_data
CREATE TABLE table_name_57 ( rider VARCHAR, rank VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the rider who has a rank lower than 10, and a time of 1:26.31.20?
SELECT rider FROM table_name_57 WHERE rank < 10 AND time = "1:26.31.20"
sql_create_context
CREATE TABLE table_12002388_1 ( open_cup VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many open cups were hosted in 1993?
SELECT COUNT(open_cup) FROM table_12002388_1 WHERE year = 1993
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), CO...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_64802 ( "Year" real, "Award Ceremony" text, "Category" text, "Nominee" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years was Reasons to be Pretty nominated for best play?
SELECT COUNT("Year") FROM table_64802 WHERE "Category" = 'best play'
wikisql
CREATE TABLE table_1272033_1 ( champion_s_ VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the champions that have won at Aguas Buenas, Puerto Rico?
SELECT champion_s_ FROM table_1272033_1 WHERE location = "Aguas Buenas, Puerto Rico"
sql_create_context
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 lab ( subject_id text, hadm_id text, ...
SELECT procedures.icd9_code FROM procedures WHERE procedures.subject_id = "1875"
mimicsql_data
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, N...
SELECT TIME_TO_STR(CreationDate, '%W') AS dow, TIME_TO_STR(CreationDate, '%A') AS dowName, 1.0 * COUNT(all AS ClosedDate) / COUNT(*) AS fractionThatHaveBeenClosed, (SELECT MAX(CASE WHEN rownum * 1.0 / numrows <= 0.9 THEN Score END) FROM (SELECT Score, ROW_NUMBER() OVER (ORDER BY Score) AS rownum, COUNT(*) OVER (PARTITI...
sede
CREATE TABLE table_name_12 ( nominating_festival VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nominating festival did Russia enter?
SELECT nominating_festival FROM table_name_12 WHERE country = "russia"
sql_create_context
CREATE TABLE table_70223 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The prize of 1,000,000 was given by an event in what city?
SELECT "City" FROM table_70223 WHERE "Prize" = '£1,000,000'
wikisql
CREATE TABLE table_60452 ( "Year" text, "Round" real, "Pick" real, "Overall" real, "Position" text, "NFL team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which NFL team chose a position of DE when the pick was larger than 9, after round 5, a...
SELECT "NFL team" FROM table_60452 WHERE "Overall" > '118' AND "Pick" > '9' AND "Round" > '5' AND "Position" = 'de'
wikisql
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 AVG(age) FROM student WHERE sex = "F"
spider
CREATE TABLE table_57245 ( "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. -- When was the game played where St Kilda was the ...
SELECT "Date" FROM table_57245 WHERE "Home team" = 'st kilda'
wikisql
CREATE TABLE table_1860 ( "Class" text, "Team" text, "103lbs" text, "112lbs" text, "119lbs" text, "125lbs" text, "130lbs" text, "135lbs" text, "140lbs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team included Tallon Ricci (...
SELECT "Team" FROM table_1860 WHERE "103lbs" = 'Tallon Ricci (White Pine)'
wikisql
CREATE TABLE table_60055 ( "Team" text, "Wins" text, "Losses" text, "Points" text, "WPct." text, "G.F." text, "G.A." text, "Assists" text, "Penalties" text, "P.I.M." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What WPct has wi...
SELECT "WPct." FROM table_60055 WHERE "Wins" = 'wins'
wikisql
CREATE TABLE table_name_25 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What the date of the game of the team that plays in princes park?
SELECT date FROM table_name_25 WHERE venue = "princes park"
sql_create_context
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 mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '鲁秀筠' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2002-02-23')
css
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 prescriptions ( row_id number, subject_id number, h...
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'candidias urogenital nec'))
mimic_iii
CREATE TABLE table_66456 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue did the game on september 5, 1998 take place at?
SELECT "Venue" FROM table_66456 WHERE "Date" = 'september 5, 1998'
wikisql
CREATE TABLE table_2260 ( "Episode Number" real, "Episode" text, "Rating" text, "Share" real, "Rating/Share (18-49)" text, "Viewers (millions)" text, "Rank (Timeslot)" text, "Rank (Overall)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT "Rank (Timeslot)" FROM table_2260 WHERE "Rating" = '4.1'
wikisql
CREATE TABLE table_2140071_13 ( external_link VARCHAR, coach VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of external links with a coach named Katie Kansas?
SELECT COUNT(external_link) FROM table_2140071_13 WHERE coach = "Katie Kansas"
sql_create_context
CREATE TABLE table_201_28 ( id number, "name" text, "year" number, "credited with" text, "publisher" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games were credited with a creative director ?
SELECT COUNT("name") FROM table_201_28 WHERE "credited with" = 'creative director'
squall
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE ground_service ...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C...
atis
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(SALARY)
nvbench
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, ro...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_...
atis
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '6929712' AND wdmzjzjlb.JZKSRQ BETWEEN '2014-03-17' AND '2014-10-14' AND wdmzjzjlb.TXBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '6929712' AND bdmzjzjlb.JZKSRQ BETWEEN '2014-03-17' AND '2014-10-14' AND bdmzjzjlb.TXBZ > 0
css
CREATE TABLE table_name_19 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was naomi cavaday the opponent?
SELECT date FROM table_name_19 WHERE opponent = "naomi cavaday"
sql_create_context
CREATE TABLE table_25123 ( "Series #" real, "Season #" real, "Episode title" text, "Written by" text, "Directed by" text, "U.S. viewers (millions)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many u.s. viewer...
SELECT "U.S. viewers (millions)" FROM table_25123 WHERE "Series #" = '83'
wikisql
CREATE TABLE table_74974 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year is the highest one that has a Bronze of south korea, and a Silver of philippines?
SELECT MAX("Year") FROM table_74974 WHERE "Bronze" = 'south korea' AND "Silver" = 'philippines'
wikisql
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.admission_type = "EMERGENCY" AND demographic.days_stay > "11"
mimicsql_data
CREATE TABLE table_16807 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "TV" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game play...
SELECT "Game site" FROM table_16807 WHERE "Record" = '1-3'
wikisql
CREATE TABLE table_204_790 ( id number, "year" number, "nw rank" number, "venue" text, "opp rank" number, "opponent" text, "score" text, "w/l" text, "round" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the...
SELECT "opponent" FROM table_204_790 WHERE "year" = 1984
squall
CREATE TABLE table_43810 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE AWAY TEAM WHEN HOME IS LEEDS UNITED?
SELECT "Away team" FROM table_43810 WHERE "Home team" = 'leeds united'
wikisql
CREATE TABLE table_33931 ( "Model Number" text, "Stepping" text, "Frequency" text, "L2 Cache" text, "Multi 1" text, "V Core" text, "Socket" text, "Release Date" text, "Part Number(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Release Date" FROM table_33931 WHERE "Multi 1" = '10.5×'
wikisql
CREATE TABLE table_55172 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team's score at Windy Hill?
SELECT "Home team score" FROM table_55172 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE table_name_28 ( winning_score VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the winning score in the year 2002?
SELECT winning_score FROM table_name_28 WHERE year = 2002
sql_create_context
CREATE TABLE endowment ( school_id VARCHAR, amount INTEGER ) CREATE TABLE school ( school_name VARCHAR, school_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all the names of schools with an endowment amount smaller than or equal to 10.
SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING SUM(T1.amount) <= 10
sql_create_context
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 course_tags_count ( course_id int, clear_grading int, pop_quiz int, ...
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 '%Recursion Theory%' OR course.description LIKE '%Recursion Theory%' OR course.name LIKE '%Recursi...
advising
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compa...
SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'EA'
atis
CREATE TABLE table_name_15 ( wins VARCHAR, podiums VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins did the team with 5 podiums have?
SELECT wins FROM table_name_15 WHERE podiums = "5"
sql_create_context
CREATE TABLE table_67213 ( "Rank" real, "Airline" text, "Country" text, "Fleet size" real, "Remarks" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Remark of Airline of Dutch Antilles Express?
SELECT "Remarks" FROM table_67213 WHERE "Airline" = 'dutch antilles express'
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Phenytoin"
mimicsql_data