instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_74549 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result when the record was 1-0 and it was earlier than ...
SELECT "Result" FROM table_74549 WHERE "Week" < '4' AND "Record" = '1-0'
wikisql
CREATE TABLE table_name_78 ( earnings__ INTEGER, wins VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest level of Earnings($) to have a Wins value of 22 and a Rank lower than 2?
SELECT MIN(earnings__) AS $__ FROM table_name_78 WHERE wins = 22 AND rank < 2
sql_create_context
CREATE TABLE table_14435 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the catalog of the 7' single in France?
SELECT "Catalog" FROM table_14435 WHERE "Format" = '7" single' AND "Region" = 'france'
wikisql
CREATE TABLE table_name_79 ( wins INTEGER, team VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Wins, when Team is Sweden, and when Played is less than 5?
SELECT SUM(wins) FROM table_name_79 WHERE team = "sweden" AND played < 5
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_Games, Team_ID FROM basketball_match ORDER BY All_Games DESC
nvbench
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number...
SELECT t.TagName, COUNT(DISTINCT (p.Id)) FROM Tags AS t INNER JOIN PostTags AS pt ON t.Id = pt.TagId INNER JOIN Posts AS p ON p.Id = pt.PostId AND p.PostTypeId = 1 GROUP BY t.TagName ORDER BY COUNT(DISTINCT (p.Id)) DESC
sede
CREATE TABLE table_name_76 ( tournaments INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Tournaments, when Name is 'Baruto'?
SELECT MIN(tournaments) FROM table_name_76 WHERE name = "baruto"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.IN_DIAG_DIS_CD = 'H31.774' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.IN_DIAG_DIS_CD = 'H31.774'
css
CREATE TABLE table_name_88 ( code_name VARCHAR, function__figure_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Code Name for the Space Pilot Function (figure)?
SELECT code_name FROM table_name_88 WHERE function__figure_ = "space pilot"
sql_create_context
CREATE TABLE table_name_45 ( result VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result with a Venue that is n?
SELECT result FROM table_name_45 WHERE venue = "n"
sql_create_context
CREATE TABLE table_name_62 ( presentation_of_credentials VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Robert G. Miner present his credentials?
SELECT presentation_of_credentials FROM table_name_62 WHERE name = "robert g. miner"
sql_create_context
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 328 AND instructor.name LIKE '%Christopher Savage%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering....
advising
CREATE TABLE table_75170 ( "Year" real, "Male" text, "Female" text, "Album" text, "Live Performance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the male partner for amy winehouse?
SELECT "Male" FROM table_75170 WHERE "Female" = 'amy winehouse'
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.expire_flag = "0" AND lab.label = "Thyroxine (T4), Free"
mimicsql_data
CREATE TABLE table_64242 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "County" text, "Year Joined" real, "Previous Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lowest Year...
SELECT MIN("Year Joined") FROM table_64242 WHERE "Mascot" = 'pioneers'
wikisql
CREATE TABLE user_profiles ( name VARCHAR, email VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name and email of the user whose name contains the word Swift .
SELECT name, email FROM user_profiles WHERE name LIKE '%Swift%'
sql_create_context
CREATE TABLE table_26454128_7 ( country VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the country that has ken doherty
SELECT country FROM table_26454128_7 WHERE athlete = "Ken Doherty"
sql_create_context
CREATE TABLE table_17058151_6 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for december 6
SELECT record FROM table_17058151_6 WHERE date = "December 6"
sql_create_context
CREATE TABLE table_13397394_1 ( completed VARCHAR, address VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the maximum completed for address on 410 22nd st e
SELECT completed FROM table_13397394_1 WHERE address = "410 22nd St E"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE MED_CLINIC_ID = '95748539104'
css
CREATE TABLE table_40586 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who ha...
SELECT "High rebounds" FROM table_40586 WHERE "Date" = 'april 7'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zo...
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, state AS STATE_0, state AS STATE_1 WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'INDIANAPOLIS' AND date_day.day_numbe...
atis
CREATE TABLE table_61630 ( "Fin. Pos" real, "Car No." real, "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Car number 98's l...
SELECT MIN("Grid") FROM table_61630 WHERE "Car No." = '98'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "58" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_62116 ( "Outcome" text, "Date" text, "Championship" 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 type of surface did they play on 21 July 1997
SELECT "Surface" FROM table_62116 WHERE "Date" = '21 july 1997'
wikisql
CREATE TABLE people ( people_id number, name text, height number, weight number, home town text ) CREATE TABLE perpetrator ( perpetrator_id number, people_id number, date text, year number, location text, country text, killed number, injured number ) -- Using valid...
SELECT AVG(injured) FROM perpetrator
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.long_title = "Initial insertion of dual-chamber device"
mimicsql_data
CREATE TABLE table_22776 ( "Outcome" text, "Year" real, "Championship" 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 tournament did she win with a final score of 4 6,...
SELECT "Championship" FROM table_22776 WHERE "Score in the final" = '4–6, 7–5, 6–2'
wikisql
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 microlab ( microl...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '011-55...
eicu
CREATE TABLE table_71962 ( "Bowling" text, "Player" text, "Opponent" text, "Venue" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player played in 2007?
SELECT "Player" FROM table_71962 WHERE "Season" = '2007'
wikisql
CREATE TABLE table_name_59 ( nhl_team VARCHAR, college_junior_club_team__league_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NHL team that has a team (League) of Mississauga Icedogs (ohl)?
SELECT nhl_team FROM table_name_59 WHERE college_junior_club_team__league_ = "mississauga icedogs (ohl)"
sql_create_context
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 t_kc21.IN_HOSP_DAYS FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '84892309667'
css
CREATE TABLE table_name_91 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest attendance on December 23?
SELECT MAX(attendance) FROM table_name_91 WHERE date = "december 23"
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT DISTINCT r.UserId FROM Badges AS r INNER JOIN Badges AS sql ON r.UserId = sql.UserId WHERE r.Name = 'r' AND sql.Name = 'sql'
sede
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student_record ( studen...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%intel...
advising
CREATE TABLE table_name_60 ( laps INTEGER, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the lap with a finish of 24?
SELECT SUM(laps) FROM table_name_60 WHERE finish = "24"
sql_create_context
CREATE TABLE table_69664 ( "Round" real, "Date" text, "Grand Prix" text, "Circuit" text, "125cc winner" text, "250cc winner" text, "MotoGP winner" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for motogp win...
SELECT "Date" FROM table_69664 WHERE "MotoGP winner" = 'casey stoner' AND "Grand Prix" = 'valencian grand prix'
wikisql
CREATE TABLE airport ( International_Passengers INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of international passengers of all airports?
SELECT AVG(International_Passengers) FROM airport
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26995)) AND STRFTIME('%y-%m-%d', outputeve...
mimic_iii
CREATE TABLE table_name_57 ( event VARCHAR, olympics VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event is in the 1952 summer olympics?
SELECT event FROM table_name_57 WHERE olympics = "1952 summer olympics"
sql_create_context
CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE songs ( songid number, title text ) CREATE TABLE a...
SELECT T2.lastname FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_203_123 ( id number, "year" number, "title" text, "b-side" text, "mediums" text, "label (catalog)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the single birds vs.worms or broke was released first ?
SELECT "title" FROM table_203_123 WHERE "title" IN ('"birds vs. worms"', '"broke"') ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_name_77 ( city VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What City is the Jal hotel in?
SELECT city FROM table_name_77 WHERE name = "jal hotel"
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.insurance = "Private" AND demographic.age < "36"
mimicsql_data
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
SELECT MAX(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 = 20441)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
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 lab.itemid FROM lab WHERE lab.subject_id = "6983"
mimicsql_data
CREATE TABLE table_name_71 ( attendance INTEGER, visitor VARCHAR, leading_scorer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people were in attendance when the visiting team was the Nuggets and the leading scorer was J.R. Smith (28)?
SELECT SUM(attendance) FROM table_name_71 WHERE visitor = "nuggets" AND leading_scorer = "j.r. smith (28)"
sql_create_context
CREATE TABLE table_39374 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which score was for the Spurs as visitors with record of 35 16?
SELECT "Score" FROM table_39374 WHERE "Visitor" = 'spurs' AND "Record" = '35–16'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_40950 ( "Year" real, "Date" text, "Television" text, "Designated Visitors" text, "Designated Home" text, "Stadium" text, "City" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year had a date of TBA where the Oakland r...
SELECT AVG("Year") FROM table_40950 WHERE "Date" = 'tba' AND "Designated Home" = 'oakland raiders'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patient...
SELECT MIN(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 = '029-584' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitalad...
eicu
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54894 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'neutrophils') ORDER BY labevents.chartt...
mimic_iii
CREATE TABLE table_name_28 ( money_raised VARCHAR, _2q VARCHAR, total_receipts VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much money was raised in the 2Q when the total receipts were $63,075,927?
SELECT money_raised, _2q FROM table_name_28 WHERE total_receipts = "$63,075,927"
sql_create_context
CREATE TABLE table_name_95 ( status VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of the ship INS Ranvir?
SELECT status FROM table_name_95 WHERE name = "ins ranvir"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88180) AND prescriptions.drug IN ('epoetin alfa', 'lisinopril', 'diphenhydramine') AND STRFTIME('%y', prescriptions.startdate) = '2105'
mimic_iii
CREATE TABLE table_1525 ( "Team" text, "P" real, "W" real, "D" real, "L" real, "Tries for" real, "Tries against" real, "Try diff" text, "Points for" real, "Points against" real, "Points diff" text, "Pts" real ) -- Using valid SQLite, answer the following questions for t...
SELECT MIN("Tries for") FROM table_1525 WHERE "W" = '4'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
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 = 'dmii wo cmp nt st ...
mimic_iii
CREATE TABLE table_name_90 ( cuts_made INTEGER, top_25 VARCHAR, top_5 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of cuts made where the top 25 is less than 6 and the top-5 is more than 0?
SELECT SUM(cuts_made) FROM table_name_90 WHERE top_25 < 6 AND top_5 > 0
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ...
SELECT a.Id AS "post_link", b.NumberOfDuplicates FROM Posts AS a LEFT JOIN (SELECT Posts.Id, COUNT(PostLinks.RelatedPostId) AS NumberOfDuplicates FROM Posts, PostLinks WHERE Posts.Id = PostLinks.RelatedPostId AND PostLinks.LinkTypeId = 3 GROUP BY Posts.Id) AS b ON a.Id = b.Id WHERE Tags LIKE '%python%' AND Tags LIKE '%...
sede
CREATE TABLE table_name_46 ( z___p__ INTEGER, element VARCHAR, n___n__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Z (p) when arsenic is the element, and the N (n) is more than 42
SELECT MAX(z___p__) FROM table_name_46 WHERE element = "arsenic" AND n___n__ > 42
sql_create_context
CREATE TABLE table_name_88 ( years_of_operation VARCHAR, client VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years was soc a client?
SELECT years_of_operation FROM table_name_88 WHERE client = "soc"
sql_create_context
CREATE TABLE table_3030 ( "Position" text, "Name" text, "Nationality" text, "Event 1 Medley" text, "Event 2 Truck Pull" text, "Event 3 Squat Lift" text, "Event 4 Carwalk" text, "Event 5 Dumbbell Press" text, "Event 6 Atlas Stones" text ) -- Using valid SQLite, answer the following ...
SELECT "Event 3 Squat Lift" FROM table_3030 WHERE "Nationality" = 'United States' AND "Event 2 Truck Pull" = '1 (42.66s)'
wikisql
CREATE TABLE table_204_539 ( id number, "date" text, "name" text, "moving from" text, "moving to" text, "fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the last player to be transferred this season ?
SELECT "name" FROM table_204_539 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_9703 ( "Year" real, "Association" text, "Category" text, "Nominee" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the association that Daniel Mananta belonged to after 2011?
SELECT "Association" FROM table_9703 WHERE "Nominee" = 'daniel mananta' AND "Year" > '2011'
wikisql
CREATE TABLE table_44184 ( "Season" text, "Division" text, "Wins" text, "Ties" text, "Final Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the division with wins of 2?
SELECT "Division" FROM table_44184 WHERE "Wins" = '2'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Gary Saxonhouse%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
advising
CREATE TABLE table_55392 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team of the game on February 3?
SELECT "Home" FROM table_55392 WHERE "Date" = 'february 3'
wikisql
CREATE TABLE table_12041 ( "Season" text, "T/OTL" real, "Points" real, "Finish" text, "Playoffs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season has a 6th north finish and more than 21 points?
SELECT "Season" FROM table_12041 WHERE "Points" > '21' AND "Finish" = '6th north'
wikisql
CREATE TABLE table_36170 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game with a record of 2 3 2 before week 8?
SELECT "Result" FROM table_36170 WHERE "Week" < '8' AND "Record" = '2–3–2'
wikisql
CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Students_in_Detention ( student_id INTEGER, detention_id INTEGER, incident_id INTEGER ) CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_addr...
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_14465871_2 ( cmdlets VARCHAR, version VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many of the cmdlets are the 2008 version?
SELECT COUNT(cmdlets) FROM table_14465871_2 WHERE version = "2008"
sql_create_context
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 person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZ...
css
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 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 = "ELECTIVE" AND procedures.long_title = "Other operations on heart and pericardium"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM te...
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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 = jy...
css
CREATE TABLE table_71502 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest number in attendance when the record is 1-1-0?
SELECT MAX("Attendance") FROM table_71502 WHERE "Record" = '1-1-0'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose 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.long_title = "Transient neonatal thrombocytopenia" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_53028 ( "Name" text, "Real Name" text, "Birthdate" text, "Costume Role" text, "Defining characteristics" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the member with a costume Role of monster?
SELECT "Name" FROM table_53028 WHERE "Costume Role" = 'monster'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2146" AND procedures.icd9_code = "966"
mimicsql_data
CREATE TABLE table_60865 ( "South West DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Losses have Wins smaller than 6, and a South West DFL of sandford?
SELECT MIN("Losses") FROM table_60865 WHERE "Wins" < '6' AND "South West DFL" = 'sandford'
wikisql
CREATE TABLE table_13840 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has Notes of 68.76 m?
SELECT "Position" FROM table_13840 WHERE "Notes" = '68.76 m'
wikisql
CREATE TABLE table_24367 ( "Type of Record" text, "Attendance" real, "Date/Year" text, "Stadium" text, "Result/Games" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of attendance with the pre-season game as the type of record?
SELECT COUNT("Attendance") FROM table_24367 WHERE "Type of Record" = 'Pre-season game'
wikisql
CREATE TABLE table_name_77 ( driver VARCHAR, position VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Driver, when Position is 2nd, and when Season is 2001?
SELECT driver FROM table_name_77 WHERE position = "2nd" AND season = 2001
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 OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '68061275' AND IN_HOSP_DATE BETWEEN '2004-10-02' AND '2005-07-28' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_21576 ( "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. -- Name the kerry # for others# is 44
SELECT "Kerry#" FROM table_21576 WHERE "Others#" = '44'
wikisql
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREA...
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_26570 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of seaso...
SELECT "Title" FROM table_26570 WHERE "No. in season" = '2'
wikisql
CREATE TABLE table_name_41 ( circuit VARCHAR, winning_constructor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which circuit did alfa romeo win?
SELECT circuit FROM table_name_41 WHERE winning_constructor = "alfa romeo"
sql_create_context
CREATE TABLE table_66529 ( "Year" real, "Champion" text, "Grand Finalist" text, "Champion Team Members" text, "Grand Finalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the grand finalist when the grand finalists are jonathan loh, peter...
SELECT "Grand Finalist" FROM table_66529 WHERE "Grand Finalists" = 'jonathan loh, peterson poon, nathan santos'
wikisql
CREATE TABLE table_name_61 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date is Sheffield Wednesday the Home team?
SELECT date FROM table_name_61 WHERE home_team = "sheffield wednesday"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
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.short_title = "Food/vomit pneumonitis" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_56641 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did the away team score at the game when th...
SELECT "Home team" FROM table_56641 WHERE "Away team score" = '7.11 (53)'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%arak%' ORDER BY Reputation DESC
sede
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '牙龈出血' AND jyjgzbb.JCZBDM = '280143'
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND diagnoses.icd9_code = "E9429"
mimicsql_data
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '2型糖尿病' AND jyjgzbb.JCZBMC = '低密度脂蛋白胆固醇'
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 <= 5)
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT demographic.dob, demographic.religion FROM demographic WHERE demographic.subject_id = "14755"
mimicsql_data