instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_203_397 ( id number, "series" text, "launch date" text, "finale date" text, "days" number, "housemates" number, "winner" text, "main presenter" text, "grand prize" text, "liveshow\naudience\nmillions" number ) -- Using valid SQLite, answer the following quest...
SELECT COUNT("series") FROM table_203_397 WHERE "days" > 100
squall
CREATE TABLE table_203_185 ( id number, "season" text, "a\ntechnical" text, "b\nscientific" text, "c\nfine arts" text, "d\nimprovisational" text, "e\nstructural" text, "rising stars!\u00ae" text, "po\nprojectoutreach\u00ae" text, "university level" text ) -- Using valid SQLite,...
SELECT "d\nimprovisational" FROM table_203_185 ORDER BY "season" LIMIT 1
squall
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX n...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number,...
SELECT Id AS "post_link", Score, ViewCount, (CAST(Score AS FLOAT) / (CAST(ViewCount AS FLOAT) + 1)) AS votes_per_view FROM Posts WHERE OwnerUserId = '##userid##' AND PostTypeId = 1 AND ViewCount > 10 ORDER BY votes_per_view DESC
sede
CREATE TABLE table_name_67 ( venue VARCHAR, time VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue of the match with a 14:30 time and sun source as the away team?
SELECT venue FROM table_name_67 WHERE time = "14:30" AND away_team = "sun source"
sql_create_context
CREATE TABLE table_2618072_1 ( directed_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the directed by when the production code is 67425?
SELECT directed_by FROM table_2618072_1 WHERE production_code = 67425
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 patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-20631') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', ...
eicu
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number <> 524 AND instructor.name LIKE '%Saumuy Puchala%' AND offering_instructor.instructor_id = instructor.instructor_id AND offerin...
advising
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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '喻思聪' AND IN_HOSP_DATE BETWEEN '2002-10-16' AND '2006-01-26' GROUP BY IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_name_27 ( score VARCHAR, away_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a date of Aldershot and Aldershot as the away team what was the score of the game?
SELECT score FROM table_name_27 WHERE away_team = "aldershot" AND date = "aldershot"
sql_create_context
CREATE TABLE table_name_3 ( l3_cache VARCHAR, release_price___usd__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the L3 cache of the processor with a release price of $440?
SELECT l3_cache FROM table_name_3 WHERE release_price___usd__ = "$440"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-3149')) AND NOT vitalperiodic.heartrate IS NULL...
eicu
CREATE TABLE table_203_237 ( id number, "n" number, "p" text, "nat." text, "name" text, "age" number, "moving from" text, "type" text, "transfer\nwindow" text, "ends" number, "transfer\nfee" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "moving from" FROM table_203_237 WHERE "name" = 'henning berg'
squall
CREATE TABLE HOTELS ( hotel_id VARCHAR, star_rating_code VARCHAR, price_range VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the id and star rating of each hotel, ordered by its price from low to high.
SELECT hotel_id, star_rating_code FROM HOTELS ORDER BY price_range
sql_create_context
CREATE TABLE mountain ( id VARCHAR, country VARCHAR ) CREATE TABLE photos ( camera_lens_id VARCHAR, mountain_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many distinct kinds of camera lenses are used to take photos of mountains in the count...
SELECT COUNT(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.country = 'Ethiopia'
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABL...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'morphine sr (ms contin)' AND STRFTIME('%y', prescriptions.startdate) = '2104')
mimic_iii
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '胆囊炎' AND hz_info.RYBH = ...
css
CREATE TABLE table_12419 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the rank points when the total was 11?
SELECT "Rank points" FROM table_12419 WHERE "Total" = '11'
wikisql
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_Name, School_ID FROM basketball_match ORDER BY School_ID DESC
nvbench
CREATE TABLE table_name_66 ( date VARCHAR, meet VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date was the Meet of 2007 Pan American Games with a Time of 1:07.78?
SELECT date FROM table_name_66 WHERE meet = "2007 pan american games" AND time = "1:07.78"
sql_create_context
CREATE TABLE table_75445 ( "Celebrity" text, "Famous for" text, "Entered" text, "Exited" text, "Finished" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the celebrity finish that entered on day 1 and exited on day 19?
SELECT "Finished" FROM table_75445 WHERE "Exited" = 'day 19' AND "Entered" = 'day 1'
wikisql
CREATE TABLE table_75858 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Ground with a Date that is 2008-06-20?
SELECT "Ground" FROM table_75858 WHERE "Date" = '2008-06-20'
wikisql
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 COUNT(wdmzjzjlb.ZZYSGH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '51768625' AND wdmzjzjlb.JZKSRQ BETWEEN '2013-02-09' AND '2016-05-30' UNION SELECT COUNT(bdmzjzjlb.ZZYSGH) FROM hz_info JOIN bdmzjzjlb ON hz_...
css
CREATE TABLE requirement ( requirement_id int, requirement varchar, college 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 program ( progr...
SELECT DISTINCT department FROM course WHERE name LIKE '%New Astronomy for Advanced Students%'
advising
CREATE TABLE table_name_51 ( change___percentage_ INTEGER, land_area__km²_ VARCHAR, population_density__per_km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average change to have a land area of 546.74 and a population density greater than...
SELECT AVG(change___percentage_) FROM table_name_51 WHERE land_area__km²_ = 546.74 AND population_density__per_km²_ > 0.5
sql_create_context
CREATE TABLE table_101 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college had a LB in the draft?
SELECT "College" FROM table_101 WHERE "Position" = 'LB'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semes...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
advising
CREATE TABLE table_name_81 ( opponent VARCHAR, round VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent in the fight of 1 round when the record is 18-7?
SELECT opponent FROM table_name_81 WHERE round = "1" AND record = "18-7"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'protein, total'))
mimic_iii
CREATE TABLE table_71787 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of overall for defensive tackle
SELECT COUNT("Overall") FROM table_71787 WHERE "Position" = 'defensive tackle'
wikisql
CREATE TABLE table_name_94 ( goal_diff INTEGER, losses VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has a Losses value larger than 1 and a Wins value smaller than 0?
SELECT SUM(goal_diff) FROM table_name_94 WHERE losses > 1 AND wins < 0
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTas...
SELECT ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank, rate.TagName AS Tag, rate.Rate AS QuestionsLastYear FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2016-08-01' AND Posts.CreationDate > '2015-08-01' AND TagN...
sede
CREATE TABLE table_name_65 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On September 10, 1989 how many people attended the game?
SELECT attendance FROM table_name_65 WHERE date = "september 10, 1989"
sql_create_context
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Pleas...
SELECT director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY director ORDER BY MIN(T1.stars)
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CR...
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 = 2514)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial b...
mimic_iii
CREATE TABLE table_name_72 ( overall VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the overall draft pick for the player selected for the tight end position?
SELECT overall FROM table_name_72 WHERE position = "tight end"
sql_create_context
CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE region ( Region_ID int, Region_name text, Date ...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID
nvbench
CREATE TABLE table_name_88 ( score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of Bernhard Langer after 3 rounds?
SELECT score FROM table_name_88 WHERE player = "bernhard langer"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.diagnosis = "CONGESTIVE HEART FAILURE"
mimicsql_data
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T2.Revenue
nvbench
CREATE TABLE table_27539535_5 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Against what team did the Islanders have a 5-18-5 record?
SELECT opponent FROM table_27539535_5 WHERE record = "5-18-5"
sql_create_context
CREATE TABLE table_2781227_1 ( college_junior_club_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the college/junior/club team name of player Mats Lindgren?
SELECT college_junior_club_team FROM table_2781227_1 WHERE player = "Mats Lindgren"
sql_create_context
CREATE TABLE table_name_73 ( score VARCHAR, visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game on November 9 when Atlanta was the visiting team?
SELECT score FROM table_name_73 WHERE visitor = "atlanta" AND date = "november 9"
sql_create_context
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice) DESC
nvbench
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostsWithDeleted ( Id number, PostTyp...
SELECT c.Id AS "comment_link", c.Score, c.CreationDate, LENGTH(Text) FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE Text LIKE 'What have you tried%' AND NOT p.AcceptedAnswerId IS NULL AND LENGTH(Text) < 33 AND p.CommentCount < '##CommentThread:int?4##' ORDER BY LENGTH(Text), c.Score DESC, c.CreationD...
sede
CREATE TABLE table_name_40 ( lane INTEGER, nationality VARCHAR, heat VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's Great Britain's lane with a heat less than 3?
SELECT AVG(lane) FROM table_name_40 WHERE nationality = "great britain" AND heat < 3
sql_create_context
CREATE TABLE table_76687 ( "Full name" text, "Alias" text, "Age\u00b9" real, "From" text, "Occupation\u00b2" text, "Specialty" text, "Position/ Eliminated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Position/ Eliminated, when Fro...
SELECT "Position/ Eliminated" FROM table_76687 WHERE "From" = 'kuala lumpur' AND "Specialty" = 'contemporary lyrical jazz'
wikisql
CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) ) CREATE TABLE student ( ID varchar(5...
SELECT building, COUNT(building) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY building ORDER BY COUNT(building) DESC
nvbench
CREATE TABLE table_name_93 ( player VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Player, when Place is 2?
SELECT player FROM table_name_93 WHERE place = "2"
sql_create_context
CREATE TABLE Catalog_Structure ( catalog_level_number INTEGER, catalog_id INTEGER, catalog_level_name VARCHAR(50) ) CREATE TABLE Catalogs ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME ) CREA...
SELECT date_of_latest_revision, COUNT(date_of_latest_revision) FROM Catalogs ORDER BY date_of_latest_revision DESC
nvbench
CREATE TABLE table_1816947_2 ( average_attendance_home VARCHAR, division___section VARCHAR, average_attendance_away VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the average away attendance is 1.889 in the Superettan, what's the average home attend...
SELECT average_attendance_home FROM table_1816947_2 WHERE division___section = "Superettan" AND average_attendance_away = "1.889"
sql_create_context
CREATE TABLE table_50211 ( "Opposing Team" text, "Against" real, "Date" text, "Venue" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Against that were played in the H Venue on 26 february 1949?
SELECT COUNT("Against") FROM table_50211 WHERE "Venue" = 'h' AND "Date" = '26 february 1949'
wikisql
CREATE TABLE table_67394 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the region for cd with catalog of alca-9203
SELECT "Region" FROM table_67394 WHERE "Format" = 'cd' AND "Catalog" = 'alca-9203'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-29464')) AND medication.drugname IN ('propofol', 'metoprolol tartrate ...
eicu
CREATE TABLE table_33038 ( "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. -- Which venue hosted a home team with a score of 1...
SELECT "Venue" FROM table_33038 WHERE "Home team score" = '11.16 (82)'
wikisql
CREATE TABLE table_41743 ( "Date" text, "Opponent" text, "Location" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location when the Opponent shows vs. #23 south carolina?
SELECT "Location" FROM table_41743 WHERE "Opponent" = 'vs. #23 south carolina'
wikisql
CREATE TABLE table_39612 ( "Value" text, "Color" text, "Obverse" text, "Reverse" text, "First issued" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What reverse has a color of green?
SELECT "Reverse" FROM table_39612 WHERE "Color" = 'green'
wikisql
CREATE TABLE table_name_96 ( grid INTEGER, time_retired VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many grids have more than 24 laps with a time/retired of +1:12.208?
SELECT SUM(grid) FROM table_name_96 WHERE time_retired = "+1:12.208" AND laps > 24
sql_create_context
CREATE TABLE table_55822 ( "Class" text, "Operator" text, "Number" real, "Year Built" text, "Cars per Set" real, "Unit Numbers." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the class 253 larger than 18 built?
SELECT "Year Built" FROM table_55822 WHERE "Class" = 'class 253' AND "Number" > '18'
wikisql
CREATE TABLE table_26993 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team ...
SELECT "Team" FROM table_26993 WHERE "Points" = '22'
wikisql
CREATE TABLE submission ( Author VARCHAR, Scores VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the authors of submissions in ascending order of scores.
SELECT Author FROM submission ORDER BY Scores
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_...
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKL...
atis
CREATE TABLE table_59433 ( "Mark" text, "Wind*" text, "Athlete" text, "Nationality" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mark from April 2, 1994 with a wind number of 2.0?
SELECT "Mark" FROM table_59433 WHERE "Wind*" = '2.0' AND "Date" = 'april 2, 1994'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number...
SELECT a.OwnerUserId, MIN(a.CreationDate), ROW_NUMBER() OVER (ORDER BY MIN(a.CreationDate)) AS AnswerCount FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.Tags LIKE '%<tensorflow>%' GROUP BY a.OwnerUserId ORDER BY MIN(a.CreationDate)
sede
CREATE TABLE table_57791 ( "Name" text, "Power" text, "Torque" text, "Size" text, "Engine code" text, "0\u2013100km/h,s" real, "Top speed" text, "Years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the power of the engine with ...
SELECT "Power" FROM table_57791 WHERE "Engine code" = 'm44b19'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "50" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT * FROM Comments WHERE PostId = 7445597 ORDER BY CreationDate
sede
CREATE TABLE table_22297140_3 ( outgoing_manager VARCHAR, replaced_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which outgoing manager was replaced by Jafar Fatahi?
SELECT outgoing_manager FROM table_22297140_3 WHERE replaced_by = "Jafar Fatahi"
sql_create_context
CREATE TABLE table_name_59 ( others__number VARCHAR, bush__percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the other number with 63.98% bush?
SELECT others__number FROM table_name_59 WHERE bush__percentage = "63.98%"
sql_create_context
CREATE TABLE table_name_69 ( acceleration_0_100km_h__0_62mph_ VARCHAR, transmission VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the acceleration 0 100km/h (0 62mph) when the transmission is 5-speed manual?
SELECT acceleration_0_100km_h__0_62mph_ FROM table_name_69 WHERE transmission = "5-speed manual"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( la...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486')) AND NOT vitalperiodic.sao2 IS NULL AND ...
eicu
CREATE TABLE table_41155 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has a Played larger than 9, and ...
SELECT MIN("Position") FROM table_41155 WHERE "Played" > '9' AND "Points" < '11' AND "Drawn" < '0'
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "18351"
mimicsql_data
CREATE TABLE table_name_84 ( time VARCHAR, lane VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Spain had what time with lanes smaller than 4?
SELECT time FROM table_name_84 WHERE lane < 4 AND nationality = "spain"
sql_create_context
CREATE TABLE table_name_52 ( manufacturer VARCHAR, laps VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which manufacturer has 23 laps and a time of +45.195?
SELECT manufacturer FROM table_name_52 WHERE laps = 23 AND time_retired = "+45.195"
sql_create_context
CREATE TABLE table_31477 ( "Round" real, "Circuit" text, "Date" text, "Length" text, "Pole Position" text, "GT3 Winner" text, "GT4 Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When charles bateman michael lyons is the gt3 winner an...
SELECT "GT4 Winner" FROM table_31477 WHERE "Circuit" = 'Donington Park' AND "GT3 Winner" = 'Charles Bateman Michael Lyons'
wikisql
CREATE TABLE table_name_23 ( overall INTEGER, college VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average overall pick number for the USF player who was picked after round 5?
SELECT AVG(overall) FROM table_name_23 WHERE college = "usf" AND round > 5
sql_create_context
CREATE TABLE table_60396 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Seve Ballesteros's score?
SELECT "Score" FROM table_60396 WHERE "Player" = 'seve ballesteros'
wikisql
CREATE TABLE table_12226390_2 ( directed_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode with production code 28?
SELECT directed_by FROM table_12226390_2 WHERE production_code = 28
sql_create_context
CREATE TABLE table_33346 ( "Translator Call Letters" text, "B Mountain Channel" text, "Laurel Mountain Channel" text, "PSIP" text, "Station Call Letters" text, "Network Affiliation ID" text, "Original Channel" text, "Signal Quality" text ) -- Using valid SQLite, answer the following qu...
SELECT "Signal Quality" FROM table_33346 WHERE "Station Call Letters" = 'kcal-dt'
wikisql
CREATE TABLE table_51560 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue #" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date had a 4ad label and a CD (reissue) format?
SELECT "Date" FROM table_51560 WHERE "Label" = '4ad' AND "Format" = 'cd (reissue)'
wikisql
CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text ) CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT COUNT(DISTINCT rank) FROM captain
spider
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, AVG(Price) FROM Products GROUP BY Name ORDER BY Name DESC
nvbench
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(*) > 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-40255' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit...
eicu
CREATE TABLE table_name_60 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average for 2009 when 2001 is more than 0, 1996 is less than 1 and 2004 is more than 2
SELECT AVG(2009) FROM table_name_60 WHERE 2001 > 0 AND 1996 < 1 AND 2004 > 2
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-16572')) AND NOT vitalperiodic.systemicsystolic...
eicu
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8871738' AND t_kc22.SOC_SRT_DIRE_NM = '米氮平片(薄膜衣)'
css
CREATE TABLE table_dev_39 ( "id" int, "gender" string, "random_serum_glucose" int, "glycated_hemoglobin" bool, "heart_disease" bool, "stroke" bool, "diabetes_mellitus" bool, "hgba1c" float, "diabetic" string, "fasting_blood_glucose_fbg" float, "fasting_plasma_glucose" int, ...
SELECT * FROM table_dev_39 WHERE diabetic = 'i' OR diabetic = 'ii' OR fasting_plasma_glucose > 126
criteria2sql
CREATE TABLE Movie ( director VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For directors who had more than one movie, return the titles and produced years of all movies directed by them.
SELECT T1.title, T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title
sql_create_context
CREATE TABLE table_61333 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was jerry bohlander's time?
SELECT "Time" FROM table_61333 WHERE "Opponent" = 'jerry bohlander'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS"
mimicsql_data
CREATE TABLE table_11545282_6 ( years_for_jazz VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For how many players from UTEP can one calculate how many years they've played for Jazz?
SELECT COUNT(years_for_jazz) FROM table_11545282_6 WHERE school_club_team = "UTEP"
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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atrial fibrillation' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOI...
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.gender = "M"
mimicsql_data
CREATE TABLE table_25116 ( "Player" text, "Nat" text, "Pos" text, "L Apps" real, "L G" real, "C Apps" real, "C G" real, "Total Apps" real, "Total G" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least total apps for jaime
SELECT MIN("Total Apps") FROM table_25116 WHERE "Player" = 'Jaime'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number...
WITH EarlyPosts AS (SELECT OwnerUserId, Id, Score, ROW_NUMBER() OVER (PARTITION BY OwnerUserId ORDER BY CreationDate) AS Row FROM Posts WHERE Posts.PostTypeId = 2) SELECT OwnerUserId AS "user_link", SUM(Score) AS EarlyScore FROM EarlyPosts WHERE Row <= 10 GROUP BY OwnerUserId ORDER BY EarlyScore DESC
sede
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_23385853_20 ( power_stage_wins VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the power stage wins total number if the wins is 10?
SELECT COUNT(power_stage_wins) FROM table_23385853_20 WHERE wins = 10
sql_create_context
CREATE TABLE table_name_19 ( location VARCHAR, method VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the match where the method was submission (armbar) and Mayra Conde was the opponent?
SELECT location FROM table_name_19 WHERE method = "submission (armbar)" AND opponent = "mayra conde"
sql_create_context