instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
SELECT ID, meter_100 FROM swimmer
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
SELECT zyjybgb.BBDM, zyjybgb.BBMC, zyjybgb.BBZT FROM zyjybgb WHERE zyjybgb.BGDH = '63566626307' UNION SELECT mzjybgb.BBDM, mzjybgb.BBMC, mzjybgb.BBZT FROM mzjybgb WHERE mzjybgb.BGDH = '63566626307'
css
CREATE TABLE table_dev_40 ( "id" int, "tc" int, "ldl_cholesterol" int, "systolic_blood_pressure_sbp" int, "untreated_hyperlipidemia" bool, "hemoglobin_a1c_hba1c" float, "platelets" int, "neutropenia" int, "thrombocytopenia" float, "diastolic_blood_pressure_dbp" int, "tgc" int...
SELECT * FROM table_dev_40 WHERE fasting_serum_lipoprotein = 1 OR ldl_cholesterol > 160 OR triglyceride_tg > 500
criteria2sql
CREATE TABLE table_50620 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament is on 18 May 1992?
SELECT "Tournament" FROM table_50620 WHERE "Date" = '18 may 1992'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID
nvbench
CREATE TABLE table_name_83 ( supercopa_sudamericana_1992 VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Supercopa Sudamericana 1992 has a Team of santos?
SELECT supercopa_sudamericana_1992 FROM table_name_83 WHERE team = "santos"
sql_create_context
CREATE TABLE debate_people ( debate_id number, affirmative number, negative number, if_affirmative_win others ) CREATE TABLE people ( people_id number, district text, name text, party text, age number ) CREATE TABLE debate ( debate_id number, date text, venue text, ...
SELECT DISTINCT venue FROM debate
spider
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description t...
SELECT COUNT(*) AS PostsLastMonth, 3 AS Moderators, (COUNT(*) / 3) AS PostsLastMonthPerMod FROM Posts WHERE LastActivityDate >= DATEADD(month, -1, (SELECT MAX(LastActivityDate) FROM Posts))
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "GREEK ORTHODOX" AND demographic.admityear < "2203"
mimicsql_data
CREATE TABLE table_name_88 ( make VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the make for the year 2008?
SELECT make FROM table_name_88 WHERE year = 2008
sql_create_context
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 prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2700) AND prescriptions.drug = 'dexamethasone' AND STRFTIME('%y-%m', prescriptions.startdate) = '2100-12' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ...
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 58932 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight i...
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, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city...
atis
CREATE TABLE table_name_16 ( react INTEGER, time VARCHAR, rank VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Reaction has a Rank smaller than 4, and a Nationality of trinidad and tobago, and a Time larger than 45.13?
SELECT AVG(react) FROM table_name_16 WHERE rank < 4 AND nationality = "trinidad and tobago" AND time > 45.13
sql_create_context
CREATE TABLE table_204_859 ( id number, "year" number, "seniors (trood award & rodda medal)" text, "reserves (rex hartley medal)" text, "under 18's (bruce wilkinson medal)" text, "under 16's (shaw/carter medal)" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT "seniors (trood award & rodda medal)" FROM table_204_859 WHERE "year" = 1985
squall
CREATE TABLE table_49515 ( "Poll Source" text, "Dates administered" text, "Democrat: Vivian Davis Figures" text, "Republican: Jeff Sessions" text, "Lead Margin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date administered when Vivian...
SELECT "Dates administered" FROM table_49515 WHERE "Democrat: Vivian Davis Figures" = '37%'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_NM = '中医推拿科' AND STA_DATE BETWEEN '2021-03-30' AND '2021-10-14' AND SOC_SRT_DIRE_NM = '托吡酯片(薄膜衣)'
css
CREATE TABLE table_name_74 ( score VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has an Event of constructionjobs.com classic?
SELECT score FROM table_name_74 WHERE event = "constructionjobs.com classic"
sql_create_context
CREATE TABLE table_name_16 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result in 2011 for the French Open tournament?
SELECT 2011 FROM table_name_16 WHERE tournament = "french open"
sql_create_context
CREATE TABLE table_40968 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a School/Club Team of Illinois?
SELECT "Player" FROM table_40968 WHERE "School/Club Team" = 'illinois'
wikisql
CREATE TABLE table_13750 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which lane did the swimmer with a time of 1:58.44 swim?
SELECT COUNT("Lane") FROM table_13750 WHERE "Time" = '1:58.44'
wikisql
CREATE TABLE table_43209 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Don't Forget the Lyrics aired at 8:30 what aired at 9:00?
SELECT "9:00" FROM table_43209 WHERE "8:30" = 'don''t forget the lyrics'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.age < "74"
mimicsql_data
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY Country DESC
nvbench
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) ...
SELECT COUNT(DISTINCT p_q.Id) FROM Posts AS p_a INNER JOIN Posts AS p_q ON p_q.Id = p_a.ParentId AND p_q.PostTypeId = 1 AND p_q.ClosedDate IS NULL WHERE p_a.PostTypeId = 2 AND (p_a.Score > 0 OR p_a.Id = p_q.AcceptedAnswerId)
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 =...
eicu
CREATE TABLE table_name_14 ( no_s_ INTEGER, years_for_rockets VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of years for the Houston Rockets 2004-05?
SELECT AVG(no_s_) FROM table_name_14 WHERE years_for_rockets = "2004-05"
sql_create_context
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id WHERE (student_rec...
advising
CREATE TABLE table_59506 ( "School" text, "Suburb/Town" text, "Years" text, "Founded" real, "Website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which website is located in Albury and has a school of Albury High School?
SELECT "Website" FROM table_59506 WHERE "Suburb/Town" = 'albury' AND "School" = 'albury high school'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, ...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42757) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') AND labevents.charttime = '2102-11-07 05:01:00') - (SEL...
mimic_iii
CREATE TABLE table_19371 ( "Team" text, "Average" text, "Points" real, "Played" real, "1986-87" text, "1987-88" text, "1988-89" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- list the number of matches played by the teams that got an average...
SELECT "1986-87" FROM table_19371 WHERE "Average" = '1.079'
wikisql
CREATE TABLE table_73533 ( "Episode" text, "First broadcast" text, "Seans team" text, "Jasons team" text, "Scores" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In how many episodes did Sean's team include Jeremy Clarkson and James McQuillan?
SELECT COUNT("Episode") FROM table_73533 WHERE "Seans team" = 'Jeremy Clarkson and James McQuillan'
wikisql
CREATE TABLE table_54103 ( "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 did home team score at glenferrie oval?
SELECT "Home team score" FROM table_54103 WHERE "Venue" = 'glenferrie oval'
wikisql
CREATE TABLE table_name_85 ( a_league VARCHAR, pre_season INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much A-League has a Pre-Season larger than 0?
SELECT COUNT(a_league) FROM table_name_85 WHERE pre_season > 0
sql_create_context
CREATE TABLE table_name_2 ( name VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the player taken in round 23?
SELECT name FROM table_name_2 WHERE round = 23
sql_create_context
CREATE TABLE table_11012 ( "Episode #" text, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the episode written by David J. Burke?
SELECT "Title" FROM table_11012 WHERE "Written by" = 'david j. burke'
wikisql
CREATE TABLE table_26136228_3 ( episode_no INTEGER, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode number in the season had 1.05 million U.S. viewers?
SELECT MAX(episode_no) FROM table_26136228_3 WHERE us_viewers__millions_ = "1.05"
sql_create_context
CREATE TABLE table_59405 ( "State" text, "Born/Died" text, "Active service" text, "Chief Judge" text, "Senior status" text, "Appointed by" text, "Reason for termination" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Senior status has ...
SELECT "Senior status" FROM table_59405 WHERE "Chief Judge" = '1991–1995'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT COUNT(p.Id) FROM Posts AS p INNER JOIN PostTags AS pt ON pt.TagId = @TagId WHERE pt.PostId = p.Id AND p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL
sede
CREATE TABLE table_27688 ( "Country" text, "Contestant" text, "Age" real, "Height (cm)" real, "Height (ft)" text, "Hometown" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country was Danissa Zurek from?
SELECT "Country" FROM table_27688 WHERE "Contestant" = 'Danissa Zurek'
wikisql
CREATE TABLE table_1780 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Written by" FROM table_1780 WHERE "U.S. viewers (million)" = '3.03'
wikisql
CREATE TABLE table_name_58 ( appearances INTEGER, bronze_medals INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average amount of appearances for the Bronze Meals less than 0?
SELECT AVG(appearances) FROM table_name_58 WHERE bronze_medals < 0
sql_create_context
CREATE TABLE table_40853 ( "Republican ticket" text, "Democratic ticket" text, "American Labor ticket" text, "Communist ticket" text, "Socialist ticket" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the Republican ticket with a Democratic tic...
SELECT "Republican ticket" FROM table_40853 WHERE "Democratic ticket" = 'matthew j. merritt'
wikisql
CREATE TABLE manufacturer ( Num_of_Factories INTEGER, num_of_shops INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the average number of factories for the manufacturers that have more than 20 shops.
SELECT AVG(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pulmonary aspiration' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1 JOIN (SELECT patient.uniqu...
eicu
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE venue ( venueid int, venue...
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'li dong' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_44098 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Place of t1, and a Player of hubert green?
SELECT AVG("Score") FROM table_44098 WHERE "Place" = 't1' AND "Player" = 'hubert green'
wikisql
CREATE TABLE table_name_86 ( drawn INTEGER, played VARCHAR, tries VARCHAR, _percentage_won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average draws for a player larger than 16 with more than 1 tries and a win percentage smaller than 5...
SELECT AVG(drawn) FROM table_name_86 WHERE tries > 1 AND _percentage_won < 56.15 AND played > 16
sql_create_context
CREATE TABLE table_name_73 ( crew VARCHAR, end_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the crew with the end time of 21:11?
SELECT crew FROM table_name_73 WHERE end_time = "21:11"
sql_create_context
CREATE TABLE table_5818 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponent in the final has rockford, Illinois as the tournament?
SELECT "Opponent in the final" FROM table_5818 WHERE "Tournament" = 'rockford, illinois'
wikisql
CREATE TABLE table_name_82 ( position VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does the player from Mississippi state play?
SELECT position FROM table_name_82 WHERE college = "mississippi state"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSMC = '头颈肿瘤科' AND mzjzjlb.JZKSRQ BETWEEN '2014-12-31' AND '2021-01-18'
css
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Na...
SELECT * FROM Posts WHERE Id = 45551035
sede
CREATE TABLE table_59289 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Score is '80-79'?
SELECT "Date" FROM table_59289 WHERE "Score" = '80-79'
wikisql
CREATE TABLE airport ( country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many airports are there in each country?
SELECT COUNT(*), country FROM airport GROUP BY country
sql_create_context
CREATE TABLE teachers ( lastname text, firstname text, classroom number ) CREATE TABLE list ( lastname text, firstname text, grade number, classroom number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the first names of all the students i...
SELECT DISTINCT firstname FROM list WHERE classroom = 107
spider
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '94975740' AND hz_info.YLJGDM = '0156079' AND zyjzjlb.JZKSMC LIKE '%重症%'
css
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE zyb ( 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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '29201885' AND t_kc22.STA_DATE BETWEEN '2014-05-23' AND '2016-12-27' AND t_kc22.SOC_SRT_DIRE_NM = '香砂养胃丸' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '2...
css
CREATE TABLE table_name_30 ( date VARCHAR, ship_type VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was a brig type ship located in SW Approaches?
SELECT date FROM table_name_30 WHERE ship_type = "brig" AND location = "sw approaches"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
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 = 'd & c nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17398 AND NOT admissions.dischtime IS NUL...
mimic_iii
CREATE TABLE table_name_34 ( season INTEGER, super_g VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the oldest season that had a listed Super G score of 33?
SELECT MIN(season) FROM table_name_34 WHERE super_g = "33"
sql_create_context
CREATE TABLE Products ( product_id INTEGER, product_details VARCHAR(255) ) CREATE TABLE Customer_Contact_Channels ( customer_id INTEGER, channel_code VARCHAR(15), active_from_date DATETIME, active_to_date DATETIME, contact_number VARCHAR(50) ) CREATE TABLE Addresses ( address_id INTEGE...
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer)
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 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hx of colonic malignancy" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE table_46463 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the sum of Grid that has the Time of +6.355, and the Laps larger than 23?
SELECT SUM("Grid") FROM table_46463 WHERE "Time" = '+6.355' AND "Laps" > '23'
wikisql
CREATE TABLE table_26440 ( "No. by series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production number" real, "U.S. viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the ...
SELECT "Directed by" FROM table_26440 WHERE "Title" = 'Hell Hath No Fury'
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_name_53 ( kickoff VARCHAR, game_site VARCHAR, nflcom_recap VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the kickoff that has a NFL.com recap, is played before week 17, and is played at arrowhead stadium?
SELECT kickoff FROM table_name_53 WHERE nflcom_recap = "recap" AND week < 17 AND game_site = "arrowhead stadium"
sql_create_context
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 d_labitems ( row_id number, itemid number, label te...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 570 AND instructor.name LIKE '%Jesse Gregory%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_i...
advising
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
SELECT MyAnswers.Id AS AnswerID, p.Id AS QuestionID, p.CreationDate, p.ViewCount, p.Tags FROM Posts AS p INNER JOIN (SELECT Id, ParentId FROM Posts WHERE Id IN (25210096, 25222542, 25240280, 25233555, 25307353, 25310175)) AS MyAnswers ON p.Id = MyAnswers.ParentId
sede
CREATE TABLE table_203_306 ( id number, "no." number, "title" text, "directed by" text, "written by" text, "original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many episodes were directed by perry lang
SELECT COUNT("title") FROM table_203_306 WHERE "directed by" = 'perry lang'
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132' AND patient.hospitaldischargetime IS NULL)) AND me...
eicu
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND 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 = jy...
css
CREATE TABLE table_2803106_1 ( tonioli VARCHAR, week__number VARCHAR, dixon VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On week 11 when Dixon scored an 8, what was tonioli's score?
SELECT tonioli FROM table_2803106_1 WHERE week__number = 11 AND dixon = "8"
sql_create_context
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE >= 17)
css
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 = "Regional enteritis NOS" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE table_name_6 ( chef VARCHAR, restaurant_name VARCHAR, location VARCHAR, original_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What chef that has a location in Toronto, ON, that has n/a as the original name, and a Restaurant Name o...
SELECT chef FROM table_name_6 WHERE location = "toronto, on" AND original_name = "n/a" AND restaurant_name = "bagel world"
sql_create_context
CREATE TABLE table_name_65 ( record VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record for the game attended by 35,614 spectators?
SELECT record FROM table_name_65 WHERE attendance = "35,614"
sql_create_context
CREATE TABLE table_3785 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team's rcord on february 1?
SELECT "Record" FROM table_3785 WHERE "February" = '1'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-22202')) AND NOT vitalperiodic.heartrate IS NUL...
eicu
CREATE TABLE table_name_68 ( gold VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Gold has the Year of 1994?
SELECT gold FROM table_name_68 WHERE year = 1994
sql_create_context
CREATE TABLE table_3901 ( "Standard" text, "Date" text, "CO (g/kWh)" text, "NO x (g/kWh)" text, "HC (g/kWh)" text, "PM (g/kWh)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different standards have a PM of 0.02 g/kWh?
SELECT COUNT("Standard") FROM table_3901 WHERE "PM (g/kWh)" = '0.02'
wikisql
CREATE TABLE table_18745 ( "Frequency" text, "Call sign" text, "Name" text, "Format" text, "Owner" text, "Target city/ market" text, "City of license" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What station has the call number K213cl
SELECT "Format" FROM table_18745 WHERE "Call sign" = 'K213CL'
wikisql
CREATE TABLE table_204_593 ( id number, "year" text, "chairperson" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many years did shilpa bendi serve ?
SELECT "year" - "year" FROM table_204_593 WHERE "chairperson" = 'shilpa bendi'
squall
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'bethel island' AND location.street_name = 'bethel island rd' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_16432543_1 ( nickname VARCHAR, established VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Nickname of the school established in 1773
SELECT nickname FROM table_16432543_1 WHERE established = 1773
sql_create_context
CREATE TABLE table_14903627_1 ( mens_doubles VARCHAR, womens_doubles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT ARE THE NAMES OF THE MENS DOUBLES WHEN THE WOMENS DOUBLES WAS PIRET HAMER HELEN REINO?
SELECT mens_doubles FROM table_14903627_1 WHERE womens_doubles = "Piret Hamer Helen Reino"
sql_create_context
CREATE TABLE table_74696 ( "Player" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many drops did Nicky Little have in Hong Kong?
SELECT "Drop" FROM table_74696 WHERE "Player" = 'nicky little' AND "Venue" = 'hong kong'
wikisql
CREATE TABLE table_41247 ( "Event" text, "2006\u201307" text, "2007\u201308" text, "2008\u201309" text, "2009\u201310" text, "2010\u201311" text, "2011\u201312" text, "2012\u201313" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT "2008\u201309" FROM table_41247 WHERE "2011\u201312" = 'qf'
wikisql
CREATE TABLE table_name_66 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team's score at corio oval?
SELECT home_team AS score FROM table_name_66 WHERE venue = "corio oval"
sql_create_context
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '59339462' AND gwyjzb.IN_HOSP_DATE BETWEEN '2011-07-29' AND '2015-01-31' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '59339462' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2011-07-29' AND '2015-01-31' AND fgwyjzb.CLINIC_TYPE = '住院...
css
CREATE TABLE table_name_51 ( year INTEGER, country_territory VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average year lebanon won?
SELECT AVG(year) FROM table_name_51 WHERE country_territory = "lebanon"
sql_create_context
CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, personal_name text, middle_name text, family_name text ) CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE student_course_e...
SELECT T1.student_id, T2.login_name FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1
spider
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 demographic.language FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE table_23705 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Spanish title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the director of the film that was not nominated and had t...
SELECT "Director" FROM table_23705 WHERE "Result" = 'Not Nominated' AND "Spanish title" = 'Play'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '67375587183') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '67375587183') AND JCZBJGDL <= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '67375587183')
css
CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty ( facid number, lname text, fname text, ran...
SELECT COUNT(DISTINCT facid) FROM faculty_participates_in
spider
CREATE TABLE table_79896 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the game when the record was 22-13?
SELECT "Opponent" FROM table_79896 WHERE "Record" = '22-13'
wikisql
CREATE TABLE table_name_7 ( avg VARCHAR, long VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average for the RB with an 8 yard long?
SELECT COUNT(avg) FROM table_name_7 WHERE long = 8
sql_create_context