instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_37119 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the opponent when Diegomar Markwell is the loss?
SELECT "Opponent" FROM table_37119 WHERE "Loss" = 'diegomar markwell'
wikisql
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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - penicillins' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), ...
eicu
CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE...
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT KSBM, KSMC FROM jybgb WHERE BGDH = '68651052326'
css
CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE college ( cname text, state text, enr number ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT T1.cname FROM tryout AS T1 JOIN player AS T2 ON T1.pid = T2.pid WHERE T2.pname LIKE 'D%'
spider
CREATE TABLE table_65728 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many picks on average did Jay Bruchak have before round 6?
SELECT AVG("Pick") FROM table_65728 WHERE "Player" = 'jay bruchak' AND "Round" < '6'
wikisql
CREATE TABLE table_63575 ( "Year" real, "U.S. Hot 100" text, "U.S. R&B" text, "U.S. Rap" text, "Album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What U.S. Rap has life in the concrete jungle as the album?
SELECT "U.S. Rap" FROM table_63575 WHERE "Album" = 'life in the concrete jungle'
wikisql
CREATE TABLE table_24950 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the minimun amount of gold ...
SELECT MIN("Gold") FROM table_24950
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 'post_link' = p.Id, a.Score, Answer = CASE WHEN p.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END FROM Posts AS p INNER JOIN Posts AS a ON a.ParentId = p.Id WHERE EXISTS(SELECT 1 FROM PostLinks AS pl WHERE pl.PostId = p.Id AND pl.LinkTypeId = 3)
sede
CREATE TABLE table_name_25 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent when the record was 11-6-2?
SELECT opponent FROM table_name_25 WHERE record = "11-6-2"
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 WHERE demographic.dod_year <= "2126.0"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS"
mimicsql_data
CREATE TABLE table_36691 ( "Rank" real, "Name" text, "Height* m (ft)" text, "Floors" real, "Year* (est.)" text, "City" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of Etihad Tower 5, with less than 62 floors?
SELECT MIN("Rank") FROM table_36691 WHERE "Floors" < '62' AND "Name" = 'etihad tower 5'
wikisql
CREATE TABLE table_47745 ( "Series Sorted" text, "Title" text, "Doctor" text, "Featuring" text, "Released" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series sorted value for the episode released December 2009?
SELECT "Series Sorted" FROM table_47745 WHERE "Released" = 'december 2009'
wikisql
CREATE TABLE table_58275 ( "Competition" text, "Stage" text, "Venue" text, "Date" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the 1999 fifa world cup qualification (uefa) on Nov 23, 1997?
SELECT "Result" FROM table_58275 WHERE "Competition" = '1999 fifa world cup qualification (uefa)' AND "Date" = 'nov 23, 1997'
wikisql
CREATE TABLE table_name_17 ( player VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player played in 2007?
SELECT player FROM table_name_17 WHERE season = "2007"
sql_create_context
CREATE TABLE table_272313_1 ( vertical INTEGER, horizontal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the maximum vertical measurement if the horizon measurement is 640?
SELECT MAX(vertical) FROM table_272313_1 WHERE horizontal = 640
sql_create_context
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 (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-5308')) AND lab.labname = 'albumin' AND lab.labresulttime = '2105-01-30 13:...
eicu
CREATE TABLE table_name_54 ( time VARCHAR, notes VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time for Cuba, with a notes entry of QS?
SELECT time FROM table_name_54 WHERE notes = "qs" AND country = "cuba"
sql_create_context
CREATE TABLE table_name_55 ( rank VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of player Jason Dunstall?
SELECT rank FROM table_name_55 WHERE player = "jason dunstall"
sql_create_context
CREATE TABLE table_test_3 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "severe_hemodynamic_instability" bool, "consent" bool, "hemoglobin_a1c_hba1c" float, "metallic_implants" bool, "allergy_to_aspirin" bool, "creatinine_clearance_cl" float, "post_menopausal" bool,...
SELECT * FROM table_test_3 WHERE (gender = 'male' AND (age >= 18 AND age <= 85)) OR (gender = 'female' AND post_menopausal = 1 AND age <= 85)
criteria2sql
CREATE TABLE table_name_3 ( age__as_of_1_february_2014_ VARCHAR, rank VARCHAR, death_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Age (as of 1 February 2014) has a Rank smaller than 9, and a Death date of 24 january 2007?
SELECT age__as_of_1_february_2014_ FROM table_name_3 WHERE rank < 9 AND death_date = "24 january 2007"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52604 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
mimic_iii
CREATE TABLE table_10152 ( "Rank" real, "Player" text, "Country" text, "Earnings( $ )" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For earnings greater than 4,689,368, what is the greatest rank?
SELECT MAX("Rank") FROM table_10152 WHERE "Earnings( $ )" > '4,689,368'
wikisql
CREATE TABLE table_name_47 ( nationality VARCHAR, rank VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the swimmer with a rank over 2 with a time of 55.77?
SELECT nationality FROM table_name_47 WHERE rank > 2 AND time = "55.77"
sql_create_context
CREATE TABLE table_14984039_1 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the result for October 14, 1956?
SELECT result FROM table_14984039_1 WHERE date = "October 14, 1956"
sql_create_context
CREATE TABLE table_77117 ( "Title" text, "Release Date" text, "Format" text, "Release" text, "Label" text, "Code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Label released an album in August 1996?
SELECT "Label" FROM table_77117 WHERE "Release Date" = 'august 1996'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "3" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
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 student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE prereq ( course_id var...
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name
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.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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_MZJZJL...
css
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND fare.round_trip_required = 'NO' AND flight_fare.fare_id = ...
atis
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT mzjzjlb.ZZYSGH, mzjzjlb.QTJZYSGH FROM mzjzjlb WHERE mzjzjlb.JZLSH = '09772478615'
css
CREATE TABLE Bookings ( Booking_ID INTEGER, Customer_ID INTEGER, Workshop_Group_ID VARCHAR(100), Status_Code CHAR(15), Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CREATE TABLE Drama_Workshop...
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY Service_Type_Description
nvbench
CREATE TABLE table_test_12 ( "id" int, "serum_potassium" float, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "haemoglobin" float, "consent" bool, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "renal_disease" bool, "anaemia" bool, "cr...
SELECT * FROM table_test_12 WHERE kidney_disease = 1 OR creatinine_clearance_cl < 30
criteria2sql
CREATE TABLE table_51202 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What away team had a score of 7.9 (51)?
SELECT "Away team" FROM table_51202 WHERE "Away team score" = '7.9 (51)'
wikisql
CREATE TABLE table_46725 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total attendance on April 25?
SELECT COUNT("Attendance") FROM table_46725 WHERE "Date" = 'april 25'
wikisql
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 PostTypes ( Id number, Name text ) CREATE TABLE PostLin...
SELECT c.Id, c.Id AS "comment_link", c.CreationDate FROM Comments AS c INNER JOIN Posts AS q ON q.Id = c.PostId AND q.PostTypeId = 1 AND LENGTH(c.Text) <= 75 AND LOWER(c.Text) LIKE '%forget%accept%' ORDER BY c.CreationDate DESC
sede
CREATE TABLE table_26250199_1 ( song_choice VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The theme Auditioner's Choice has what song choice?
SELECT song_choice FROM table_26250199_1 WHERE theme = "Auditioner's Choice"
sql_create_context
CREATE TABLE branch ( name VARCHAR, branch_id VARCHAR ) CREATE TABLE membership_register_branch ( branch_id VARCHAR, member_id VARCHAR ) CREATE TABLE member ( member_id VARCHAR, Hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find t...
SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member ...
sql_create_context
CREATE TABLE table_name_34 ( location VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the location with a record of 50-19?
SELECT location FROM table_name_34 WHERE record = "50-19"
sql_create_context
CREATE TABLE table_2668367_14 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the candidates in the district where the incumbent was Nathaniel Macon?
SELECT candidates FROM table_2668367_14 WHERE incumbent = "Nathaniel Macon"
sql_create_context
CREATE TABLE inst ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many institutions are there?
SELECT COUNT(*) FROM inst
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59049) AND STRFTIME('%y', labevents.charttime) >= '2105'
mimic_iii
CREATE TABLE table_name_67 ( opponent VARCHAR, result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Result is Win, and when Date is Aug 7?
SELECT opponent FROM table_name_67 WHERE result = "win" AND date = "aug 7"
sql_create_context
CREATE TABLE ALBUM ( ArtistId VARCHAR ) CREATE TABLE ARTIST ( ArtistId VARCHAR, Name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Hom many albums does the artist 'Metallica' have?
SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "Metallica"
sql_create_context
CREATE TABLE table_20296 ( "#" real, "Advocate # 1" text, "Advocate # 2" text, "Root of All Evil" text, "Poll winner" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of advocate #1 that aired on april 2, ...
SELECT COUNT("Advocate # 1") FROM table_20296 WHERE "Original air date" = 'April 2, 2008'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT SUM(Reputation) AS totalRep FROM Users WHERE ((@excludes = 'y' AND Reputation > 200) OR (@excludes != 'y'))
sede
CREATE TABLE table_name_43 ( age_on_leaving VARCHAR, political_party VARCHAR, left_house VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How old was the conservative party member that left the house in 2001?
SELECT age_on_leaving FROM table_name_43 WHERE political_party = "conservative" AND left_house = "2001"
sql_create_context
CREATE TABLE table_29141354_4 ( first_broadcast VARCHAR, jamie_and_johns_guest VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the episode with Andy Murray as Jamie and John's guest first broadcast?
SELECT first_broadcast FROM table_29141354_4 WHERE jamie_and_johns_guest = "Andy Murray"
sql_create_context
CREATE TABLE table_name_92 ( result VARCHAR, goal__number INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result for goal # more than 4
SELECT result FROM table_name_92 WHERE goal__number > 4
sql_create_context
CREATE TABLE table_name_12 ( size_of_rest_bit_field VARCHAR, leading_bits VARCHAR, start_address VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the size of the rest bit field when the leading bits are more than 110 and the start address is 224.0....
SELECT size_of_rest_bit_field FROM table_name_12 WHERE leading_bits > 110 AND start_address = "224.0.0.0"
sql_create_context
CREATE TABLE table_name_59 ( week VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In What Week was the Attendance 75,866?
SELECT week FROM table_name_59 WHERE attendance = "75,866"
sql_create_context
CREATE TABLE table_name_36 ( crowd INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average crowd size when the home team is North Melbourne?
SELECT AVG(crowd) FROM table_name_36 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE employee ( eid number, name text, ...
SELECT COUNT(*) FROM aircraft
spider
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 medication ( medi...
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-171217')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURR...
eicu
CREATE TABLE table_name_26 ( to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the TO par for the player who scored 70-68-74-70=282?
SELECT to_par FROM table_name_26 WHERE score = 70 - 68 - 74 - 70 = 282
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE table_name_51 ( attendance INTEGER, game_site VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest attendance at Memorial Stadium on December 12, 1965?
SELECT MAX(attendance) FROM table_name_51 WHERE game_site = "memorial stadium" AND date = "december 12, 1965"
sql_create_context
CREATE TABLE table_name_46 ( released_date VARCHAR, chinese_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date for the Chinese title ?
SELECT released_date FROM table_name_46 WHERE chinese_title = "摸摸瓦力欧制造"
sql_create_context
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give a me a bar graph to sh...
SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person) ORDER BY T1.name DESC
nvbench
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHA...
SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name
nvbench
CREATE TABLE table_58326 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team when Footscray scored 11.1...
SELECT "Away team" FROM table_58326 WHERE "Home team score" = '11.14 (80)'
wikisql
CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE Scientists ( SSN int, Name Char(30) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of scien...
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name
nvbench
CREATE TABLE table_204_342 ( id number, "#" number, "player" text, "span" text, "caps" number, "total caps" number, "win %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- only player to serve as captain from 1998-2007
SELECT "player" FROM table_204_342 WHERE "span" = '1998-2007'
squall
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 patients.gender FROM patients WHERE patients.subject_id = 1114
mimic_iii
CREATE TABLE table_name_38 ( round INTEGER, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round of the player with an overall of 152?
SELECT MAX(round) FROM table_name_38 WHERE overall = 152
sql_create_context
CREATE TABLE has_amenity ( dormid VARCHAR ) CREATE TABLE dorm ( dormid VARCHAR, student_capacity INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of amenities for each of the dorms that can accommodate more than 100 students.
SELECT COUNT(*), T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid
sql_create_context
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 ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents...
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 = 19161 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev...
mimic_iii
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
SELECT OuterUsers.DisplayName, OuterUsers.Id, (SELECT Tags.TagName FROM Users INNER JOIN Posts ON Posts.OwnerUserId = OuterUsers.Id INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id GROUP BY Tags.TagName ORDER BY COUNT(*) DESC LIMIT 1) AS TopTag FROM Users AS OuterUsers WHERE...
sede
CREATE TABLE table_17058116_5 ( high_points VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who scored the high points on the date November 2?
SELECT high_points FROM table_17058116_5 WHERE date = "November 2"
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 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.admission_type = "ELECTIVE" AND demographic.admission_location = "PHYS REFERRAL/NORMAL DELI"
mimicsql_data
CREATE TABLE table_70812 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest lane for heat 6 with a time of dns?
SELECT MAX("Lane") FROM table_70812 WHERE "Heat" = '6' AND "Time" = 'dns'
wikisql
CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number ) CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text ) -- Using valid SQLite, answer the follo...
SELECT name FROM mountain WHERE height > 5000 OR prominence > 1000
spider
CREATE TABLE table_13612 ( "Model number" text, "sSpec number" text, "Frequency" text, "Turbo" text, "GPU frequency" text, "Cores" text, "L2 cache" text, "L3 cache" text, "I/O bus" text, "Mult." text, "Memory" text, "Voltage" text, "Socket" text, "Release date" te...
SELECT "L2 cache" FROM table_13612 WHERE "sSpec number" = 'slbmm(c2)slbsr(k0)'
wikisql
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5433552' AND t_kc21.HOSP_STS > 0
css
CREATE TABLE table_66291 ( "Proto-Germanic" text, "West Germanic" text, "Old English" text, "German" text, "Dutch" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Proto-Germanic when the German is /t/?
SELECT "Proto-Germanic" FROM table_66291 WHERE "German" = '/t/'
wikisql
CREATE TABLE table_14767 ( "Class" text, "Type" text, "Fleet numbers" text, "Quantity made" real, "Manufacturer" text, "Date made" text, "1958 CI\u00c9" text, "1958 UTA" text, "Date withdrawn" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the ta...
SELECT "Type" FROM table_14767 WHERE "Fleet numbers" = '2–8, 91–92, 97–100'
wikisql
CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE TABLE film ( film_id number, title text, studio text, director text, gross_in_dollar number ) CREATE ...
SELECT type FROM film_market_estimation WHERE year = 1995
spider
CREATE TABLE table_name_19 ( season VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 3rd for season less than 4 and lost of 61
SELECT 3 AS _rd FROM table_name_19 WHERE season < 4 AND lost = 61
sql_create_context
CREATE TABLE table_name_13 ( points_against INTEGER, tries_for VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Points against has Tries for smaller than 14, and a Team of llanelli?
SELECT AVG(points_against) FROM table_name_13 WHERE tries_for < 14 AND team = "llanelli"
sql_create_context
CREATE TABLE table_31874 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition was the World Championships before 2011?
SELECT "Event" FROM table_31874 WHERE "Competition" = 'world championships' AND "Year" < '2011'
wikisql
CREATE TABLE table_1341423_40 ( party VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the party when candidates is jim demint (r) 80%?
SELECT party FROM table_1341423_40 WHERE candidates = "Jim DeMint (R) 80%"
sql_create_context
CREATE TABLE table_1220125_4 ( commissioned VARCHAR, laid_down VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the comissioned for 4 may 1943?
SELECT commissioned FROM table_1220125_4 WHERE laid_down = "4 May 1943"
sql_create_context
CREATE TABLE table_name_30 ( tries_against VARCHAR, try_diff VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Tries against has a Try diff of 17 and Points for smaller than 80?
SELECT COUNT(tries_against) FROM table_name_30 WHERE try_diff = "–17" AND points_for < 80
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 * FROM t_kc21 WHERE MED_SER_ORG_NO = '5285300' AND IN_HOSP_DATE BETWEEN '2014-12-19' AND '2016-05-24' AND PERSON_NM LIKE '任%'
css
CREATE TABLE table_10046 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Competition of uefa euro 2012 qualifying?
SELECT "Score" FROM table_10046 WHERE "Competition" = 'uefa euro 2012 qualifying'
wikisql
CREATE TABLE table_name_98 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did South Melbourne go to play a team at home?
SELECT home_team FROM table_name_98 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code
nvbench
CREATE TABLE table_name_94 ( catalogue VARCHAR, release_date VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the catalogue number for the song that is 3:17 and was released 9/21/71?
SELECT catalogue FROM table_name_94 WHERE release_date = "9/21/71" AND time = "3:17"
sql_create_context
CREATE TABLE table_23061 ( "Team" text, "Division Titles" real, "Playoff Berths" real, "AFL Titles" real, "AFC Championships" real, "Super Bowl Championships" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the team in the New England Patriots...
SELECT MIN("Super Bowl Championships") FROM table_23061 WHERE "Team" = 'New England Patriots'
wikisql
CREATE TABLE table_name_17 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the game on November 10, 2006?
SELECT score FROM table_name_17 WHERE date = "november 10, 2006"
sql_create_context
CREATE TABLE table_15376 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did Bryant Heating enter?
SELECT SUM("Year") FROM table_15376 WHERE "Entrant" = 'bryant heating'
wikisql
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 prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Ciprofloxacin HCl"
mimicsql_data
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate t...
SELECT TOP(50000) AS Id, Score, ViewCount, OwnerUserId FROM Posts WHERE Posts.ViewCount < 14597 ORDER BY Posts.ViewCount DESC
sede
CREATE TABLE table_17521433_1 ( swimsuit VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the swimsuit score for Illinois?
SELECT swimsuit FROM table_17521433_1 WHERE country = "Illinois"
sql_create_context
CREATE TABLE table_64502 ( "Track" text, "Song Title" text, "Writer(s)" text, "Original Artist" text, "Original Release" real, "Length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Original Artis of the Track with a Length of 2:38?...
SELECT "Original Artist" FROM table_64502 WHERE "Length" = '2:38'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total...
SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id
advising
CREATE TABLE table_15623 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was there a result of 8-1 and a score of 8-1?
SELECT "Date" FROM table_15623 WHERE "Result" = '8-1' AND "Score" = '8-1'
wikisql
CREATE TABLE table_204_770 ( id number, "season" number, "date" text, "jia-a/csl winner" text, "result" text, "fa cup winner" text, "scorers" text, "stadium" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many were held at hongkou st...
SELECT COUNT(*) FROM table_204_770 WHERE "stadium" = 'hongkou stadium'
squall
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, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
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 = '33852265' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css