instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( ...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-76912')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
eicu
CREATE TABLE table_30747 ( "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 ab...
SELECT "Written by" FROM table_30747 WHERE "Title" = 'The Diaper Incident'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE T...
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 334
advising
CREATE TABLE table_57030 ( "Team" text, "Location" text, "Venue" text, "League and position in 1991" text, "Coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has Yuriy Hruznov as coach?
SELECT "Team" FROM table_57030 WHERE "Coach" = 'yuriy hruznov'
wikisql
CREATE TABLE table_63651 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering at this round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many c...
SELECT SUM("Clubs involved") FROM table_63651 WHERE "Clubs remaining" = '2'
wikisql
CREATE TABLE table_21602734_1 ( division INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest division number?
SELECT MIN(division) FROM table_21602734_1
sql_create_context
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_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_18944 ( "Asset Acquired" text, "Acquired From" text, "Date Announced" text, "Date Completed" text, "Reported Cost" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- It is was announced on July 2, 2006 that what asset had been acquire...
SELECT "Asset Acquired" FROM table_18944 WHERE "Date Announced" = 'July 2, 2006'
wikisql
CREATE TABLE table_name_17 ( author VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the author for harry potter and the deathly hallows?
SELECT author FROM table_name_17 WHERE title = "harry potter and the deathly hallows"
sql_create_context
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_B...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC
nvbench
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE...
SELECT DEPT_CODE, AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY AVG(STU_GPA) DESC
nvbench
CREATE TABLE table_28119 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer(s)" text, "Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of #33?
SELECT "Title" FROM table_28119 WHERE "Season #" = '33'
wikisql
CREATE TABLE table_name_88 ( season VARCHAR, qualities VARCHAR, sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the south season of the scorpio sign, which has cold & wet qualities?
SELECT season AS :_south FROM table_name_88 WHERE qualities = "cold & wet" AND sign = "scorpio"
sql_create_context
CREATE TABLE table_44920 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue for the dates 1,2,3,4,6,7 jan 1908?
SELECT "Venue" FROM table_44920 WHERE "Date" = '1,2,3,4,6,7 jan 1908'
wikisql
CREATE TABLE table_22637 ( "Years covered" text, "All bills sponsored" real, "All amendments sponsored" real, "All bills cosponsored" real, "All amendments cosponsored" real, "Bills originally cosponsored" real, "Amendments originally cosponsored" real ) -- Using valid SQLite, answer the f...
SELECT "Bills originally cosponsored" FROM table_22637 WHERE "All amendments cosponsored" = '0'
wikisql
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_icd_procedures ( row_id number, icd9_code text, s...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'nephrourete...
mimic_iii
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId ...
SELECT Id AS "user_link", DisplayName, Reputation FROM Users ORDER BY Reputation DESC LIMIT 500
sede
CREATE TABLE table_13280 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average ranking for a react of 0.17300000000000001 and less than 5 lanes?
SELECT AVG("Rank") FROM table_13280 WHERE "React" = '0.17300000000000001' AND "Lane" < '5'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE fare ( fare_id int, from_airport va...
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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =...
atis
CREATE TABLE table_8070 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most money United States player Bob Gilder won?
SELECT MAX("Money ( $ )") FROM table_8070 WHERE "Country" = 'united states' AND "Player" = 'bob gilder'
wikisql
CREATE TABLE table_27434_2 ( live_births_per_year VARCHAR, life_expectancy_total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many live births per year do people with a life expectancy of 65.1 have?
SELECT live_births_per_year FROM table_27434_2 WHERE life_expectancy_total = "65.1"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '吕格菲' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 2770.51)
css
CREATE TABLE table_23333 ( "District" real, "Representative" text, "Party" text, "Residence" text, "Counties represented" text, "Term ends" real, "First Elected" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the term ends for bethlehem...
SELECT COUNT("Term ends") FROM table_23333 WHERE "Residence" = 'Bethlehem'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGui...
SELECT Id AS "post_link", Score FROM Posts WHERE (PostTypeId = 2) AND (OwnerUserId = '##userid?25510##') AND (Body LIKE '%##word?urgent##%' COLLATE Latin1_General_CI_AI) ORDER BY Id
sede
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, ...
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
advising
CREATE TABLE addresses ( state_province_county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show each state and the number of addresses in each state.
SELECT state_province_county, COUNT(*) FROM addresses GROUP BY state_province_county
sql_create_context
CREATE TABLE table_20159025_1 ( part_3 VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time in part 3 when Heikki Kovalainen was the driver?
SELECT part_3 FROM table_20159025_1 WHERE driver = "Heikki Kovalainen"
sql_create_context
CREATE TABLE table_name_99 ( track INTEGER, song_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the sum of tracks for raised on rock
SELECT SUM(track) FROM table_name_99 WHERE song_title = "raised on rock"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewT...
SELECT OwnerUserId AS "user_link", COUNT(*) AS N FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND NOT OwnerUserId IS NULL AND NOT ClosedDate IS NULL AND Posts.Id IN (SELECT DISTINCT ParentId FROM Posts) GROUP BY OwnerUserId ORDER BY N DESC LIMIT 100
sede
CREATE TABLE table_name_98 ( competition VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the name of the competition in 8th position?
SELECT competition FROM table_name_98 WHERE position = "8th"
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Other partial resection of small intestine"
mimicsql_data
CREATE TABLE table_57663 ( "Athlete" text, "Country" text, "Wins" real, "Years" text, "Distance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the years for marathon distance and wins of 3
SELECT "Years" FROM table_57663 WHERE "Distance" = 'marathon' AND "Wins" = '3'
wikisql
CREATE TABLE table_76659 ( "Season" text, "Series" text, "Team Name" text, "Races" text, "Wins" text, "Poles" text, "F.L." text, "Podiums" text, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT "Podiums" FROM table_76659 WHERE "Wins" = '0' AND "F.L." = '0' AND "Points" = '35'
wikisql
CREATE TABLE table_train_188 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- b...
SELECT * FROM table_train_188 WHERE body_mass_index_bmi > 25 AND body_mass_index_bmi < 45
criteria2sql
CREATE TABLE table_train_204 ( "id" int, "systolic_blood_pressure_sbp" int, "plasma_glucose_concentration" int, "fasting_plasma_glucose_fpg" float, "increase_risk_of_intervention" bool, "diastolic_blood_pressure_dbp" int, "life_span" bool, "body_mass_index_bmi" float, "NOUSE" float )...
SELECT * FROM table_train_204 WHERE plasma_glucose_concentration > 200
criteria2sql
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.age < "72" AND prescriptions.route = "PO/NG"
mimicsql_data
CREATE TABLE table_63603 ( "Medal count" real, "Date" text, "Athlete" text, "Nation" text, "Sport" text, "Record medal event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which sport has 17 as the medal count?
SELECT "Sport" FROM table_63603 WHERE "Medal count" = '17'
wikisql
CREATE TABLE table_50764 ( "Position" real, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Poin...
SELECT "Points" FROM table_50764 WHERE "Draws" < '7' AND "Wins" < '16' AND "Goals for" = '35'
wikisql
CREATE TABLE table_56489 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who constructed the car that has a Time/Retired of +2:06.0?
SELECT "Constructor" FROM table_56489 WHERE "Time/Retired" = '+2:06.0'
wikisql
CREATE TABLE table_50594 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tournament, when Opponent In The Final is 'Andre...
SELECT "Tournament" FROM table_50594 WHERE "Opponent in the final" = 'andre agassi'
wikisql
CREATE TABLE table_name_81 ( draws INTEGER, byes INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of draws with more than 2 byes?
SELECT MIN(draws) FROM table_name_81 WHERE byes > 2
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-10080' AND patient.hospi...
eicu
CREATE TABLE table_19064 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the bleeding time with platelet count being decrea...
SELECT "Bleeding time" FROM table_19064 WHERE "Platelet count" = 'Decreased or unaffected'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "OVERDOSE"
mimicsql_data
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND ...
css
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 (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'syst rheum...
mimic_iii
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 Team_Name, School_ID FROM basketball_match ORDER BY Team_Name
nvbench
CREATE TABLE table_61024 ( "Year" real, "Award" text, "Category" text, "Role" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Category has an Award of monte carlo tv festival awards, and a Year larger than 2010?
SELECT "Category" FROM table_61024 WHERE "Award" = 'monte carlo tv festival awards' AND "Year" > '2010'
wikisql
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_23309 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many diff...
SELECT COUNT("High assists") FROM table_23309 WHERE "High rebounds" = 'Sales (10)'
wikisql
CREATE TABLE table_name_25 ( original_canadian_air_date VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Original Canadian air-date for the episode directed by mark rydell?
SELECT original_canadian_air_date FROM table_name_25 WHERE director = "mark rydell"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location ...
SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE')
atis
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "BLACK/HAITIAN"
mimicsql_data
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( ro...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'nitroglycerin' AND DATETIME(prescriptions.startdate, 'start of ye...
mimic_iii
CREATE TABLE table_name_58 ( away_team VARCHAR, home_team VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Away team has a Home team of al-ain fc, and a Score of 1 1?
SELECT away_team FROM table_name_58 WHERE home_team = "al-ain fc" AND score = "1–1"
sql_create_context
CREATE TABLE table_1341690_13 ( first_elected VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was the first elected incumbant Sidney R. Yates?
SELECT first_elected FROM table_1341690_13 WHERE incumbent = "Sidney R. Yates"
sql_create_context
CREATE TABLE table_45609 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was valentino rossi's rider time?
SELECT "Time" FROM table_45609 WHERE "Rider" = 'valentino rossi'
wikisql
CREATE TABLE table_29692554_2 ( entered VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many entries are shown for entered at 21:09?
SELECT COUNT(entered) FROM table_29692554_2 WHERE time = "21:09"
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 prescriptions...
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.long_title = "Cerebral aneurysm, nonruptured" AND prescriptions.route = "DIALYS"
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 * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_29023 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the nationality of player picked no. 179?
SELECT "Nationality" FROM table_29023 WHERE "Pick #" = '179'
wikisql
CREATE TABLE table_65878 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Reserved for (SC / ST /None) when th...
SELECT "Reserved for ( SC / ST /None)" FROM table_65878 WHERE "Constituency number" = '203'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMPA' AND date_day.day_number = 25 AND date_day.month_number = 6 AND dat...
atis
CREATE TABLE table_24852622_1 ( class_d_winner VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Class D winner in round 6?
SELECT class_d_winner FROM table_24852622_1 WHERE round = "6"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, ...
SELECT DISTINCT airport_service.miles_distant FROM airport, airport_service, city WHERE airport.airport_code = 'SFO' AND airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'SAN FRANCISCO'
atis
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT * FROM Users WHERE Users.Location = 'Sydney' AND LOWER(Users.DisplayName) LIKE '%recordpoint%' ORDER BY Reputation DESC
sede
CREATE TABLE table_18086 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the follo...
SELECT "Points against" FROM table_18086 WHERE "Won" = '10'
wikisql
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 t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'enter...
eicu
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 1 * 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 cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 874 AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year')
eicu
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 COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZYBMLX = '0598399' AND bdmzjzjlb.RYDJSJ BETWEEN '2007-02-14' AND '2021-02-04'
css
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 labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29666) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ph') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(...
mimic_iii
CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team i...
SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name
nvbench
CREATE TABLE table_name_32 ( place VARCHAR, prize VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Place, when Prize is '$381.030'?
SELECT place FROM table_name_32 WHERE prize = "$381.030"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT Team_ID, School_ID FROM basketball_match GROUP BY All_Road
nvbench
CREATE TABLE table_7530 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank has 0 as the bronze, and a total less than 3, with north korea as the nation?
SELECT "Rank" FROM table_7530 WHERE "Bronze" = '0' AND "Total" < '3' AND "Nation" = 'north korea'
wikisql
CREATE TABLE table_71583 ( "School" text, "Team" text, "Division Record" text, "Overall Record" text, "Season Outcome" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the School of the Sussex Tech's Team?
SELECT "Team" FROM table_71583 WHERE "School" = 'sussex tech'
wikisql
CREATE TABLE table_43822 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent when the record is 17-19-4?
SELECT "Opponent" FROM table_43822 WHERE "Record" = '17-19-4'
wikisql
CREATE TABLE table_name_76 ( winner VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won on May 2011?
SELECT winner FROM table_name_76 WHERE date = "may 2011"
sql_create_context
CREATE TABLE table_name_22 ( played VARCHAR, lost VARCHAR, first_game VARCHAR, percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of games played that correlates with a first game in 1991, a percentage of 22.22%, and l...
SELECT COUNT(played) FROM table_name_22 WHERE first_game = 1991 AND percentage = "22.22%" AND lost > 7
sql_create_context
CREATE TABLE table_name_27 ( game VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what game was on may 24
SELECT game FROM table_name_27 WHERE date = "may 24"
sql_create_context
CREATE TABLE table_name_72 ( title VARCHAR, platform_s_ VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 3ds game did Naohiko Aoyama direct?
SELECT title FROM table_name_72 WHERE platform_s_ = "3ds" AND director = "naohiko aoyama"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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 labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LIMIT 1
mimic_iii
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 Country DESC
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, Li...
WITH Raw AS (SELECT TIME_TO_STR(COALESCE(ApprovalDate, RejectionDate), '%Y') AS yyyy, TIME_TO_STR(COALESCE(ApprovalDate, RejectionDate), '%M') AS mm, COUNT(ApprovalDate) AS ApprovalCount, COUNT(RejectionDate) AS RejectionCount FROM SuggestedEdits GROUP BY TIME_TO_STR(COALESCE(ApprovalDate, RejectionDate), '%Y'), TIME_T...
sede
CREATE TABLE table_name_11 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the record 34-41?
SELECT date FROM table_name_11 WHERE record = "34-41"
sql_create_context
CREATE TABLE table_78646 ( "Ecclesiastical Jurisdictions" text, "Latin name" text, "Type" text, "Rite" text, "Ecclesiastical Province" text, "Area (km 2 )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Area (km 2) is lowest with a type bei...
SELECT MIN("Area (km 2 )") FROM table_78646 WHERE "Type" = 'apostolic administration'
wikisql
CREATE TABLE table_46885 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many were in attendance during week 12?
SELECT "Attendance" FROM table_46885 WHERE "Week" = '12'
wikisql
CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, me...
SELECT T1.id, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3
spider
CREATE TABLE table_44751 ( "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of React, when Name is Sean Wroe, and when Lane is greater than 2?
SELECT COUNT("React") FROM table_44751 WHERE "Name" = 'sean wroe' AND "Lane" > '2'
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 School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season
nvbench
CREATE TABLE table_36208 ( "Date" text, "Episode" real, "Performer 1" text, "Performer 2" text, "Performer 3" text, "Performer 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Performer 2 of chip esten has what performer 3?
SELECT "Performer 3" FROM table_36208 WHERE "Performer 2" = 'chip esten'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8089411' AND t_kc21.HOSP_STS > 0
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE table_27817 ( "Position" real, "Sail Number" text, "Yacht" text, "State/Country" text, "Yacht Type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed Time d:hh:mm:ss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT "State/Country" FROM table_27817 WHERE "Elapsed Time d:hh:mm:ss" = '2:15:14:06'
wikisql
CREATE TABLE table_name_64 ( competition VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which competition ended with a score of 58-4?
SELECT competition FROM table_name_64 WHERE score = "58-4"
sql_create_context
CREATE TABLE table_name_46 ( replica VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Replica has a race of supersport race 1?
SELECT replica FROM table_name_46 WHERE race = "supersport race 1"
sql_create_context
CREATE TABLE table_203_76 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many drivers received...
SELECT COUNT("driver") FROM table_203_76 WHERE NOT "points" IS NULL
squall
CREATE TABLE table_204_441 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "attendance" number, "scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the first opponent oxford united f.c. defeated during t...
SELECT "opponent" FROM table_204_441 WHERE "result" > "result" ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_name_39 ( played INTEGER, losses VARCHAR, goals_for VARCHAR, goals_against VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Played has Goals against larger than 34, and Wins smaller than 12, and Goals for smal...
SELECT AVG(played) FROM table_name_39 WHERE goals_against > 34 AND wins < 12 AND goals_for < 50 AND losses > 15
sql_create_context