instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.itemid = "51269"
mimicsql_data
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(...
SELECT T1.dept_name, COUNT(DISTINCT T3.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T3.ID)
nvbench
CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE teaches ( ID varchar(5), cours...
SELECT building, MAX(capacity) FROM classroom GROUP BY building ORDER BY MAX(capacity)
nvbench
CREATE TABLE table_19762 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record when the game was played at Cleveland Munic...
SELECT "Record" FROM table_19762 WHERE "Game Site" = 'Cleveland Municipal Stadium'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co...
advising
CREATE TABLE table_36675 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Bronze has a Nation of canada, and a Rank smaller than 6?
SELECT AVG("Bronze") FROM table_36675 WHERE "Nation" = 'canada' AND "Rank" < '6'
wikisql
CREATE TABLE table_name_23 ( laps INTEGER, time_retired VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average lap time for retired time of +23.707 and a Grid greater than 21?
SELECT AVG(laps) FROM table_name_23 WHERE time_retired = "+23.707" AND grid > 21
sql_create_context
CREATE TABLE table_train_96 ( "id" int, "gender" string, "elevated_creatinine" float, "diabetic" string, "cerebrovascular_disease" bool, "moca_score" int, "parkinsonism" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- signi...
SELECT * FROM table_train_96 WHERE cerebrovascular_disease = 1
criteria2sql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeou...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperchloremia'...
eicu
CREATE TABLE table_18442691_2 ( album VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 35 is the number what is the album?
SELECT album FROM table_18442691_2 WHERE no = 35
sql_create_context
CREATE TABLE table_1358608_4 ( group VARCHAR, distance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many races were for a distance of 2020 m?
SELECT COUNT(group) FROM table_1358608_4 WHERE distance = "2020 m"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX n...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Courses ( course_id INTEGER, author_...
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken ORDER BY COUNT(date_test_taken)
nvbench
CREATE TABLE table_70718 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Craig Wood's score?
SELECT "Score" FROM table_70718 WHERE "Player" = 'craig wood'
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", AboutMe, Reputation FROM Users WHERE LOWER(Location) LIKE '%uruguay%' OR UPPER(Location) LIKE '%URU' ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE table_203_716 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many more gold medals did jamaica win compared to cuba ?
SELECT (SELECT "gold" FROM table_203_716 WHERE "nation" = 'jamaica') - (SELECT "gold" FROM table_203_716 WHERE "nation" = 'cuba')
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "44" AND diagnoses.icd9_code = "27652"
mimicsql_data
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb....
css
CREATE TABLE table_name_37 ( week VARCHAR, tv_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT WEEK HAS A TV TIME OF BYE?
SELECT week FROM table_name_37 WHERE tv_time = "bye"
sql_create_context
CREATE TABLE student ( stu_num VARCHAR, stu_lname VARCHAR ) CREATE TABLE CLASS ( crs_code VARCHAR, class_code VARCHAR ) CREATE TABLE enroll ( class_code VARCHAR, stu_num VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the code of the...
SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson'
sql_create_context
CREATE TABLE table_10221 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record for the game when the ...
SELECT "Record" FROM table_10221 WHERE "Home" = 'dallas mavericks'
wikisql
CREATE TABLE Skills ( skill_id INTEGER, skill_code VARCHAR(20), skill_description VARCHAR(255) ) CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Staff ( staff_id INTEGER, staff_name VARCHAR(255), gender VARCHAR(1), other_staff_details VARCHAR(255...
SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY last_name ORDER BY COUNT(last_name)
nvbench
CREATE TABLE table_16268026_3 ( semifinal_average VARCHAR, preliminary_average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the semifinal average where the preliminary average is 9.084 (1) ?
SELECT semifinal_average FROM table_16268026_3 WHERE preliminary_average = "9.084 (1)"
sql_create_context
CREATE TABLE table_39951 ( "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 total number of losses against 1412, and Byes less than 2?
SELECT COUNT("Losses") FROM table_39951 WHERE "Against" = '1412' AND "Byes" < '2'
wikisql
CREATE TABLE table_58062 ( "Species" text, "Strain" text, "Type" text, "Base Pairs" text, "Genes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which species has 3,441 genes?
SELECT "Species" FROM table_58062 WHERE "Genes" = '3,441'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit ...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62413) AND STRFTIME('%y', procedures_icd.charttime) = '2105'
mimic_iii
CREATE TABLE table_74248 ( "\u2116" real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT "Production code" FROM table_74248 WHERE "U.S. viewers (millions)" = '5.5'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGui...
SELECT t.TagName, COUNT(q.Id) AS countofUnAnsweredQuestions FROM Posts AS q INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE (SELECT COUNT(*) FROM Posts AS a WHERE a.ParentId = q.Id AND a.Score > 0) = 0 AND q.CommunityOwnedDate IS NULL AND q.ClosedDate IS NULL AND q.ParentId I...
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb...
css
CREATE TABLE table_71705 ( "Year" real, "Population (Region total)" real, "Population (Caloundra)" real, "Population (Maroochy)" real, "Population (Noosa)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year had a population region total of 63,...
SELECT MAX("Year") FROM table_71705 WHERE "Population (Region total)" = '63,073' AND "Population (Maroochy)" < '35,266'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DALLAS' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_44721 ( "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total enrollment at the school...
SELECT COUNT("Enrollment") FROM table_44721 WHERE "Nickname" = 'fightin'' blue hens'
wikisql
CREATE TABLE table_name_57 ( engine VARCHAR, rounds VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the engine with rounds of 7 with geki driver
SELECT engine FROM table_name_57 WHERE rounds = "7" AND driver = "geki"
sql_create_context
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, round_trip_cost int, round_trip_required varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank i...
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
atis
CREATE TABLE table_27866 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the larg...
SELECT "Largest ethnic group (2002)" FROM table_27866 WHERE "Settlement" = 'Doline'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "8960" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_name_18 ( date__from_ VARCHAR, traction_type VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the date for traction type electric with calgary location?
SELECT date__from_ FROM table_name_18 WHERE traction_type = "electric" AND location = "calgary"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.formulary_drug_cd = "ENOX80I"
mimicsql_data
CREATE TABLE table_name_31 ( home VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team at the game when the Thrashers had a record of 18 18 1?
SELECT home FROM table_name_31 WHERE record = "18–18–1"
sql_create_context
CREATE TABLE table_39348 ( "County" text, "1948" real, "1956" real, "1966" real, "1977" real, "1992" real, "2002" real, "2011" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 1977 is the lowest one that has a County of zzz bucharest...
SELECT MIN("1977") FROM table_39348 WHERE "County" = 'zzz bucharest' AND "2011" < '1883425'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT p.Id AS "post_link", t.TagName, p.Title, p.Score FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE TagName = '##Tag##' AND CreationDate > '5/21/2016' ORDER BY p.Score DESC
sede
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, Price FROM Products WHERE Price >= 180 ORDER BY Price DESC, Name
nvbench
CREATE TABLE table_25740774_1 ( f_laps VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many flaps are there for the team march 3 racing (1-4) top speed racing team (5-12)?
SELECT COUNT(f_laps) FROM table_25740774_1 WHERE team = "March 3 Racing (1-4) Top Speed Racing team (5-12)"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_fro...
SELECT DISTINCT minimum_connect_time FROM airport WHERE airport_code = 'IAH'
atis
CREATE TABLE table_32634 ( "FAT16" text, "FAT32" text, "HPFS" text, "ISO 9660" text, "NTFS" text, "ReFS" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which FAT32 has a no for HPFS, a no for ReFS, and a yes v3.0 fir NTFS?
SELECT "FAT32" FROM table_32634 WHERE "HPFS" = 'no' AND "ReFS" = 'no' AND "NTFS" = 'yes v3.0'
wikisql
CREATE TABLE table_name_25 ( pick VARCHAR, position VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times is the position lb and the overall is less than 46?
SELECT COUNT(pick) FROM table_name_25 WHERE position = "lb" AND overall < 46
sql_create_context
CREATE TABLE table_name_5 ( frequency VARCHAR, area_served VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Frequency of Gosford when the Callsign of 2cfm?
SELECT frequency FROM table_name_5 WHERE area_served = "gosford" AND callsign = "2cfm"
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-72509')) AND medication.drugname IN ('sennosides-docusate sodium 8.6-5...
eicu
CREATE TABLE table_63902 ( "Year" real, "Main" text, "Hessen" text, "Rhein" text, "Saar" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year has a Main of Eintracht Frankfurt and Hessen of FSV Mainz 05?
SELECT "Year" FROM table_63902 WHERE "Main" = 'eintracht frankfurt' AND "Hessen" = 'fsv mainz 05'
wikisql
CREATE TABLE student ( stu_fname VARCHAR, stu_lname VARCHAR, stu_gpa INTEGER, stu_dob VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the first, last name, gpa of the youngest one among students whose GPA is above 3?
SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1
sql_create_context
CREATE TABLE table_26353 ( "2009 general election" text, "party" text, "Manhattan" text, "The Bronx" text, "Brooklyn" text, "Queens" text, "Staten Island" text, "Total" real, "%" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what pe...
SELECT "Brooklyn" FROM table_26353 WHERE "Manhattan" = '15.5%'
wikisql
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V053" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC
nvbench
CREATE TABLE table_2015453_1 ( res VARCHAR, team__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the res for the game against Payam?
SELECT res FROM table_2015453_1 WHERE team__number2 = "Payam"
sql_create_context
CREATE TABLE table_name_65 ( year_s__won VARCHAR, to_par INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years won when the To par is more than 13?
SELECT year_s__won FROM table_name_65 WHERE to_par > 13
sql_create_context
CREATE TABLE table_20708 ( "Team" text, "ACC Regular Season" text, "ACC %" text, "ACC Home" text, "ACC Road" text, "All Games" text, "All Games %" text, "All Home" text, "All Road" text, "All Neutral" text ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT "ACC Home" FROM table_20708 WHERE "ACC %" = '.813'
wikisql
CREATE TABLE table_name_67 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue for the dates 7,8,10,11 Feb 1908?
SELECT venue FROM table_name_67 WHERE date = "7,8,10,11 feb 1908"
sql_create_context
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) -- Using valid SQLite, answer the following questions ...
SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY COUNT(Country) DESC
nvbench
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text...
SELECT time, COUNT(time) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern" GROUP BY time ORDER BY COUNT(time)
nvbench
CREATE TABLE table_46011 ( "Nat." text, "Name" text, "Since" text, "App(L/C/E)" text, "Goals(L/C/E)" text, "Ends" real, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the gaols(L/C/E) with an App(L/C/E) of 55 (47/5/3)...
SELECT "Goals(L/C/E)" FROM table_46011 WHERE "App(L/C/E)" = '55 (47/5/3)'
wikisql
CREATE TABLE table_68 ( "Rank" real, "Member Association" text, "Points" text, "Group stage" real, "Play-off" real, "AFC Cup" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest group to earn 886.6 points?
SELECT MIN("Group stage") FROM table_68 WHERE "Points" = '886.6'
wikisql
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescript...
SELECT SourceTagName, TargetTagName FROM TagSynonyms
sede
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 HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY)
nvbench
CREATE TABLE table_39983 ( "Television service" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What language has NO, as the HDTV, sky famiglia as the package/option, and national g...
SELECT "Language" FROM table_39983 WHERE "HDTV" = 'no' AND "Package/Option" = 'sky famiglia' AND "Television service" = 'national geographic channel'
wikisql
CREATE TABLE table_68134 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest bush# with 66.0% bush and less than 65 others#?...
SELECT MIN("Bush#") FROM table_68134 WHERE "Bush%" = '66.0%' AND "Others#" < '65'
wikisql
CREATE TABLE table_25562 ( "Engine" text, "Crankshaft" text, "Ignition timing" text, "Graphical" text, "Example" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1-1-0-0-1-1-0-0- is the graphical how many ignition timings are there?
SELECT COUNT("Ignition timing") FROM table_25562 WHERE "Graphical" = '1-1-0-0-1-1-0-0-'
wikisql
CREATE TABLE table_name_58 ( date_performed VARCHAR, main_contestant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date performed has a Main contestant of karanvir bohra?
SELECT date_performed FROM table_name_58 WHERE main_contestant = "karanvir bohra"
sql_create_context
CREATE TABLE table_2828803_1 ( title VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th title of the episode written by Nick Thiel?
SELECT title FROM table_2828803_1 WHERE written_by = "Nick Thiel"
sql_create_context
CREATE TABLE table_203_489 ( id number, "year" number, "title" text, "system" text, "developer" text, "publisher" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the game made in the year previous to 1994 ?
SELECT "title" FROM table_203_489 WHERE "year" < 1994 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_name_12 ( club VARCHAR, third VARCHAR, runners_up VARCHAR, winners VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club has 1 runners-up with 0 winners and 2 third place earned?
SELECT club FROM table_name_12 WHERE runners_up = 1 AND winners = 0 AND third = 2
sql_create_context
CREATE TABLE table_204_135 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number ) -- Using valid SQLite, answer the following quest...
SELECT "club" FROM table_204_135 ORDER BY "goal difference" LIMIT 1
squall
CREATE TABLE table_name_36 ( score VARCHAR, date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score on 17 November 1956 when home team is Derby County?
SELECT score FROM table_name_36 WHERE date = "17 november 1956" AND home_team = "derby county"
sql_create_context
CREATE TABLE table_name_49 ( attendance INTEGER, arena VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Attendance at Joe Louis Arena?
SELECT AVG(attendance) FROM table_name_49 WHERE arena = "joe louis arena"
sql_create_context
CREATE TABLE table_49826 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total with a score in set 3 of 13 25?
SELECT "Total" FROM table_49826 WHERE "Set 3" = '13–25'
wikisql
CREATE TABLE table_39216 ( "Outcome" text, "Event" text, "Year" text, "Venue" text, "Partner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome for the India Open?
SELECT "Outcome" FROM table_39216 WHERE "Venue" = 'india open'
wikisql
CREATE TABLE table_12165999_1 ( position VARCHAR, afl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does the Cincinnati Bengals' player have?
SELECT position FROM table_12165999_1 WHERE afl_team = "Cincinnati Bengals"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM...
mimic_iii
CREATE TABLE table_name_88 ( surface VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the tournament surface at Aptos?
SELECT surface FROM table_name_88 WHERE tournament = "aptos"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '张温书' AND t_kc22.STA_DATE BETWEEN '2004-11-01' AND '2006-09-07' AND t_kc22.SOC_SRT_DIRE_NM = '苯巴比妥片'
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_76131 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Week when the result was w 28 20, and there were more than 46,888 in attendance?
SELECT AVG("Week") FROM table_76131 WHERE "Result" = 'w 28–20' AND "Attendance" > '46,888'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
SELECT YEAR(sel.CreationDate) AS "year", COUNT(*) AS "count" FROM (SELECT p.Id, p.CreationDate FROM Posts AS p WHERE p.PostTypeId = 1 AND p.ClosedDate IS NULL AND p.Score < 0) AS sel GROUP BY YEAR(sel.CreationDate) ORDER BY Year
sede
CREATE TABLE table_203_570 ( id number, "#" number, "title" text, "tpb isbn" text, "tpb release date" text, "tpb page number" number, "collected material" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how may releases were after the year 20...
SELECT COUNT(*) FROM table_203_570 WHERE "tpb release date" > 2009
squall
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
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 = '016-34108')) AND medication.drugname = 'potassium chloride 10 ...
eicu
CREATE TABLE table_name_40 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the score on march 8?
SELECT score FROM table_name_40 WHERE date = "march 8"
sql_create_context
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
SELECT start_station_name, start_station_id FROM trip ORDER BY start_station_name DESC
nvbench
CREATE TABLE table_name_66 ( year INTEGER, composition VARCHAR, issue_price VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year when the composition is 99.99% silver and the issue price is $94.95?
SELECT MIN(year) FROM table_name_66 WHERE composition = "99.99% silver" AND issue_price = "$94.95"
sql_create_context
CREATE TABLE table_39111 ( "Tournament" text, "1998" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text ) -- Using val...
SELECT "2006" FROM table_39111 WHERE "2013" = '4–4'
wikisql
CREATE TABLE table_72325 ( "Perfect stem" text, "Future stem" text, "Imperfect stem" text, "Short stem" text, "Meaning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the short stem for garbitzen?
SELECT "Short stem" FROM table_72325 WHERE "Imperfect stem" = 'garbitzen'
wikisql
CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER ) CREATE TABLE Medication ( Code INTEGER, Name VARCHAR(30), Brand VARCHAR(30), Description VARCHAR(30) ) CREATE TABLE Appointment ( AppointmentID INTEGER, Patien...
SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_56347 ( "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race had Jody Scheckter ...
SELECT "Race" FROM table_56347 WHERE "Pole Position" = 'jody scheckter'
wikisql
CREATE TABLE table_70820 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Try BP" text, "Losing BP" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Losing BP of Newport Saracens RFC and has a Lost of 19.
SELECT "Losing BP" FROM table_70820 WHERE "Lost" = '19' AND "Club" = 'newport saracens rfc'
wikisql
CREATE TABLE table_name_27 ( surface VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what surface did they play the match in the week of October 21?
SELECT surface FROM table_name_27 WHERE week = "october 21"
sql_create_context
CREATE TABLE table_58777 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the...
SELECT MIN("Lost") FROM table_58777 WHERE "Goals For" < '21'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Mal neo middle 3rd esoph" AND prescriptions.route = "PB"
mimicsql_data
CREATE TABLE table_10416547_1 ( duration VARCHAR, major_instrument_s_ VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the duration of the song where the major instrument is the piano and the date is 2004-02-03?
SELECT duration FROM table_10416547_1 WHERE major_instrument_s_ = "Piano" AND date = "2004-02-03"
sql_create_context
CREATE TABLE table_name_31 ( season INTEGER, points VARCHAR, driver VARCHAR, percentage_of_possible_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons have fernando alonso as the driver, and a percentage of possible points of 64.1...
SELECT SUM(season) FROM table_name_31 WHERE driver = "fernando alonso" AND percentage_of_possible_points = "64.12%" AND points < 109
sql_create_context
CREATE TABLE table_75110 ( "Flat" text, "Threaded" text, "User-selectable themes" text, "Calendar" text, "Image attachment" text, "Unread message tracking" text, "WYSIWYG Editor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Calendar ...
SELECT "Calendar" FROM table_75110 WHERE "WYSIWYG Editor" = 'yes' AND "Unread message tracking" = 'yes'
wikisql
CREATE TABLE table_204_780 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was his last race ?
SELECT "year" FROM table_204_780 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_name_81 ( genre VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Genre has a Game of donkey kong country?
SELECT genre FROM table_name_81 WHERE game = "donkey kong country"
sql_create_context