instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_20688030_1 ( mccain_percentage VARCHAR, obama_percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are McCain's Percent when Obama has 36.47%?
SELECT mccain_percentage FROM table_20688030_1 WHERE obama_percentage = "36.47%"
sql_create_context
CREATE TABLE table_66704 ( "Year" text, "Births (000s)" real, "Deaths" real, "Natural Growth" real, "Total Fertility Rate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the amount of deaths that had a natural growth smaller than 3.4, and a...
SELECT "Deaths" FROM table_66704 WHERE "Natural Growth" < '3.4' AND "Total Fertility Rate" = '1.63'
wikisql
CREATE TABLE table_62004 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text, "Winner's share ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What winning score has in-ky...
SELECT "Winning score" FROM table_62004 WHERE "Runner(s)-up" = 'in-kyung kim'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road
nvbench
CREATE TABLE film ( film_id number, rank_in_series number, number_in_season number, title text, directed_by text, original_air_date text, production_code text ) CREATE TABLE schedule ( cinema_id number, film_id number, date text, show_times_per_day number, price number )...
SELECT T2.name, SUM(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id
spider
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "20" AND prescriptions.formulary_drug_cd = "IPRA2H"
mimicsql_data
CREATE TABLE table_name_18 ( social_software VARCHAR, charting VARCHAR, discussion VARCHAR, time_tracking VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE SOCIAL SOFTWARE WITH NO DISCUSSION, NO TIME TRACKING, AND NO CHARTING?
SELECT social_software FROM table_name_18 WHERE discussion = "no" AND time_tracking = "no" AND charting = "no"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2121" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT ((TIME_TO_STR(Posts.CreationDate, '%W')) + (TIME_TO_STR(Posts.CreationDate, '%h')) / 24.0) AS HourOfWeek, COUNT(Posts.Id) AS Questions FROM Posts WHERE PostTypeId = 1 GROUP BY TIME_TO_STR(Posts.CreationDate, '%W'), TIME_TO_STR(Posts.CreationDate, '%h') ORDER BY HourOfWeek
sede
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id nu...
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73423) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
CREATE TABLE table_724 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the incumbent where the district is florida 9?
SELECT "Incumbent" FROM table_724 WHERE "District" = 'Florida 9'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, O...
WITH a AS (SELECT pa.Score, pq.CreationDate AS question_date, pa.CreationDate AS answer_date, DATEDIFF(day, pq.CreationDate, CreationDate) AS daydiff FROM Posts AS pa JOIN Posts AS pq ON pa.ParentId = pq.Id) SELECT daydiff, AVG(1.00 * Score) AS quality FROM a WHERE daydiff >= 0 AND daydiff <= 300 GROUP BY daydiff ORDER...
sede
CREATE TABLE table_46647 ( "Pick" real, "Player" text, "Nationality" text, "New WNBA Team" text, "Former WNBA Team" text, "College/Country/Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player is from Connecticut?
SELECT "Player" FROM table_46647 WHERE "College/Country/Team" = 'connecticut'
wikisql
CREATE TABLE table_21566 ( "1391 Carelia" text, "1398 Donnera" text, "1405 Sibelius" text, "1406 Komppa" text, "1407 Lindel\u00f6f" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the 1406 komppa of asteroid which 1391 carelia is 1460 haltia
SELECT "1406 Komppa" FROM table_21566 WHERE "1391 Carelia" = '1460 Haltia'
wikisql
CREATE TABLE table_204_909 ( id number, "pollutant" text, "units" text, "emission standard" number, "coal-fired" text, "petroleum coke-fired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- at most part , how many emission standards are equal to ...
SELECT COUNT("emission standard") FROM table_204_909 WHERE "emission standard" = '≤ 1.1'
squall
CREATE TABLE table_73343 ( "Team" text, "Stadium" text, "Match played" text, "Highest" real, "Lowest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has a match played of 10 4?
SELECT "Team" FROM table_73343 WHERE "Match played" = '10 4'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
SELECT CAST(N'2016-03-08T08:00:00' AS DATETIME)
sede
CREATE TABLE table_46367 ( "Year" real, "Show" text, "Season" real, "Episode" text, "Episode number" real, "Original airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Episode Number, when Original Airdate is March 21, 2...
SELECT AVG("Episode number") FROM table_46367 WHERE "Original airdate" = 'march 21, 2010' AND "Season" < '3'
wikisql
CREATE TABLE table_name_2 ( venue VARCHAR, round VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Round of gs, and a Result of 0 3?
SELECT venue FROM table_name_2 WHERE round = "gs" AND result = "0–3"
sql_create_context
CREATE TABLE table_name_42 ( producer_s_ VARCHAR, recipient VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which producer worked for Animus Films LTD?
SELECT producer_s_ FROM table_name_42 WHERE recipient = "animus films ltd"
sql_create_context
CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE market ( Mar...
SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY Studio
nvbench
CREATE TABLE table_29792 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code(s)" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "U.S. viewers (millions)" FROM table_29792 WHERE "Directed by" = 'Michael Lembeck'
wikisql
CREATE TABLE table_name_82 ( try_bonus VARCHAR, tries_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With 37 tries against, what is the try bonus?
SELECT try_bonus FROM table_name_82 WHERE tries_against = "37"
sql_create_context
CREATE TABLE table_203_345 ( id number, "name" text, "party" text, "took office" number, "left office" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the last representative to take office ?
SELECT "name" FROM table_203_345 ORDER BY "took office" DESC LIMIT 1
squall
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE STUDENT ...
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_16 ( matches VARCHAR, clubs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Matches, when Clubs is 588 406?
SELECT COUNT(matches) FROM table_name_16 WHERE clubs = "588 → 406"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT meter_400, ID FROM swimmer ORDER BY ID DESC
nvbench
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 LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
CREATE TABLE table_name_83 ( week INTEGER, attendance VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Week of the game with an Attendance of 64,900 and a Result of L 34-13?
SELECT MAX(week) FROM table_name_83 WHERE attendance = "64,900" AND result = "l 34-13"
sql_create_context
CREATE TABLE table_70730 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Hole" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the To par has the presence of Vijay Singh?
SELECT "To par" FROM table_70730 WHERE "Player" = 'vijay singh'
wikisql
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of everybody who has exactly on...
SELECT name FROM personfriend GROUP BY name HAVING COUNT(*) = 1
spider
CREATE TABLE table_name_37 ( in_service INTEGER, aircraft VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Antonov An-2 Colt aircraft are in service?
SELECT AVG(in_service) FROM table_name_37 WHERE aircraft = "antonov an-2 colt"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (((flight.arrival_time <= 1730 AND flight.arrival_time >= 1630) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICAGO' AND flight.to...
atis
CREATE TABLE table_57816 ( "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. -- Who is the opponent in the Tournament of Lahore final?
SELECT "Opponent in the final" FROM table_57816 WHERE "Tournament" = 'lahore'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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 varc...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE key...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'crowdsourcing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename = 'acl'
scholar
CREATE TABLE table_34195 ( "Club" text, "Nickname" text, "Years in Competition" text, "No. of Premierships" real, "Premiership Years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Years in competition that had a Premiership of 1982, 19...
SELECT "Years in Competition" FROM table_34195 WHERE "Premiership Years" = '1982, 1984, 1999, 2002-03, 2008-09-10'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id ...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88191 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
mimic_iii
CREATE TABLE table_204_649 ( id number, "rank" number, "name" text, "image" number, "height\nft (m)" text, "floors" number, "year" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when the key tower was built in 1991 , what...
SELECT "name" FROM table_204_649 WHERE "year" < 1991 ORDER BY "height\nft (m)" DESC LIMIT 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalp...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59871' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-250695')) AND intakeoutput.celllabel = 'outp...
eicu
CREATE TABLE table_name_92 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What scored is recorded on April 24?
SELECT score FROM table_name_92 WHERE date = "april 24"
sql_create_context
CREATE TABLE table_name_14 ( matches VARCHAR, lose VARCHAR, draw VARCHAR, lost_point VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the total number of matches for draw less than 7 and lost point of 16 with lose more than 4
SELECT COUNT(matches) FROM table_name_14 WHERE draw < 7 AND lost_point = 16 AND lose > 4
sql_create_context
CREATE TABLE table_17780 ( "Day (see Irregularities )" text, "Monday First Day" text, "Tuesday Second Day" text, "Wednesday Third Day" text, "Thursday Fourth Day" text, "Friday Fifth Day" text, "Saturday Sixth Day" text, "Sunday Seventh Day" text ) -- Using valid SQLite, answer the fol...
SELECT "Thursday Fourth Day" FROM table_17780 WHERE "Day (see Irregularities )" = 'Slovene'
wikisql
CREATE TABLE table_name_38 ( overall INTEGER, name VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average overall of John Ayres, who had a pick # greater than 4?
SELECT AVG(overall) FROM table_name_38 WHERE name = "john ayres" AND pick__number > 4
sql_create_context
CREATE TABLE table_1137707_2 ( date VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the circuit gilles villeneuve?
SELECT date FROM table_1137707_2 WHERE location = "Circuit Gilles Villeneuve"
sql_create_context
CREATE TABLE table_11545282_11 ( position VARCHAR, years_for_jazz VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position for the years 1998-99
SELECT position FROM table_11545282_11 WHERE years_for_jazz = "1998-99"
sql_create_context
CREATE TABLE table_name_54 ( theme VARCHAR, year VARCHAR, artist VARCHAR, issue_price VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Theme of Christie Paquet after 2004 with an Issue Price of $34.95?
SELECT theme FROM table_name_54 WHERE artist = "christie paquet" AND issue_price = "$34.95" AND year > 2004
sql_create_context
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 demographic.admittime FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_12641 ( "South West DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Against, when Wins is greater than 8, and when Losses is greater...
SELECT SUM("Against") FROM table_12641 WHERE "Wins" > '8' AND "Losses" > '6'
wikisql
CREATE TABLE table_59730 ( "Name (year commissioned)" text, "Owner/operator" text, "Length" text, "Maximum diameter" text, "From/to" text, "Licence number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the owner operator who has license ...
SELECT "Owner/operator" FROM table_59730 WHERE "Licence number" = 'pl 59'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_...
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC
nvbench
CREATE TABLE table_18483171_1 ( institution VARCHAR, team_nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all institutions with a team name of the Cardinals.
SELECT institution FROM table_18483171_1 WHERE team_nickname = "Cardinals"
sql_create_context
CREATE TABLE table_22390 ( "Episode" text, "Garfield Episode 1" text, "U.S. Acres Episode" text, "Garfield Episode 2" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the US Acres episode following the Garf...
SELECT "U.S. Acres Episode" FROM table_22390 WHERE "Garfield Episode 1" = 'Robodie II'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
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.icd9_code = "59080" AND prescriptions.route = "NEB"
mimicsql_data
CREATE TABLE table_15463188_17 ( school_club_team VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school/club team has a player named Mark Sanford?
SELECT school_club_team FROM table_15463188_17 WHERE name = "Mark Sanford"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '01374197' AND t_kc21.MED_SER_ORG_NO = '5447381' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%紫癜%'
css
CREATE TABLE table_20195922_3 ( prize__eur_ VARCHAR, number_of_winning_tickets VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the prizes when 1 is the number of winning tickets?
SELECT prize__eur_ FROM table_20195922_3 WHERE number_of_winning_tickets = 1
sql_create_context
CREATE TABLE table_55789 ( "Ordinary income rate" text, "Long-term capital gain rate" text, "Short-term capital gain rate" text, "Long-term gain on commercial buildings*" text, "Long-term gain on collectibles" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Long-term gain on collectibles" FROM table_55789 WHERE "Ordinary income rate" = '15%'
wikisql
CREATE TABLE table_name_67 ( player VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player with a t8 place?
SELECT player FROM table_name_67 WHERE place = "t8"
sql_create_context
CREATE TABLE table_23248 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When ellery and frankie are the couple what is the highest tot...
SELECT MAX("Total") FROM table_23248 WHERE "Couple" = 'Ellery and Frankie'
wikisql
CREATE TABLE table_46824 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the label in the region of Canada?
SELECT "Label" FROM table_46824 WHERE "Region" = 'canada'
wikisql
CREATE TABLE table_name_21 ( density_per_km² INTEGER, number__map_ VARCHAR, area_in_km² VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Density per km is the lowest one that has a Number (map) smaller than 13, and an Area in km of 11.1?
SELECT MIN(density_per_km²) FROM table_name_21 WHERE number__map_ < 13 AND area_in_km² = 11.1
sql_create_context
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON 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 AND jybgb.YLJGDM = jybgb_jyjgzbb.Y...
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "50" AND diagnoses.long_title = "Coronary atherosclerosis of native coronary artery"
mimicsql_data
CREATE TABLE table_203_701 ( id number, "#" number, "title" text, "featured guest(s)" text, "producer(s)" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what track was next after all i got ?
SELECT "title" FROM table_203_701 WHERE "#" = (SELECT "#" FROM table_203_701 WHERE "title" = '"all i got"') + 1
squall
CREATE TABLE table_47364 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Visitor is 'Pittsburgh', and when Points is grea...
SELECT "Score" FROM table_47364 WHERE "Visitor" = 'pittsburgh' AND "Points" > '18'
wikisql
CREATE TABLE table_name_14 ( manager VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which manager has Manchester City as the team?
SELECT manager FROM table_name_14 WHERE team = "manchester city"
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY Sex
nvbench
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 text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 hz_info.RYBH = '61732704' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_name_16 ( ends_lost INTEGER, stolen_ends_for VARCHAR, stolen_ends_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest ends lost when the stolen ends for is less than 13, and stolten ends against is 6?
SELECT MIN(ends_lost) FROM table_name_16 WHERE stolen_ends_for < 13 AND stolen_ends_against = 6
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '021-111547' AND patient.unitdischargetime IS NULL
eicu
CREATE TABLE table_2248991_2 ( gdp_per_capita VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many items are listed under gdp per capita under the nation of Burkina Faso?
SELECT COUNT(gdp_per_capita) FROM table_2248991_2 WHERE nation = "Burkina Faso"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 8098 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hemodod...
mimic_iii
CREATE TABLE table_name_55 ( time VARCHAR, owner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time contains the owner of maine chance farm?
SELECT time FROM table_name_55 WHERE owner = "maine chance farm"
sql_create_context
CREATE TABLE table_18946749_2 ( col__m_ INTEGER, peak VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the col (m) of the Barurumea Ridge peak?
SELECT MAX(col__m_) FROM table_18946749_2 WHERE peak = "Barurumea Ridge"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2150" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Bethanechol"
mimicsql_data
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
SELECT COUNT(*) FROM PostFeedback
sede
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.gender = "F" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
mimicsql_data
CREATE TABLE table_name_30 ( gold INTEGER, nation VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With less than 7 Silver medals, how many Gold medals did Canada receive?
SELECT MAX(gold) FROM table_name_30 WHERE nation = "canada" AND silver < 7
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "53190"
mimicsql_data
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 txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '柏慧艳' AND hz_info.YLJGDM = '0564335' AND txmzjzjlb.JZKSMC LIKE '%免疫科%' UNION SELECT ftxmzjzjlb...
css
CREATE TABLE table_name_73 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What home team played against Footscray as the away team?
SELECT home_team FROM table_name_73 WHERE away_team = "footscray"
sql_create_context
CREATE TABLE table_27581 ( "Player" text, "Games Played" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every value for points if rebounds is 6 and blocks ...
SELECT "Points" FROM table_27581 WHERE "Rebounds" = '6' AND "Blocks" = '0'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE SuggestedEdits ( Id n...
SELECT ROUND(AVG(CASE WHEN QuestionScore < HighestAnswerScore THEN 100.0 ELSE 0.0 END), 2) AS "Percentage" FROM (SELECT q.Id, MAX(q.Score) AS QuestionScore, MAX(a.Score) AS HighestAnswerScore FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id GROUP BY q.Id) AS Scores
sede
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Fate, COUNT(Fate) FROM mission GROUP BY Fate ORDER BY COUNT(Fate)
nvbench
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2162" AND procedures.short_title = "Left heart cardiac cath"
mimicsql_data
CREATE TABLE table_24244 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the outcomes of matches with bill tilden florence...
SELECT "Outcome" FROM table_24244 WHERE "Opponents" = 'Bill Tilden Florence Ballin'
wikisql
CREATE TABLE table_75362 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points have a Score of 4 1, and a Record of 18 10 8 1, and a January larger than ...
SELECT AVG("Points") FROM table_75362 WHERE "Score" = '4–1' AND "Record" = '18–10–8–1' AND "January" > '2'
wikisql
CREATE TABLE table_37218 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of birth for the player from Ulster and plays at Centre position?
SELECT "Date of Birth (Age)" FROM table_37218 WHERE "Club/province" = 'ulster' AND "Position" = 'centre'
wikisql
CREATE TABLE table_32614 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Matches" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest rank for championships with christy heffernan with...
SELECT MAX("Rank") FROM table_32614 WHERE "Player" = 'christy heffernan' AND "Matches" > '4'
wikisql
CREATE TABLE table_train_40 ( "id" int, "bone_marrow_transplant" bool, "organ_transplantation" bool, "systolic_blood_pressure_sbp" int, "do_not_resuscitate_dnr" bool, "autoimmune_disease" bool, "steroid_therapy" bool, "intention_to_central_venous_catheter" bool, "hematologic_disease"...
SELECT * FROM table_train_40 WHERE intention_to_central_venous_catheter = 0
criteria2sql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLic...
SELECT Id, Score, Title FROM Posts WHERE Tags LIKE '%<row>%' AND ClosedDate IS NULL AND Score < 0 ORDER BY Score
sede
CREATE TABLE table_1040 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least amount of touchdowns scored on th...
SELECT MIN("Touchdowns") FROM table_1040
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
SELECT SUM(q.ViewCount) AS views, q.Id AS "post_link", a.Score FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##userid##' HAVING SUM(q.ViewCount) > 1000 ORDER BY views DESC
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 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.discharge_location = "HOME HEALTH CARE" AND demographic.age < "41"
mimicsql_data
CREATE TABLE table_39386 ( "Year" real, "Championship" text, "54 holes" text, "Winning score" text, "Margin" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Winning score in 1956?
SELECT "Winning score" FROM table_39386 WHERE "Year" = '1956'
wikisql
CREATE TABLE table_43055 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Assists" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Games for Rank 2 Terrell McIntyre?
SELECT MIN("Games") FROM table_43055 WHERE "Name" = 'terrell mcintyre' AND "Rank" > '2'
wikisql