instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_ID, School_ID FROM basketball_match GROUP BY ACC_Regular_Season
nvbench
CREATE TABLE table_name_73 ( author VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the author when the title is destination: nerva?
SELECT author FROM table_name_73 WHERE title = "destination: nerva"
sql_create_context
CREATE TABLE table_10718631_2 ( written_by VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote episode 94?
SELECT written_by FROM table_10718631_2 WHERE no_in_series = 94
sql_create_context
CREATE TABLE table_name_50 ( event VARCHAR, result VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the event when the result is loss and the record is 7-5?
SELECT event FROM table_name_50 WHERE result = "loss" AND record = "7-5"
sql_create_context
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_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC
nvbench
CREATE TABLE table_15331868_1 ( position INTEGER, difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smalledt position when the difference was 6?
SELECT MIN(position) FROM table_15331868_1 WHERE difference = "6"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(Nationality) DESC
nvbench
CREATE TABLE table_71706 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid total associated with 18 laps?
SELECT COUNT("Grid") FROM table_71706 WHERE "Laps" = '18'
wikisql
CREATE TABLE table_name_85 ( area VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the area of Mount Albert School?
SELECT area FROM table_name_85 WHERE name = "mount albert school"
sql_create_context
CREATE TABLE table_1341453_7 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many districts does gary condit represent?
SELECT COUNT(district) FROM table_1341453_7 WHERE incumbent = "Gary Condit"
sql_create_context
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varcha...
SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY CRS_CODE DESC
nvbench
CREATE TABLE table_name_69 ( previous_conference VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the previous conference when the location is converse?
SELECT previous_conference FROM table_name_69 WHERE location = "converse"
sql_create_context
CREATE TABLE table_name_53 ( verb_meaning VARCHAR, part_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the verb meaning when the part 1 is lopen?
SELECT verb_meaning FROM table_name_53 WHERE part_1 = "lopen"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperglycemia' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, ...
eicu
CREATE TABLE table_18300 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many parties does the incumbent Donald A. Bailey a member of?
SELECT COUNT("Party") FROM table_18300 WHERE "Incumbent" = 'Donald A. Bailey'
wikisql
CREATE TABLE table_13273629_2 ( original_air_date VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the episode directed by Carey Meyer aired for the first time?
SELECT original_air_date FROM table_13273629_2 WHERE directed_by = "Carey Meyer"
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Atrial cardioversion"
mimicsql_data
CREATE TABLE table_25572068_1 ( circuit VARCHAR, series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What circuit was the FR3.5 11 series on?
SELECT circuit FROM table_25572068_1 WHERE series = "FR3.5 11"
sql_create_context
CREATE TABLE table_name_39 ( floors INTEGER, name VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name of 900 north michigan, and a Year smaller than 1989 involves what lowest floors?
SELECT MIN(floors) FROM table_name_39 WHERE name = "900 north michigan" AND year < 1989
sql_create_context
CREATE TABLE table_29908 ( "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 assists" FROM table_29908 WHERE "Date" = 'November 17'
wikisql
CREATE TABLE table_204_618 ( id number, "place" number, "position" text, "number" number, "name" text, "nasl" number, "playoffs" number, "cfu club championship" number, "concacaf champions league" number, "total" number ) -- Using valid SQLite, answer the following questions fo...
SELECT COUNT(DISTINCT "name") FROM table_204_618
squall
CREATE TABLE table_name_5 ( decision VARCHAR, series VARCHAR, visitor VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Decision has a Visitor of calgary, a Score of 2 1, and a Series of 4 3?
SELECT decision FROM table_name_5 WHERE visitor = "calgary" AND score = "2 – 1" AND series = "4 – 3"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "85" AND demographic.admityear < "2195"
mimicsql_data
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price) DESC
nvbench
CREATE TABLE table_12499 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- From what Country is Gary Evans?
SELECT "Country" FROM table_12499 WHERE "Player" = 'gary evans'
wikisql
CREATE TABLE table_19690 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Language (s)" text, "Director(s)" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many directors for the film
SELECT COUNT("Director(s)") FROM table_19690 WHERE "Original title" = 'Мајки'
wikisql
CREATE TABLE table_name_7 ( time_retired VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time/Retired value of driver Pedro Diniz?
SELECT time_retired FROM table_name_7 WHERE driver = "pedro diniz"
sql_create_context
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 ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22517) AND prescriptions.drug = 'vancomycin' AND STRFTIME('%y-%m', prescriptions.startdate) = '2102-05' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Display a bar chart for how...
SELECT job, AVG(age) FROM Person GROUP BY job
nvbench
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 WHERE demographic.diagnosis = "CHEST PAIN" AND demographic.dob_year < "1837"
mimicsql_data
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
SELECT 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 = '006-19...
eicu
CREATE TABLE table_23356 ( "School" text, "City / Town" text, "Website" text, "Size" real, "Principal" text, "Grades" text, "IDOE Profile" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the grades served at Manchester Junior-Senior ...
SELECT "Grades" FROM table_23356 WHERE "School" = 'Manchester Junior-Senior High School'
wikisql
CREATE TABLE table_39715 ( "Round" real, "Pick #" text, "Player" text, "Position" text, "College" text, "Tenure w/ Steelers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average round for draft pick #49 from Notre Dame?
SELECT AVG("Round") FROM table_39715 WHERE "College" = 'notre dame' AND "Pick #" = '49'
wikisql
CREATE TABLE table_2850912_5 ( college_junior_club_team VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many college/junior/club teams are from Sweden?
SELECT COUNT(college_junior_club_team) FROM table_2850912_5 WHERE nationality = "Sweden"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
SELECT Posts.OwnerUserId, TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE TagName = '##TagName##' GROUP BY Posts.OwnerUserId, TagName ORDER BY UpVotes DESC
sede
CREATE TABLE table_204_81 ( id number, "rank" number, "bib" number, "name" text, "country" text, "time" text, "deficit" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference between the time of the fastest runner and the slow...
SELECT "deficit" FROM table_204_81 ORDER BY "rank" DESC LIMIT 1
squall
CREATE TABLE table_11129 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the decision of the Lightning game when the Canadiens wer...
SELECT "Decision" FROM table_11129 WHERE "Visitor" = 'canadiens'
wikisql
CREATE TABLE table_58331 ( "Aircraft" text, "Origin" text, "Role" text, "Registration" text, "Number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the role of the aircraft that has a registration of s5-hpb?
SELECT "Role" FROM table_58331 WHERE "Registration" = 's5-hpb'
wikisql
CREATE TABLE table_name_83 ( envelopment VARCHAR, family VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the envelopment for the rhabdoviridae family?
SELECT envelopment FROM table_name_83 WHERE family = "rhabdoviridae"
sql_create_context
CREATE TABLE table_29225103_2 ( ep_winning_team VARCHAR, cp_winning_team VARCHAR, gm_winning_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the EP winning team when the CP winning team was Dave Clark and the GM winning team was Stuart Northr...
SELECT ep_winning_team FROM table_29225103_2 WHERE cp_winning_team = "Dave Clark" AND gm_winning_team = "Stuart Northrup"
sql_create_context
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter
nvbench
CREATE TABLE table_name_33 ( matrix INTEGER, recording_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest matrix when the recording date is 1926/03?
SELECT MAX(matrix) FROM table_name_33 WHERE recording_date = "1926/03"
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_Road, School_ID FROM basketball_match ORDER BY School_ID
nvbench
CREATE TABLE table_26362472_1 ( election_date VARCHAR, left_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the election date for those politicians who left office on 1850-11-15?
SELECT COUNT(election_date) FROM table_26362472_1 WHERE left_office = "1850-11-15"
sql_create_context
CREATE TABLE table_name_21 ( away_captain VARCHAR, venue VARCHAR, home_captain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Away Captain when the Home Captain was Joe Darling at Melbourne Cricket Ground?
SELECT away_captain FROM table_name_21 WHERE venue = "melbourne cricket ground" AND home_captain = "joe darling"
sql_create_context
CREATE TABLE table_10892 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of gold medals with more than 1 bronze medal?
SELECT AVG("Gold") FROM table_10892 WHERE "Bronze" > '1'
wikisql
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 * 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 PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( ...
SELECT P.Id AS "post_link", P.FavoriteCount FROM Votes AS V, Posts AS P, PostTypes AS Pt, VoteTypes AS Vt WHERE P.Id = V.PostId AND P.PostTypeId = Pt.Id AND V.VoteTypeId = Vt.Id AND Pt.Id = 1 AND Vt.Id = 5 AND P.Score > 0 AND P.DeletionDate IS NULL AND P.CommunityOwnedDate IS NULL AND NOT P.OwnerUserId IS NULL AND NOT ...
sede
CREATE TABLE table_14489 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game held that resulted in a score of 9-2?
SELECT "Venue" FROM table_14489 WHERE "Score" = '9-2'
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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "8619" AND prescriptions.route = "LEFT EYE"
mimicsql_data
CREATE TABLE table_name_5 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game played on September 9?
SELECT score FROM table_name_5 WHERE date = "september 9"
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND prescriptions.drug = "Fluoxetine"
mimicsql_data
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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 t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '11758190455'
css
CREATE TABLE table_29522 ( "Artist" text, "Country" text, "Number-one single(s)" text, "Year" real, "Weeks at #1" real, "Straight to #1 ?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years was the country Belgium?
SELECT COUNT("Year") FROM table_29522 WHERE "Country" = 'Belgium'
wikisql
CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE bridge ( architect_id number, id number, name text, location text, length_meters number, length_feet number ) CREATE TABLE mill ( architect_id number, id number, location text,...
SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 2 UNION SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 1
spider
CREATE TABLE Products_in_Events ( Product_in_Event_ID INTEGER, Event_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Assets ( Asset_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Assets_in_Events ( Asset_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Addresses ( Address_ID INTEGER, ...
SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(Product_Type_Code) DESC
nvbench
CREATE TABLE table_41076 ( "Position" text, "Name v t e" text, "Height (cm)" real, "Weight (kg)" real, "Birthplace" text, "1999-2000 team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Height (cm), when the Weight (kg) is 90?...
SELECT SUM("Height (cm)") FROM table_41076 WHERE "Weight (kg)" = '90'
wikisql
CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_...
SELECT T2.emp_fname, T1.crs_code FROM class AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num
spider
CREATE TABLE table_31586 ( "Camp" text, "Place" text, "Province" text, "Location" text, "Period" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the province of 1941-1946
SELECT "Province" FROM table_31586 WHERE "Period" = '1941-1946'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPOXIA" AND procedures.short_title = "Coronar arteriogr-1 cath"
mimicsql_data
CREATE TABLE table_49411 ( "Outcome" text, "Date" 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. -- Which Surface has an Outcome of runner-up, and a Score...
SELECT "Surface" FROM table_49411 WHERE "Outcome" = 'runner-up' AND "Score in the final" = '4–6, 6–7, 6–2, 2–6'
wikisql
CREATE TABLE table_name_90 ( round INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest round when the player is troy creurer (d)?
SELECT MAX(round) FROM table_name_90 WHERE player = "troy creurer (d)"
sql_create_context
CREATE TABLE field ( fieldid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperda...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'optimization' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'nips'
scholar
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ...
WITH userdata AS (SELECT Id, Reputation, age, CASE WHEN age >= 15 AND age <= 39 THEN 'younger' WHEN age > 39 AND age <= 70 THEN 'veteran' END AS age_cat, (SELECT CAST(SUM(all_answers.Score) AS FLOAT) / COUNT(DISTINCT all_answers.Id) AS avg_score FROM Posts AS all_answers WHERE all_answers.PostTypeId = 2 AND all_answers...
sede
CREATE TABLE table_40926 ( "From" real, "Goal" text, "Round 1" text, "Round 2" text, "Round 3" text, "Round 4" text, "Round 5" text, "Round 6+" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Round 2 from 1999?
SELECT "Round 2" FROM table_40926 WHERE "From" = '1999'
wikisql
CREATE TABLE table_66401 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for the game larger than 4 in series 3-2?
SELECT "Score" FROM table_66401 WHERE "Game" > '4' AND "Series" = '3-2'
wikisql
CREATE TABLE table_16027 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score with partner Jim Pugh?
SELECT "Score" FROM table_16027 WHERE "Partner" = 'Jim Pugh'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREA...
SELECT SourceTagName, TargetTagName FROM TagSynonyms WHERE TargetTagName IN (SELECT TargetTagName FROM TagSynonyms GROUP BY TargetTagName ORDER BY COUNT(Id) DESC LIMIT 30) ORDER BY TargetTagName
sede
CREATE TABLE table_30487 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the leas...
SELECT MIN("No.") FROM table_30487 WHERE "Production code" = 'XLE02007'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( ...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27362)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), '...
mimic_iii
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2083"
mimicsql_data
CREATE TABLE table_name_31 ( total VARCHAR, a_score VARCHAR, b_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Total that has the A Score larger than 6.4, and the B Score smaller than 9.025?
SELECT total FROM table_name_31 WHERE a_score > 6.4 AND b_score < 9.025
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_i...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'micu' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
mimic_iii
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')...
eicu
CREATE TABLE table_name_77 ( total VARCHAR, club VARCHAR, league_goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Total, when Club is Leeds United, and when League Goals is 13?
SELECT COUNT(total) FROM table_name_77 WHERE club = "leeds united" AND league_goals = "13"
sql_create_context
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 * FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE table_24625467_1 ( original_air_date VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the episode with a production code of 2j5356 originally air?
SELECT original_air_date FROM table_24625467_1 WHERE production_code = "2J5356"
sql_create_context
CREATE TABLE table_name_97 ( tournament VARCHAR, opponent_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At which tournament does Milan play against Hungary's league selection?
SELECT tournament FROM table_name_97 WHERE opponent_team = "hungary's league selection"
sql_create_context
CREATE TABLE table_47599 ( "Rank" text, "Team" text, "Run 1" text, "Run 2" text, "Run 3" text, "Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has run 1 of 1:17.44?
SELECT "Team" FROM table_47599 WHERE "Run 1" = '1:17.44'
wikisql
CREATE TABLE table_40428 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location when the time was 11:55?
SELECT "Location" FROM table_40428 WHERE "Time" = '11:55'
wikisql
CREATE TABLE table_2780146_6 ( no_x__g_kwh_ VARCHAR, hc__g_kwh_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the NO of the standard with HC of 1.23 g/kWh?
SELECT no_x__g_kwh_ FROM table_2780146_6 WHERE hc__g_kwh_ = "1.23"
sql_create_context
CREATE TABLE table_12206 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Finish which has a Total of 287?
SELECT "Finish" FROM table_12206 WHERE "Total" = '287'
wikisql
CREATE TABLE table_17947 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the others# when bush% is 57.0%?
SELECT MAX("Others#") FROM table_17947 WHERE "Bush%" = '57.0%'
wikisql
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare ( fare_id int, from_...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code A...
atis
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 DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND course.has_projects = 'Y' AND program_course.category LIKE 'ULCS'
advising
CREATE TABLE table_200_47 ( id number, "date" text, "event" text, "duration\t\n(months)" text, "duration\t\t\n(years)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when did the second drop in the experiment fall ?
SELECT "date" FROM table_200_47 WHERE "event" = '2nd drop fell'
squall
CREATE TABLE table_name_76 ( attendance VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance for the game played at 3:31?
SELECT attendance FROM table_name_76 WHERE time = "3:31"
sql_create_context
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID ...
SELECT Name, COUNT(Name) FROM train GROUP BY Name
nvbench
CREATE TABLE table_26998693_1 ( season INTEGER, podiums VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest season where podium was 9?
SELECT MIN(season) FROM table_26998693_1 WHERE podiums = 9
sql_create_context
CREATE TABLE table_40585 ( "Season" real, "Episodes" real, "Premiere" text, "Finale" text, "DVD release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which premiere had more than 15 episodes?
SELECT "Premiere" FROM table_40585 WHERE "Episodes" > '15'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12367) AND STRFTIME('%y', procedures_icd.charttime) >= '2105'
mimic_iii
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location te...
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx-circulatory dis nec') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2101' GROUP BY STRFTIME('%y',...
mimic_iii
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
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 = '004-79017')) AND NOT vitalperiodic.respiration IS N...
eicu
CREATE TABLE table_63456 ( "Result" text, "Record" text, "Method" text, "Event" text, "Round" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Round of the event with a Record of 5-4?
SELECT "Round" FROM table_63456 WHERE "Record" = '5-4'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Users.Id AS "user_link", Reputation, (SELECT TagName FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = Users.I...
sede
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
SELECT AVG(AcceptedPercent) FROM (SELECT u.Id AS "user_link", COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, (SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(*)) AS AcceptedPercent FROM Posts AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserI...
sede
CREATE TABLE table_4992 ( "Version" text, "Length" text, "Album" text, "Remixed by" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Version has a Remixed by Perky Park with a Length of 6:38?
SELECT "Version" FROM table_4992 WHERE "Remixed by" = 'perky park' AND "Length" = '6:38'
wikisql
CREATE TABLE table_name_81 ( winner VARCHAR, runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the winner when mark fuller was the runner-up?
SELECT winner FROM table_name_81 WHERE runner_up = "mark fuller"
sql_create_context
CREATE TABLE table_name_60 ( team VARCHAR, qual_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Team had a 1:24.365 Qual 2?
SELECT team FROM table_name_60 WHERE qual_2 = "1:24.365"
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time...
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '5267326' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 27
css