instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_204_841 ( id number, "no." number, "temple" text, "honzon (main image)" text, "city/town/village" text, "prefecture" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many temples are listed in the table ?
SELECT COUNT("temple") FROM table_204_841
squall
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, Crea...
SELECT DISTINCT P.Id AS "post_link" FROM Comments AS C, Users AS U, Posts AS P, Votes AS V, VoteTypes AS Vt WHERE Vt.Id = V.VoteTypeId AND P.Id = C.PostId AND V.PostId = C.PostId AND U.Id = C.UserId AND LENGTH(C.Text) > 599 AND Vt.Id = 2 AND C.Score > 20 GROUP BY P.Id
sede
CREATE TABLE table_3412 ( "Nations" text, "Competition" text, "Teams" real, "Established" real, "Latest Year" text, "Winner" text, "Runner-Up" text, "Tier/Division" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which competition did the...
SELECT "Competition" FROM table_3412 WHERE "Winner" = 'Toronto City Saints'
wikisql
CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Na...
SELECT Calendar_Date, Day_Number FROM Ref_Calendar ORDER BY Calendar_Date DESC
nvbench
CREATE TABLE table_79034 ( "South West DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Losses have a South West DFL of branxholme-wallacedale, and less than 2 Byes?...
SELECT AVG("Losses") FROM table_79034 WHERE "South West DFL" = 'branxholme-wallacedale' AND "Byes" < '2'
wikisql
CREATE TABLE parts ( part_id number, part_name text, chargeable_yn text, chargeable_amount text, other_part_details text ) CREATE TABLE maintenance_engineers ( engineer_id number, company_id number, first_name text, last_name text, other_details text ) CREATE TABLE staff ( ...
SELECT DISTINCT asset_model FROM assets
spider
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.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Modeling , Analysis and Control of Dynamic Systems%' OR course.description LIKE '%Modeling , Ana...
advising
CREATE TABLE table_28848 ( "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. -- What was the district of the incumbent Mathias Morris?
SELECT "District" FROM table_28848 WHERE "Incumbent" = 'Mathias Morris'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-11182')) AND treatment.treatmentname = 'systemic antibiotics - quinolone' AN...
eicu
CREATE TABLE table_34713 ( "Year" text, "National Champion" text, "Runner-Up" text, "Location" text, "Host" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At what Location was the Runner-up TBD?
SELECT "Location" FROM table_34713 WHERE "Runner-Up" = 'tbd'
wikisql
CREATE TABLE table_18837 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the follo...
SELECT "Points for" FROM table_18837 WHERE "Points" = '53'
wikisql
CREATE TABLE table_8301 ( "Game" real, "October" text, "Opponent" text, "Score" text, "Decision" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game is the first with the Pittsburgh Penguins the opponent?
SELECT MIN("Game") FROM table_8301 WHERE "Opponent" = 'pittsburgh penguins'
wikisql
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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, ...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '7488811' AND jybgb.BGRQ BETWEEN '2003-05-07' AND '2009-04-12' GROUP BY jybgb.KSBM HAVING COUNT(*) > 25) AS T
css
CREATE TABLE table_50967 ( "Title" text, "Parent magazine" text, "Magazine type" text, "Frequency" text, "Magazine run" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the frequency for the magazine that runs September 2, 2010?
SELECT "Frequency" FROM table_50967 WHERE "Magazine run" = 'september 2, 2010'
wikisql
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2145" AND prescriptions.route = "DIALYS"
mimicsql_data
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 SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY SportName
nvbench
CREATE TABLE table_204_343 ( id number, "nation" text, "model" text, "length" text, "barrel length" text, "weight" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- do the usa rifles on average weigh more or less than the danish rifles ?
SELECT (SELECT AVG("weight") FROM table_204_343 WHERE "nation" = 'usa') > (SELECT AVG("weight") FROM table_204_343 WHERE "nation" = 'denmark')
squall
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( ...
SELECT County_name, COUNT(County_name) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY County_name ORDER BY COUNT(County_name)
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.jybgb_JZLSH = '42183982937' AND jyjgzbb.JCRXM LIKE '尤%'
css
CREATE TABLE table_name_3 ( year VARCHAR, runner_up VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year has John Davies as the runner-up, with warren humphreys as the winner?
SELECT year FROM table_name_3 WHERE runner_up = "john davies" AND winner = "warren humphreys"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
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 >= 60) AND STRFTIME('%y', treatment.treatmenttime) = '2101' GROUP BY treatment.treatmentname...
eicu
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.long_title = "Paraplegia"
mimicsql_data
CREATE TABLE table_204_589 ( id number, "season" text, "tier" number, "division" text, "pos." text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- does honor b or asobal have the larger tier ?
SELECT "division" FROM table_204_589 WHERE "division" IN ('honor b', 'asobal') ORDER BY "tier" DESC LIMIT 1
squall
CREATE TABLE table_25074 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the state for reason for change is resigned ...
SELECT "State (class)" FROM table_25074 WHERE "Reason for change" = 'Resigned May 15, 1820'
wikisql
CREATE TABLE table_8705 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Score for the Game of...
SELECT "Score" FROM table_8705 WHERE "Game" = '75'
wikisql
CREATE TABLE table_48164 ( "Place" real, "Matches" real, "Drawn" real, "Lost" real, "Difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Matches were the points were smaller than 8, the place was larger ...
SELECT MAX("Matches") FROM table_48164 WHERE "Points" < '8' AND "Place" > '13' AND "Drawn" < '1'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '70307655' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-10-21' AND '2021-08-18' GROUP BY t_kc21.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
css
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...
WITH ByUser AS (SELECT OwnerUserId, CAST(COUNT(AcceptedAnswerId) AS FLOAT) / CAST(COUNT(*) AS FLOAT) AS AcceptRate FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE u.Reputation > 200 AND p.PostTypeId = 1 AND CommunityOwnedDate IS NULL AND EXISTS(SELECT 1 FROM Posts WHERE ParentId = p.Id) GROUP BY OwnerUser...
sede
CREATE TABLE table_name_59 ( total INTEGER, championship INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average total for less than 1 championship?
SELECT AVG(total) FROM table_name_59 WHERE championship < 1
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "20" AND prescriptions.drug = "Clofarabine *IND*"
mimicsql_data
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 demographic.insurance FROM demographic WHERE demographic.subject_id = "7578"
mimicsql_data
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) C...
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type
nvbench
CREATE TABLE table_name_34 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponents have a record of 90-70?
SELECT opponent FROM table_name_34 WHERE record = "90-70"
sql_create_context
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 (SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '8738214' AND IN_HOSP_DATE BETWEEN '2000-02-09' AND '2015-04-09') - (SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '8738214' AND IN_HOSP_DATE BETWEEN '2000-02-09' AND '2015-04-09' AND IN_DIAG_DIS_CD = OUT_DIAG_DIS_CD)
css
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 CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '12704839243' AND SOC_SRT_DIRE_NM = '葡醛内酯片'
css
CREATE TABLE table_28628 ( "Region" text, "Population" real, "% of countrys population" text, "Change in population since 1993" real, "Change in % of countrys population since 1993" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the change i...
SELECT COUNT("Change in population since 1993") FROM table_28628 WHERE "% of countrys population" = '4.2'
wikisql
CREATE TABLE table_62950 ( "Team" text, "Tries for" real, "Tries against" real, "Try diff" text, "Points for" real, "Points against" real, "Points diff" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tries for has Points against larger...
SELECT AVG("Tries for") FROM table_62950 WHERE "Points against" > '87' AND "Tries against" < '28' AND "Points diff" = '+63'
wikisql
CREATE TABLE table_name_9 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date for renato ferreira?
SELECT date FROM table_name_9 WHERE opponent = "renato ferreira"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) C...
SELECT Title FROM Posts WHERE NOT Title IS NULL ORDER BY Score DESC LIMIT 1000
sede
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...
WITH total_users AS (SELECT tu_count = COUNT(*) FROM Users), users_rep_x AS (SELECT ru_count = COUNT(*) FROM Users AS u WHERE u.Reputation > 1000) SELECT DISTINCT (SELECT tu_count FROM total_users) AS "total_users", (SELECT ru_count FROM users_rep_x) AS "users_rep_>_x", CAST((CAST((SELECT ru_count FROM users_rep_x) AS ...
sede
CREATE TABLE table_name_94 ( career VARCHAR, average VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did Tymerlan Huseynov, whose average is larger than 0.361, play?
SELECT career FROM table_name_94 WHERE average > 0.361 AND player = "tymerlan huseynov"
sql_create_context
CREATE TABLE table_65900 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has February 12, 2006 as the date?
SELECT "Score" FROM table_65900 WHERE "Date" = 'february 12, 2006'
wikisql
CREATE TABLE table_name_46 ( team VARCHAR, constructor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who does Yamaha Construct for?
SELECT team FROM table_name_46 WHERE constructor = "yamaha"
sql_create_context
CREATE TABLE table_17797 ( "Year" real, "Road Opened" text, "Road Closed" text, "Freight Carried s Tonne" real, "Super B Capacity Reached [ citation needed ]" text, "Number of Truck Loads North" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whe...
SELECT "Super B Capacity Reached [ citation needed ]" FROM table_17797 WHERE "Number of Truck Loads North" = '7735'
wikisql
CREATE TABLE table_37183 ( "Year(s)" real, "Grand Final Television Commentator" text, "Grand Final Dual Television Commentator" text, "Spokesperson" text, "Semi Final Television Commentator" text, "Semi Final Dual Television Commentator" text ) -- Using valid SQLite, answer the following quest...
SELECT "Grand Final Dual Television Commentator" FROM table_37183 WHERE "Spokesperson" = 'amaury vassili'
wikisql
CREATE TABLE table_75656 ( "Outcome" text, "Event" text, "Year" text, "Venue" text, "Partner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Outcome in the Malaysia Open with Partner Yoo Sang-Hee?
SELECT "Outcome" FROM table_75656 WHERE "Partner" = 'yoo sang-hee' AND "Venue" = 'malaysia open'
wikisql
CREATE TABLE table_50223 ( "Department" text, "Micro (10ha)" real, "Small (100ha)" real, "Medium (500ha)" real, "Big (>500ha)" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Big (>500ha) has a Micro (10ha) larger than 940, an...
SELECT MAX("Big (>500ha)") FROM table_50223 WHERE "Micro (10ha)" > '940' AND "Department" = 'potosí' AND "Total" < '16,240'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicatio...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-1 year')
eicu
CREATE TABLE table_6258 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions fo...
SELECT "Tries against" FROM table_6258 WHERE "Played" = '22' AND "Club" = 'ystalyfera rfc'
wikisql
CREATE TABLE table_79358 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Waht was the away team when the home team is colchester united?
SELECT "Away team" FROM table_79358 WHERE "Home team" = 'colchester united'
wikisql
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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj...
css
CREATE TABLE table_20391 ( "N\u00b0" real, "Television service" text, "Country" text, "Language" text, "Content" text, "DAR" text, "HDTV" text, "PPV" text, "Package/Option" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the co...
SELECT "Content" FROM table_20391 WHERE "N\u00b0" = '204'
wikisql
CREATE TABLE Locations ( Location_ID INTEGER, Other_Details VARCHAR(255) ) 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 Addresses ( Address_ID INT...
SELECT Product_Name, COUNT(Product_Name) FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events) GROUP BY Product_Name ORDER BY Product_Name DESC
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32430')) AND diagnosis.diagnosisname = 'intra-abdominal absce...
eicu
CREATE TABLE employee ( employeeid number, lastname text, firstname text, title text, reportsto number, birthdate time, hiredate time, address text, city text, state text, country text, postalcode text, phone text, fax text, email text ) CREATE TABLE mediatyp...
SELECT COUNT(*) FROM album AS T1 JOIN artist AS T2 ON T1.artistid = T2.artistid WHERE T2.name = "Metallica"
spider
CREATE TABLE user_profiles ( name VARCHAR, followers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the names of 5 users followed by the largest number of other users.
SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 5
sql_create_context
CREATE TABLE table_16751596_12 ( democrat VARCHAR, dates_administered VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On November 14, 2007, what are the Democrat: Vivian Davis Figures percentages?
SELECT democrat AS :_vivian_davis_figures FROM table_16751596_12 WHERE dates_administered = "November 14, 2007"
sql_create_context
CREATE TABLE table_29748 ( "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. -- What w...
SELECT "Record" FROM table_29748 WHERE "Team" = 'Minnesota'
wikisql
CREATE TABLE table_name_19 ( date VARCHAR, score VARCHAR, location VARCHAR, competition VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the Competition of europe/africa zone, group i, round robin, with a result of los...
SELECT date FROM table_name_19 WHERE competition = "europe/africa zone, group i, round robin" AND result = "loss" AND location = "antalya" AND score = "1–2"
sql_create_context
CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_D...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description ORDER BY COUNT(Document_Date)
nvbench
CREATE TABLE table_2562572_9 ( dominant_religion__2002_ VARCHAR, cyrillic_name_other_names VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the dominant religion in during 2002?
SELECT dominant_religion__2002_ FROM table_2562572_9 WHERE cyrillic_name_other_names = "Степановићево"
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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Mupirocin Cream 2%"
mimicsql_data
CREATE TABLE table_name_2 ( losses INTEGER, golden_rivers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses did the Golden rivers of hay have?
SELECT AVG(losses) FROM table_name_2 WHERE golden_rivers = "hay"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT demographic.admission_type, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Alice Nixon"
mimicsql_data
CREATE TABLE Document_Types ( document_type_code VARCHAR(10), document_description VARCHAR(255) ) CREATE TABLE Tasks ( task_id INTEGER, project_id INTEGER, task_details VARCHAR(255), "eg Agree Objectives" VARCHAR(1) ) CREATE TABLE Organisation_Types ( organisation_type VARCHAR(10), org...
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T1.organisation_id
nvbench
CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE lives...
SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name
spider
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, val...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19175) AND prescriptions.drug = 'thiamine hcl' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER ...
mimic_iii
CREATE TABLE table_name_71 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was there a score of 7-1?
SELECT date FROM table_name_71 WHERE score = "7-1"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687')) AND treatment.treatmentname = 'endotracheal tube removal' AND DATET...
eicu
CREATE TABLE table_53550 ( "Player" text, "Competition" text, "Team" text, "Opponent" text, "Year" real, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell met he score for team of waaia
SELECT "Score" FROM table_53550 WHERE "Team" = 'waaia'
wikisql
CREATE TABLE table_203_467 ( id number, "year" number, "numer of jamaicans\ngranted british\ncitizenship" number, "naturalisation\nby residence" number, "naturalisation\nby marriage" number, "registration\nof a minor child" number, "registration\nby other means" number ) -- Using valid SQL...
SELECT COUNT("year") FROM table_203_467 WHERE "naturalisation\nby residence" + "naturalisation\nby marriage" < 1500
squall
CREATE TABLE table_name_38 ( pos INTEGER, car__number VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Pos has a Car # larger than 2, and a Team of billy ballew motorsports?
SELECT AVG(pos) FROM table_name_38 WHERE car__number > 2 AND team = "billy ballew motorsports"
sql_create_context
CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Co...
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations ORDER BY Date_in_Locaton_To
nvbench
CREATE TABLE lots ( lot_id number, investor_id number, lot_details text ) CREATE TABLE sales ( sales_transaction_id number, sales_details text ) CREATE TABLE ref_transaction_types ( transaction_type_code text, transaction_type_description text ) CREATE TABLE transactions ( transaction...
SELECT transaction_id FROM transactions WHERE transaction_type_code = 'PUR'
spider
CREATE TABLE table_57687 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which constructor has a race called I News of the World Trophy?
SELECT "Constructor" FROM table_57687 WHERE "Race Name" = 'i news of the world trophy'
wikisql
CREATE TABLE table_76536 ( "Scorer" text, "Club" text, "League goals" text, "FA Cup goals" text, "League Cup goals" real, "Texaco Cup goals" text, "Euro competitions" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT AVG("Total") FROM table_76536 WHERE "FA Cup goals" = '1' AND "League goals" = '10' AND "Club" = 'crystal palace'
wikisql
CREATE TABLE table_3971 ( "Proceed to Quarter-final" text, "Match points" text, "Aggregate score" text, "Points margin" real, "Eliminated from competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who proceeded to the quarter final when the lo...
SELECT "Proceed to Quarter-final" FROM table_3971 WHERE "Eliminated from competition" = 'London Irish'
wikisql
CREATE TABLE table_46502 ( "Name" text, "Club" text, "Position" text, "Years" text, "Current status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Years was the Player in MF Position?
SELECT "Years" FROM table_46502 WHERE "Position" = 'mf'
wikisql
CREATE TABLE table_28257 ( "No." real, "#" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Prod. code" real, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many viewers in mi...
SELECT "U.S. viewers (million)" FROM table_28257 WHERE "No." = '38'
wikisql
CREATE TABLE table_name_21 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance on September 11, 1988?
SELECT AVG(attendance) FROM table_name_21 WHERE date = "september 11, 1988"
sql_create_context
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rati...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_name_99 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played against the Celtics on Sat. Feb. 23?
SELECT opponent FROM table_name_99 WHERE date = "sat. feb. 23"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
SELECT u.Id, u.Location, u.CreationDate, u.LastAccessDate, p.CreationDate, COALESCE(p.activity, 0) + COALESCE(c.activity, 0) + COALESCE(v.activity, 0) AS activity FROM Users AS u LEFT JOIN (SELECT UserId, CreationDate, COUNT(Id) AS activity FROM PostHistory GROUP BY UserId, CreationDate) AS p ON (p.UserId = u.Id) LEFT ...
sede
CREATE TABLE table_17288845_8 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for score l 89 91 (ot)
SELECT date FROM table_17288845_8 WHERE score = "L 89–91 (OT)"
sql_create_context
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE flight_fare ...
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, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c...
atis
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text,...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf...
css
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '58997444' AND IN_HOSP_DATE BETWEEN '2005-07-14' AND '2014-03-13' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_1289860_2 ( result VARCHAR, background VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people had a prosecutor background?
SELECT COUNT(result) FROM table_1289860_2 WHERE background = "Prosecutor"
sql_create_context
CREATE TABLE table_3087 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of goals if the name is Xavier Gravelaine?...
SELECT "Goals\u00b9" FROM table_3087 WHERE "Name" = 'Xavier Gravelaine'
wikisql
CREATE TABLE table_23938357_6 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least 08-09 i/o best?
SELECT MIN(08 AS _09_i_o_best) FROM table_23938357_6
sql_create_context
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT BBCJBW FROM jybgb WHERE BGDH = '95769004070'
css
CREATE TABLE table_203_112 ( id number, "choke" text, "constriction (inch)" number, "percentage of lead shot in 30-inch circle at 40 yards" text, "identification (notches)" number, "identification (stars)\n(spanish shotguns)" number ) -- Using valid SQLite, answer the following questions for t...
SELECT "choke" FROM table_203_112 WHERE "identification (notches)" = '1' ORDER BY "percentage of lead shot in 30-inch circle at 40 yards" DESC LIMIT 1
squall
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 diagnoses.short_title, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Josette Orr"
mimicsql_data
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE time_zone ( time_zone_code t...
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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AN...
atis
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_23 ( fifth_district VARCHAR, second_district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the Fifth District with a Second District of paul leidig?
SELECT fifth_district FROM table_name_23 WHERE second_district = "paul leidig"
sql_create_context
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journali...
SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Michael Elhadad' AND keyphrase.keyphrasename = 'syntactic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = autho...
scholar
CREATE TABLE table_63019 ( "Artist" text, "Song" text, "Lyrics (l) / Music (m)" text, "Votes" text, "Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the Votes for the Song by Artist Filipa Batista?
SELECT "Votes" FROM table_63019 WHERE "Artist" = 'filipa batista'
wikisql
CREATE TABLE table_name_95 ( other VARCHAR, firefox VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of users were using other browsers according to the source that reported 21.22% were using Firefox?
SELECT other FROM table_name_95 WHERE firefox = "21.22%"
sql_create_context
CREATE TABLE table_75720 ( "1890s" text, "1890\u201391" text, "1891\u201392" text, "1892\u201393" text, "1893\u201394" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years from 1893-94 that is from the 1890s to the 1990s?
SELECT "1893\u201394" FROM table_75720 WHERE "1890s" = '1990s'
wikisql