instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_30154 ( "State Rank" real, "National Rank" real, "Institution" text, "Location" text, "Public or Private" text, "Endowment Funds" text, "Percentage Change YOY" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the percen...
SELECT "Percentage Change YOY" FROM table_30154 WHERE "Institution" = 'Presbyterian College'
wikisql
CREATE TABLE company ( company_id number, name text, headquarters text, industry text, sales_in_billion number, profits_in_billion number, assets_in_billion number, market_value_in_billion number ) CREATE TABLE employment ( company_id number, people_id number, year_working n...
SELECT MAX(market_value_in_billion), MIN(market_value_in_billion) FROM company
spider
CREATE TABLE table_71405 ( "As of September 1, 2012" text, "vs. Protoss" text, "vs. Terran" text, "vs. Zerg" text, "vs. all" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score vs. all when the score vs. Terran is 159?
SELECT "vs. all" FROM table_71405 WHERE "vs. Terran" = '159'
wikisql
CREATE TABLE table_17409 ( "Jurisdiction" text, "For Prohibition" real, "Percent For" text, "Against Prohibition" real, "Percent Against" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of jurisdiction for 57.3 percent?
SELECT COUNT("Jurisdiction") FROM table_17409 WHERE "Percent For" = '57.3'
wikisql
CREATE TABLE table_80070 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Title has an Appointed by of Millard Fillmore?
SELECT "Title" FROM table_80070 WHERE "Appointed by" = 'millard fillmore'
wikisql
CREATE TABLE table_name_68 ( team VARCHAR, manner_of_departure VARCHAR, date_of_vacancy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want to know the team that was sacked and date of vacancy was 4 december
SELECT team FROM table_name_68 WHERE manner_of_departure = "sacked" AND date_of_vacancy = "4 december"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '82924837' AND qtb.MED_SER_ORG_NO = '2605232' AND qtb.OUT_DIAG_DOC_NM LIKE '施%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '82924837' AND gyb.MED_SER_ORG_NO = '2605232' AND gyb.OUT_DIAG_DOC_NM LIKE '...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "51355"
mimicsql_data
CREATE TABLE table_49659 ( "Year" real, "Class" text, "Team" text, "Points" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Count the average Wins which has a Class of 250cc, and a Year of 1972?
SELECT AVG("Wins") FROM table_49659 WHERE "Class" = '250cc' AND "Year" = '1972'
wikisql
CREATE TABLE table_19137 ( "School" text, "Mascot" text, "Conference" text, "National Titles" real, "Founded" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many overall championships does concordia university have
SELECT MIN("National Titles") FROM table_19137 WHERE "School" = 'Concordia University'
wikisql
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 MED_ORG_DEPT_CD, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '9146406' GROUP BY MED_ORG_DEPT_CD, IN_DIAG_DIS_NM
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'enteral osmolyte 1.2' AND intakeoutput.cellpath LIKE '%input%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) >= '2103')
eicu
CREATE TABLE table_name_6 ( rank INTEGER, gold VARCHAR, participants VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is listed as the highest Rank that has a Gold that's larger than 0, and Participants that's smaller than 10?
SELECT MAX(rank) FROM table_name_6 WHERE gold > 0 AND participants < 10
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT COALESCE('site://users/' + CAST(p.OwnerUserId AS TEXT) + '|' + u.DisplayName, p.OwnerDisplayName) AS UserLink, COUNT(p.Id) AS QCount FROM Posts AS p LEFT JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 1 GROUP BY p.OwnerUserId, p.OwnerDisplayName, u.DisplayName HAVING '##MinCount?100##' <= COUNT(p.I...
sede
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_c...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
CREATE TABLE table_13762472_5 ( high_rebounds VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high rebounds at the delta center?
SELECT high_rebounds FROM table_13762472_5 WHERE location_attendance = "Delta Center"
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 t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'brain tumor - brain tumor, type unknown') AS t1 GROUP BY t1.uniq...
eicu
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN area ON student_record.course_id = area.course_id WHERE area.area LIKE '%web technology%' AND student_record.student_id = 1
advising
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.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '19242256' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 3101.15)
css
CREATE TABLE table_735 ( "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 party with candidates being alton lennon (d) 89.0% c. dana malpas...
SELECT COUNT("Party") FROM table_735 WHERE "Candidates" = 'Alton Lennon (D) 89.0% C. Dana Malpass (R) 11.0%'
wikisql
CREATE TABLE table_name_50 ( date_made VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the locomotive with a Waterford class?
SELECT date_made FROM table_name_50 WHERE class = "waterford"
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. -- Compa...
SELECT director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY director ORDER BY director DESC
nvbench
CREATE TABLE table_17475 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the original a...
SELECT "Original air date" FROM table_17475 WHERE "Production code" = '2T6719'
wikisql
CREATE TABLE table_62903 ( "Name (pinyin)" text, "Name (Wade Giles)" text, "Characters" text, "Type" text, "Construction" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type of Guangjia?
SELECT "Type" FROM table_62903 WHERE "Name (pinyin)" = 'guangjia'
wikisql
CREATE TABLE table_name_37 ( year INTEGER, mintage INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest year with a Mintage smaller than 10,000?
SELECT MIN(year) FROM table_name_37 WHERE mintage < 10 OFFSET 000
sql_create_context
CREATE TABLE table_40109 ( "Capacity" text, "Volts" text, "Temp." text, "Energy-to-weight ratio" text, "Power-to-weight ratio" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many volts has an energy-to-weight ratio of 54 kj/kg to 2.0v?
SELECT "Volts" FROM table_40109 WHERE "Energy-to-weight ratio" = '54 kj/kg to 2.0v'
wikisql
CREATE TABLE table_204_250 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games was their ranking not lower than # 5 ?
SELECT COUNT(*) FROM table_204_250 WHERE "rank#" <= 5
squall
CREATE TABLE table_46881 ( "Year" real, "Title" text, "Role" text, "Network" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Year, when Notes is 'Celebrity Guest Alongside YG Family'?
SELECT MAX("Year") FROM table_46881 WHERE "Notes" = 'celebrity guest alongside yg family'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT a.OwnerUserId AS "user_link", COUNT(*) AS "count" FROM Votes AS v, Posts AS q, Posts AS a WHERE v.VoteTypeId = 1 AND v.PostId = a.Id AND q.AcceptedAnswerId = a.Id AND q.OwnerUserId != a.OwnerUserId GROUP BY a.OwnerUserId ORDER BY COUNT(*) DESC LIMIT 100
sede
CREATE TABLE table_name_75 ( position VARCHAR, years_with_spurs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT POSITION HAD SPURS IN 2009-2012?
SELECT position FROM table_name_75 WHERE years_with_spurs = "2009-2012"
sql_create_context
CREATE TABLE table_60082 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Country is 'United States', and when Player is 'Bob Tway'?
SELECT "Score" FROM table_60082 WHERE "Country" = 'united states' AND "Player" = 'bob tway'
wikisql
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'AOSS' AND cou...
advising
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 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 = 15794)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperatu...
mimic_iii
CREATE TABLE table_11803648_21 ( club_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club team did JArrod Maidens play for?
SELECT club_team FROM table_11803648_21 WHERE player = "Jarrod Maidens"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.BGDH = '80525175494'
css
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 52647 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
mimic_iii
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_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJG...
css
CREATE TABLE table_44987 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what tournament did Cipolla face Sergio Roitman?
SELECT "Tournament" FROM table_44987 WHERE "Opponent" = 'sergio roitman'
wikisql
CREATE TABLE table_24884 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons had episo...
SELECT MIN("No. in season") FROM table_24884 WHERE "No. in series" = '158'
wikisql
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) ...
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD...
atis
CREATE TABLE table_name_73 ( type VARCHAR, programming VARCHAR, owner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type for a general programming and the owner tv kanal 5?
SELECT type FROM table_name_73 WHERE programming = "general" AND owner = "tv kanal 5"
sql_create_context
CREATE TABLE table_50483 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition did Lineth Chepkurui place 5th?
SELECT "Competition" FROM table_50483 WHERE "Position" = '5th'
wikisql
CREATE TABLE table_train_10 ( "id" int, "severe_sepsis" bool, "consent" bool, "raising_legs_or_head" bool, "intention_to_arterial_catheter" bool, "allergy_to_adhesive" bool, "intention_to_central_venous_catheter" bool, "septic_shock" bool, "age" float, "NOUSE" float ) -- Using ...
SELECT * FROM table_train_10 WHERE allergy_to_adhesive = 1
criteria2sql
CREATE TABLE table_29090919_1 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many scores were there for the home team when the away team was fitzroy?
SELECT COUNT(home_team) AS score FROM table_29090919_1 WHERE away_team = "Fitzroy"
sql_create_context
CREATE TABLE table_50274 ( "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. -- Which ...
SELECT "Location Attendance" FROM table_50274 WHERE "Game" > '67' AND "Team" = '@ charlotte'
wikisql
CREATE TABLE table_name_17 ( beam VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Beam has a Model of 570?
SELECT beam FROM table_name_17 WHERE model = "570"
sql_create_context
CREATE TABLE table_name_89 ( competition VARCHAR, date VARCHAR, venue VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On July 26, 1977, what competition played at the venue of Kuala Lumpur, resulted in 4-0?
SELECT competition FROM table_name_89 WHERE venue = "kuala lumpur" AND result = "4-0" AND date = "july 26, 1977"
sql_create_context
CREATE TABLE tags ( index number, id number, tag text ) CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT groupname FROM torrents ORDER BY totalsnatched DESC LIMIT 1
whatcdhiphop
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_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID)
nvbench
CREATE TABLE table_27822 ( "Lighthouse" text, "Location" text, "Province/City" text, "Date First Lit" text, "Tower height in ft (m)" text, "Focal plane in ft (m)" text, "Current Status" text, "Current Condition/ Description" text ) -- Using valid SQLite, answer the following questions ...
SELECT COUNT("Current Status") FROM table_27822 WHERE "Date First Lit" = '1853'
wikisql
CREATE TABLE table_39799 ( "Name" text, "Status" text, "Authors" text, "Unit" text, "Location" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What unit is in Argentina?
SELECT "Unit" FROM table_39799 WHERE "Location" = 'argentina'
wikisql
CREATE TABLE table_35797 ( "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. -- What is the largest value for lost with a posit...
SELECT MAX("Lost") FROM table_35797 WHERE "Position" > '10'
wikisql
CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER, date_assigned_from DATETIME, job_title_code VARCHAR(10), date_assigned_to DATETIME ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREATE TABLE Supplier_Addre...
SELECT product_name, product_price FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 ORDER BY product_price DESC
nvbench
CREATE TABLE table_48369 ( "Date of release" real, "Title" text, "Label" text, "Oricon peak" real, "RIAA cert." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT LABEL HAD A RELEASE DATE OF 1991?
SELECT "Label" FROM table_48369 WHERE "Date of release" = '1991'
wikisql
CREATE TABLE table_67774 ( "CERCLIS ID" text, "County" text, "Listed" text, "Construction completed" text, "Partially deleted" text, "Deleted" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date construction is completed in Jo Davies...
SELECT "Construction completed" FROM table_67774 WHERE "County" = 'jo daviess'
wikisql
CREATE TABLE table_71307 ( "Member countries" text, "Population" text, "Area (km\u00b2)" text, "GDP (billion US$)" text, "GDP per capita (US$)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total population of the country that has a GDP...
SELECT "Population" FROM table_71307 WHERE "GDP per capita (US$)" = '15,054'
wikisql
CREATE TABLE table_47854 ( "Goal" real, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE SCORE WHEN THE COMPETITION WAS 1978 world cup qualification?
SELECT "Score" FROM table_47854 WHERE "Competition" = '1978 world cup qualification'
wikisql
CREATE TABLE table_27451 ( "June 10-11" text, "March 27-29" text, "January 15-16" text, "November 3" text, "August 21-22" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the data on January 15-16 if the data recorded June 10-11 is June 10, 1...
SELECT "January 15-16" FROM table_27451 WHERE "June 10-11" = 'June 10, 1964'
wikisql
CREATE TABLE table_name_64 ( competition VARCHAR, assist_pass VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the competition for stephanie cox on 2011-07-02
SELECT competition FROM table_name_64 WHERE assist_pass = "stephanie cox" AND date = "2011-07-02"
sql_create_context
CREATE TABLE table_37575 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest earnings of a player with more than 19 wins?
SELECT MAX("Earnings ( $ )") FROM table_37575 WHERE "Wins" > '19'
wikisql
CREATE TABLE table_name_9 ( opponent VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the opponent at the game that had a loss of Travers (0 2)?
SELECT opponent FROM table_name_9 WHERE loss = "travers (0–2)"
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress ...
SELECT * FROM (SELECT st.TagName AS stTagName, tt.TagName AS ttTagName, ts.CreationDate, ts.OwnerUserId AS "user_link", SUM(CASE v.VoteTypeId WHEN 2 THEN 1 WHEN 3 THEN -1 END) AS Score FROM TagSynonyms AS ts INNER JOIN Tags AS st ON ts.SourceTagName = st.TagName INNER JOIN Tags AS tt ON ts.TargetTagName = tt.TagName IN...
sede
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
mimic_iii
CREATE TABLE table_name_7 ( score VARCHAR, to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when To Par is '+1', and when Player is 'Mike Souchak'?
SELECT score FROM table_name_7 WHERE to_par = "+1" AND player = "mike souchak"
sql_create_context
CREATE TABLE table_name_65 ( roll INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of roll for morrinsville school
SELECT SUM(roll) FROM table_name_65 WHERE name = "morrinsville school"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.long_title = "Other conversion of cardiac rhythm"
mimicsql_data
CREATE TABLE table_75841 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which label released the catalog Magik Muzik CD 07 on 28 March 2007?
SELECT "Label" FROM table_75841 WHERE "Date" = '28 march 2007' AND "Catalog" = 'magik muzik cd 07'
wikisql
CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, Location_Code CHAR(15) ) CREATE TABLE Organizations ( organization_id INTEGER, parent_organization_id INTEGER, organization_details VARCHAR(255) ) CREATE TABLE Services ( service_id INTEGER, organization...
SELECT organization_details, COUNT(organization_details) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY Type_of_Thing_Code, organization_details ORDER BY COUNT(organization_details) DESC
nvbench
CREATE TABLE table_68673 ( "Year" real, "Total Region" real, "Mackay" real, "Pioneer" real, "Mirani" real, "Sarina" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Pioneer population with a Sarina population less than 3,268 and a Mira...
SELECT SUM("Pioneer") FROM table_68673 WHERE "Sarina" < '3,268' AND "Mirani" < '4,412'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) 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, t...
SELECT DISTINCT credits FROM course WHERE department = 'EECS' AND number = 595
advising
CREATE TABLE table_name_32 ( date VARCHAR, goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date has a Goal of deacon 4/4, withers 1 dg?
SELECT date FROM table_name_32 WHERE goals = "deacon 4/4, withers 1 dg"
sql_create_context
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 bdmzjzjlb ( CYBQDM text, CYBQ...
SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZYBMLX = '8588386' AND bdmzjzjlb.RYDJSJ BETWEEN '2002-01-28' AND '2018-05-06'
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360) AND icustays.outtime IS NULL)
mimic_iii
CREATE TABLE table_name_14 ( seats_2005 INTEGER, in_de_creased_by VARCHAR, percentage_in_de_crease VARCHAR, governorate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Seats 2005 has a Percentage in/de-crease of 50.0%, and a Governorate of dh...
SELECT SUM(seats_2005) FROM table_name_14 WHERE percentage_in_de_crease = "50.0%" AND governorate = "dhi qar governorate" AND in_de_creased_by > 6
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airline ( airline_code...
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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DEN...
atis
CREATE TABLE table_8873 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the game when the opponent is new york knickerbockers?
SELECT SUM("Game") FROM table_8873 WHERE "Opponent" = 'new york knickerbockers'
wikisql
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 (description LIKE '%Vocal Lit%' OR name LIKE '%Vocal Lit%') AND department = 'EECS'
advising
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 = "WHITE - RUSSIAN" AND prescriptions.drug = "Chloraseptic Throat Spray"
mimicsql_data
CREATE TABLE table_11571 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total laps for a grid of 3?
SELECT COUNT("Laps") FROM table_11571 WHERE "Grid" = '3'
wikisql
CREATE TABLE table_name_81 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest value for 1970, when the value for 1960 is less than 61.9, when the value for 1980 is less than 3.8, when the value for 1990 is 3.3, and when the value for 2000 is...
SELECT MAX(1970) FROM table_name_81 WHERE 1960 < 61.9 AND 1980 < 3.8 AND 1990 = 3.3 AND 2000 > 3.2
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT SALARY, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_203_340 ( id number, "rank" number, "airport" text, "passengers handled" number, "% change 2011 / 12" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many passengers were handled in an airport in spain ?
SELECT SUM("passengers handled") FROM table_203_340 WHERE "airport" = 'spain'
squall
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescript...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'iso-osmotic dextrose' AND STRFTIME('%y', pres...
mimic_iii
CREATE TABLE table_11274401_3 ( rating VARCHAR, air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the rating of the episode originally aired on May 5, 2009?
SELECT rating FROM table_11274401_3 WHERE air_date = "May 5, 2009"
sql_create_context
CREATE TABLE table_name_53 ( year VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years has 1 run?
SELECT COUNT(year) FROM table_name_53 WHERE score = "1 run"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-56105') AND NOT patient.unitdischargetime I...
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
SELECT MIN(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13672')) AND NOT vitalperiodic.heartrate IS NULL...
eicu
CREATE TABLE table_28535 ( "Institution" text, "Location (Population)" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname (Colors)" text, "Football?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the enrollment for the ...
SELECT "Enrollment" FROM table_28535 WHERE "Location (Population)" = 'Lebanon, Tennessee (20,235)'
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 All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home
nvbench
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_lo...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS'...
atis
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 t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute...
eicu
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT t.Id, t.TagName, COUNT(*) AS "Number questions" FROM (SELECT DISTINCT pq.Id, pt.TagId FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id JOIN Posts AS pq ON pq.Id = p.ParentId JOIN PostTags AS pt ON pt.PostId = pq.Id WHERE pq.ViewCount > 0 AND (pq.CreationDate BETWEEN '2012-01-01' AND '2012-10-01') AND u.Cr...
sede
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra...
advising
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.JYZBLSH 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...
css
CREATE TABLE table_name_25 ( upstream VARCHAR, price VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Upstream, when Price is '14 EUR'?
SELECT upstream FROM table_name_25 WHERE price = "14 eur"
sql_create_context
CREATE TABLE table_name_52 ( club_team_s_ VARCHAR, team_number INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many club teams had more than 14 people?
SELECT club_team_s_ FROM table_name_52 WHERE team_number > 14
sql_create_context
CREATE TABLE Attribute_Definitions ( attribute_data_type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the list of attribute data types possessed by more than 3 attribute definitions.
SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING COUNT(*) > 3
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE restriction ( restriction_code text, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis