instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_40359 ( "Position" text, "Jersey #" real, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "2008\u20132009 Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the posit...
SELECT "Position" FROM table_40359 WHERE "Jersey #" > '30' AND "Birthdate" = 'december 23, 1986'
wikisql
CREATE TABLE Royal_Family ( Royal_Family_ID INTEGER, Royal_Family_Details VARCHAR(255) ) CREATE TABLE Visitors ( Tourist_ID INTEGER, Tourist_Details VARCHAR(255) ) CREATE TABLE Hotels ( hotel_id INTEGER, star_rating_code CHAR(15), pets_allowed_yn CHAR(1), price_range real, other_ho...
SELECT T1.Tourist_Attraction_ID, COUNT(*) FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID
nvbench
CREATE TABLE table_name_96 ( race VARCHAR, nation VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the race in Kenya with a time of 30:27?
SELECT race FROM table_name_96 WHERE nation = "kenya" AND time = "30:27"
sql_create_context
CREATE TABLE table_53494 ( "Year" real, "Western champion" text, "Result" text, "Eastern champion" text, "Finals MVP" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result from 2013?
SELECT "Result" FROM table_53494 WHERE "Year" = '2013'
wikisql
CREATE TABLE table_name_73 ( wins INTEGER, top_10 INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of wins that is in the Top 10 and larger than 13?
SELECT SUM(wins) FROM table_name_73 WHERE top_10 > 13
sql_create_context
CREATE TABLE table_16078390_2 ( founded INTEGER, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the university that is located in Ellensburg, Washington established?
SELECT MIN(founded) FROM table_16078390_2 WHERE location = "Ellensburg, Washington"
sql_create_context
CREATE TABLE table_name_56 ( position VARCHAR, lost VARCHAR, points VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of positions for teams with more than 5 points, 3 draws, and under 2 losses?
SELECT COUNT(position) FROM table_name_56 WHERE points > 5 AND drawn = 3 AND lost < 2
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3692210' AND IN_HOSP_DATE BETWEEN '2010-10-25' AND '2020-02-24' AND SERVANT_FLG = '公务员'
css
CREATE TABLE table_204_202 ( id number, "year" number, "tournament" text, "venue" text, "result" text, "rank" text, "event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in which city did kaseorg attempt but not complete the decathlon ?
SELECT "venue" FROM table_204_202 WHERE "result" IS NULL
squall
CREATE TABLE table_2159547_3 ( date_successor_seated VARCHAR, vacator VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was James P. Buchanan (d)'s successor seated?
SELECT date_successor_seated FROM table_2159547_3 WHERE vacator = "James P. Buchanan (D)"
sql_create_context
CREATE TABLE table_52208 ( "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 date did richmond play as away?
SELECT "Date" FROM table_52208 WHERE "Away team" = 'richmond'
wikisql
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 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 = 19352)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
CREATE TABLE table_name_85 ( result VARCHAR, week VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the result when the Washington Redskins were the opponents on a week after 8?
SELECT result FROM table_name_85 WHERE week > 8 AND opponent = "washington redskins"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY Sex
nvbench
CREATE TABLE table_35671 ( "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 Team of crici ma, and a Dr...
SELECT AVG("Position") FROM table_35671 WHERE "Team" = 'criciúma' AND "Drawn" > '8'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program ( program_id int, name varchar...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E...
advising
CREATE TABLE table_16575609_1 ( cfl_team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who picked a player from Weber State?
SELECT cfl_team FROM table_16575609_1 WHERE college = "Weber State"
sql_create_context
CREATE TABLE table_54681 ( "Player" text, "Tries" text, "Conv" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tries took place on 06/07/1996?
SELECT "Tries" FROM table_54681 WHERE "Date" = '06/07/1996'
wikisql
CREATE TABLE fgwyjzb ( 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 gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '48319787' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3818.79) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '48319787' AND...
css
CREATE TABLE table_78060 ( "Track" real, "Recorded" text, "Catalogue" text, "Release Date" text, "Song Title" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the sum of tracks for raised on rock
SELECT SUM("Track") FROM table_78060 WHERE "Song Title" = 'raised on rock'
wikisql
CREATE TABLE table_25368177_1 ( net_run_rate VARCHAR, total_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different net run rates did the team with 19 total points have?
SELECT COUNT(net_run_rate) FROM table_25368177_1 WHERE total_points = 19
sql_create_context
CREATE TABLE table_name_31 ( city_of_license VARCHAR, frequency_mhz VARCHAR, call_sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city has frequency under 106.5MHz and a callsign of w218ck?
SELECT city_of_license FROM table_name_31 WHERE frequency_mhz < 106.5 AND call_sign = "w218ck"
sql_create_context
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "0" AND prescriptions.drug = "SW"
mimicsql_data
CREATE TABLE table_39320 ( "Region served" text, "ch 1" text, "On-air date" text, "Analogue Power" text, "Digital Power" text, "Analogue HAAT" text, "Digital HAAT" text, "Transmitter Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Transmitter Location" FROM table_39320 WHERE "Digital Power" = '570kw'
wikisql
CREATE TABLE table_25692955_1 ( route_number VARCHAR, north_east_terminal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the route number for santa rosa avenue
SELECT route_number FROM table_25692955_1 WHERE north_east_terminal = "Santa Rosa Avenue"
sql_create_context
CREATE TABLE table_29240 ( "City" text, "Population" real, "Registered voters" text, "Democratic" text, "Republican" text, "D\u2013R spread" text, "Other" text, "No party preference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is...
SELECT "Republican" FROM table_29240 WHERE "D\u2013R spread" = '-14.1%'
wikisql
CREATE TABLE table_43071 ( "Year" real, "Drivers" text, "Races" real, "Wins" real, "Poles" real, "F.L." real, "Points" real, "D.C." text, "T.C." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of D.C. has Races smaller than ...
SELECT "D.C." FROM table_43071 WHERE "Races" < '20' AND "Points" > '0' AND "Drivers" = 'christian vietoris' AND "Wins" = '1'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 14671 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE T...
SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor
nvbench
CREATE TABLE shipment_items ( shipment_id number, order_item_id number ) CREATE TABLE products ( product_id number, product_name text, product_details text ) CREATE TABLE order_items ( order_item_id number, product_id number, order_id number, order_item_status text, order_item_...
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
spider
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 All_Games, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC
nvbench
CREATE TABLE table_37509 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Week number on November 30, 1958 with more than 33,240 in Attendance?
SELECT COUNT("Week") FROM table_37509 WHERE "Date" = 'november 30, 1958' AND "Attendance" > '33,240'
wikisql
CREATE TABLE table_name_41 ( years_for_rockets VARCHAR, school_club_team_country VARCHAR, height_in_ft VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During what years did the Guard from Oklahoma with a height of 6-6 play for the Ro...
SELECT years_for_rockets FROM table_name_41 WHERE height_in_ft = "6-6" AND position = "guard" AND school_club_team_country = "oklahoma"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
SELECT SUM(inputevents_cv.amount) 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 = 594)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2105-05-10'
mimic_iii
CREATE TABLE table_name_60 ( no_in_series INTEGER, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode number is the first episode of season 11 in Melrose Place?
SELECT MIN(no_in_series) FROM table_name_60 WHERE no_in_season = 11
sql_create_context
CREATE TABLE table_18569389_1 ( original_air_date VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the air date that chris long directed
SELECT original_air_date FROM table_18569389_1 WHERE directed_by = "Chris Long"
sql_create_context
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 Votes ( Id number, PostId number, ...
SELECT COUNT(*) AS "TotalQuestions", (SELECT COUNT(*) AS "TotalClosed" FROM Posts AS C WHERE C.OwnerUserId = P.OwnerUserId AND ClosedDate != '') AS "TotalClosed", (SELECT COUNT(*) AS "TotalClosed" FROM Posts AS C WHERE C.OwnerUserId = P.OwnerUserId AND ClosedDate != '') * 100.0 / COUNT(*) * 1.0 AS "percent" FROM Posts ...
sede
CREATE TABLE table_name_4 ( copa_conmebol_1999 VARCHAR, copa_libertadores_1999 VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Copa Conmebol 1999 result of team cruzeiro, which did not qualify for the Copa Libertadores 1999?
SELECT copa_conmebol_1999 FROM table_name_4 WHERE copa_libertadores_1999 = "did not qualify" AND team = "cruzeiro"
sql_create_context
CREATE TABLE table_47713 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for Tie no. 6?
SELECT "Score" FROM table_47713 WHERE "Tie no" = '6'
wikisql
CREATE TABLE table_63399 ( "Tournament" text, "2007" text, "2010" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2007 result when the 2010 result was 2r, at the US Open?
SELECT "2007" FROM table_63399 WHERE "2010" = '2r' AND "Tournament" = 'us open'
wikisql
CREATE TABLE table_name_46 ( money___ VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the money won by Frank Nobilo?
SELECT COUNT(money___) AS £__ FROM table_name_46 WHERE player = "frank nobilo"
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 t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT...
eicu
CREATE TABLE table_name_74 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team played against the away team Carlton?
SELECT home_team FROM table_name_74 WHERE away_team = "carlton"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "27" AND demographic.days_stay > "16"
mimicsql_data
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, ...
WITH MultiBadgeHolders AS (SELECT UserId, Name, Date FROM Badges WHERE UserId IN (SELECT UserId FROM Badges WHERE Name = '##BadgeName1##' INTERSECT SELECT UserId FROM Badges WHERE Name = '##BadgeName2##' INTERSECT SELECT UserId FROM Badges WHERE Name = '##BadgeName3##') AND Name IN ('##BadgeName1##', '##BadgeName2##', ...
sede
CREATE TABLE table_name_9 ( event VARCHAR, time VARCHAR, round VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Event, when Round is '1', when Location is 'New Town, North Dakota , United States' and when Time is '4:12'?
SELECT event FROM table_name_9 WHERE round = 1 AND location = "new town, north dakota , united states" AND time = "4:12"
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2190" AND diagnoses.short_title = "Hx of bladder malignancy"
mimicsql_data
CREATE TABLE table_73230 ( "Sporting profession" text, "First place(s)" real, "Second place(s)" real, "Third place(s)" real, "Total placing(s)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many second place showings does snooker have?
SELECT "Second place(s)" FROM table_73230 WHERE "Sporting profession" = 'Snooker'
wikisql
CREATE TABLE table_3025 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who...
SELECT "Tournament Winner" FROM table_3025 WHERE "Conference" = 'Atlantic Sun Conference'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '戚凯泽' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2014-06-30' AND '2015-06-30'
css
CREATE TABLE table_203_754 ( id number, "no." number, "player" text, "position" text, "career" text, "date no. retired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the only player that started his career in 1965
SELECT "player" FROM table_203_754 WHERE "career" = 1965
squall
CREATE TABLE table_name_54 ( team_1 VARCHAR, team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team 1 has team 2, Gomera?
SELECT team_1 FROM table_name_54 WHERE team_2 = "gomera"
sql_create_context
CREATE TABLE mountain ( id number, name text, height number, prominence number, range text, country text ) CREATE TABLE photos ( id number, camera_lens_id number, mountain_id number, color text, name text ) CREATE TABLE camera_lens ( id number, brand text, name ...
SELECT COUNT(DISTINCT brand) FROM camera_lens
spider
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 demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "813"
mimicsql_data
CREATE TABLE table_77256 ( "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 time/retired of the honda manufacturer with a grid less than 26, 18 laps, and joan oliv...
SELECT "Time/Retired" FROM table_77256 WHERE "Manufacturer" = 'honda' AND "Grid" < '26' AND "Laps" = '18' AND "Rider" = 'joan olivé'
wikisql
CREATE TABLE table_29802 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT MAX("Production code") FROM table_29802 WHERE "U.S. viewers (millions)" = '24.8'
wikisql
CREATE TABLE table_name_97 ( round INTEGER, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round of the match with a time of 0:57?
SELECT MAX(round) FROM table_name_97 WHERE time = "0:57"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-51920' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient...
eicu
CREATE TABLE table_44915 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place was Mark Carnevale in?
SELECT "Place" FROM table_44915 WHERE "Player" = 'mark carnevale'
wikisql
CREATE TABLE table_54460 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total audience on may 28?
SELECT SUM("Attendance") FROM table_54460 WHERE "Date" = 'may 28'
wikisql
CREATE TABLE table_61058 ( "Year" real, "Domestic" real, "International" real, "Total" real, "Change" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number for the international with 669 domestic earlier than 2005?
SELECT AVG("International") FROM table_61058 WHERE "Domestic" = '669' AND "Year" < '2005'
wikisql
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 HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_28962227_1 ( winner VARCHAR, runners_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the season for which Brendan Lynch is the runner-up?
SELECT winner FROM table_28962227_1 WHERE runners_up = "Brendan Lynch"
sql_create_context
CREATE TABLE table_23932 ( "County" text, "Obama#" real, "Obama%" text, "McCain#" real, "McCain%" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage did McCain get in Hamilton county?
SELECT "McCain%" FROM table_23932 WHERE "County" = 'HAMILTON'
wikisql
CREATE TABLE table_name_35 ( team_a VARCHAR, team_c VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is Team A when wilma hofschneider-david is team C?
SELECT team_a FROM table_name_35 WHERE team_c = "wilma hofschneider-david"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE comment_instructor ( instructor_id int...
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 866 OR course.number = 975) AND course_offering.end_time > '17:00:00' AND semester.semester = 'WN' AND semester.year = ...
advising
CREATE TABLE table_27454 ( "Opponent" text, "Played" real, "Won" real, "Lost" real, "Drew" real, "Premiership points" real, "Points for" real, "Points against" real, "Percentage (%)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha...
SELECT MIN("Points against") FROM table_27454 WHERE "Opponent" = 'Port Adelaide'
wikisql
CREATE TABLE table_41447 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silver have 4 as the total with a bronze less than 2?
SELECT COUNT("Silver") FROM table_41447 WHERE "Total" = '4' AND "Bronze" < '2'
wikisql
CREATE TABLE table_name_70 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did home team liverpool play?
SELECT date FROM table_name_70 WHERE home_team = "liverpool"
sql_create_context
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURS...
advising
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id n...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_203_268 ( id number, "date" text, "name" text, "nationality" text, "tonnage\n(grt)" number, "fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the only submarine from venezuela was named what ?
SELECT "name" FROM table_203_268 WHERE "nationality" = 'venezuela'
squall
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 ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY Team_ID
nvbench
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 67480 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'throat for strep' ORDER BY m...
mimic_iii
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show me how...
SELECT Class, COUNT(Class) FROM race GROUP BY Class ORDER BY Class DESC
nvbench
CREATE TABLE table_203_156 ( id number, "team" text, "outgoing manager" text, "manner of departure" text, "date of vacancy" text, "replaced by" text, "date of appointment" text, "position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT (SELECT JULIANDAY("date of appointment") FROM table_203_156 WHERE "team" = 'crystal palace') - (SELECT JULIANDAY("date of vacancy") FROM table_203_156 WHERE "team" = 'crystal palace')
squall
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 = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.age < "89"
mimicsql_data
CREATE TABLE table_204_490 ( id number, "position" text, "name" text, "height" text, "weight" text, "birthdate" text, "birthplace" text, "2009-10 team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what player is next on the list after ...
SELECT "name" FROM table_204_490 WHERE id = (SELECT id FROM table_204_490 WHERE "name" = 'erika lawler') + 1
squall
CREATE TABLE table_name_40 ( november INTEGER, game INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of November, when Game is greater than 23?
SELECT SUM(november) FROM table_name_40 WHERE game > 23
sql_create_context
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 department, name, number FROM course WHERE course_id IN (SELECT PROGRAM_COURSE_ID FROM program_course AS PROGRAM_COURSE WHERE PROGRAM_WORKLOAD = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%ULCS%')) AND num_enrolled = (...
advising
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 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 = '007-15837' AND patient.hospitaldischargetime IS NULL)) AND med...
eicu
CREATE TABLE table_name_40 ( domari VARCHAR, hindi VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Domari word has the same meaning as the Hindi word p c?
SELECT domari FROM table_name_40 WHERE hindi = "pāñc"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "6" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE table_14931 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent of the game that 31,293 people attended that had a final score of...
SELECT "Opponent" FROM table_14931 WHERE "Score" = '9 - 6' AND "Attendance" > '31,293'
wikisql
CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ...
SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName
nvbench
CREATE TABLE table_28577 ( "Country" text, "Area (km\u00b2) 2010" real, "Population 2011" real, "GDP (PPP) ( Intl. $ ) 2011" text, "GDP (PPP) per capita ( Intl. $ ) 2011" text, "Income inequality 1992-2010 (latest available)" text, "HDI 2012" text, "FSI 2012" text, "CPI 2012" text, ...
SELECT "GDP (PPP) per capita ( Intl. $ ) 2011" FROM table_28577 WHERE "Country" = 'Haiti'
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 COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '8183928' AND txmzjzjlb.JZKSRQ BETWEEN '2004-05-16' AND '2020-12-13' AND txmzjzjlb.ZZBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '8183928' AND ftxmzjzjlb.JZKSRQ BETWEEN '2004-05-16' AND '2020-12-13' AND ftxmzjzjlb.ZZBZ > 0
css
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturd...
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 = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MONT...
atis
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) 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_20...
SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200
nvbench
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '6110651' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM
css
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '8721079' AND jybgb.BGRQ BETWEEN '2006-09-08' AND '2010-10-18' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 16 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb...
css
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE writes ( paperid int, ...
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'mangpo' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE ReviewTaskStates ( 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 ) CREATE TA...
SELECT t1.TagName AS Tag1, t2.TagName AS Tag2, t3.TagName AS "Related Tag", COUNT(t3.TagName) AS "Count" FROM PostTags AS pt1 INNER JOIN Tags AS t1 ON pt1.TagId = t1.Id INNER JOIN PostTags AS pt2 ON pt1.PostId = pt2.PostId AND pt1.TagId != pt2.TagId INNER JOIN Tags AS t2 ON pt2.TagId = t2.Id INNER JOIN PostTags AS pt3 ...
sede
CREATE TABLE table_204_561 ( id number, "fence" number, "name" text, "jockey" text, "age" number, "handicap (st-lb)" text, "starting price" text, "fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tell me the number of horses with a 1...
SELECT COUNT(*) FROM table_204_561 WHERE "handicap (st-lb)" = '10-0'
squall
CREATE TABLE table_name_86 ( game INTEGER, high_assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Game, when High Assists is 'Hedo T rko lu (7)'?
SELECT MAX(game) FROM table_name_86 WHERE high_assists = "hedo türkoğlu (7)"
sql_create_context
CREATE TABLE table_16665 ( "Round" real, "Grand Prix" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT COUNT("Date") FROM table_16665 WHERE "Grand Prix" = 'Portuguese Grand Prix'
wikisql
CREATE TABLE table_name_67 ( caps INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean number of caps for Ryota Asano?
SELECT AVG(caps) FROM table_name_67 WHERE player = "ryota asano"
sql_create_context
CREATE TABLE table_9631 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent in the 1 round fight in the Ultimate Fighter 2 Finale?
SELECT "Opponent" FROM table_9631 WHERE "Round" = '1' AND "Event" = 'the ultimate fighter 2 finale'
wikisql
CREATE TABLE table_1628607_5 ( points__percentage VARCHAR, foursomes_w_l_h VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the foursome was w-l-h is 1 0 0 won w/ p. creamer 3&2, what was the points %?
SELECT points__percentage FROM table_1628607_5 WHERE foursomes_w_l_h = "1–0–0 won w/ P. Creamer 3&2"
sql_create_context