instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_78 ( date VARCHAR, votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date were there 50,324 votes?
SELECT date FROM table_name_78 WHERE votes = "50,324"
sql_create_context
CREATE TABLE table_14995 ( "Wrestler" text, "Reigns" text, "Days held" real, "Location" text, "Successful defenses" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Reigns has 92 days held?
SELECT "Reigns" FROM table_14995 WHERE "Days held" = '92'
wikisql
CREATE TABLE table_44799 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Comp" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Opponents of halmstad and a Score of 1-1?
SELECT "Venue" FROM table_44799 WHERE "Opponents" = 'halmstad' AND "Score" = '1-1'
wikisql
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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute respiratory failure - due to increased co2 production')
eicu
CREATE TABLE table_26375386_28 ( rank_by_average VARCHAR, couple VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many ranks by average when Keiron & Brianne are the couple?
SELECT COUNT(rank_by_average) FROM table_26375386_28 WHERE couple = "Keiron & Brianne"
sql_create_context
CREATE TABLE table_55671 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the game was played at the EMCG venue, who was the away team?...
SELECT "Away team" FROM table_55671 WHERE "Venue" = 'emcg'
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 COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_NM = '小儿胃肠外科' AND STA_DATE BETWEEN '2003-08-03' AND '2015-11-21' AND SOC_SRT_DIRE_CD = '173729-a'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_24014 ( "Stations" text, "Connections" text, "City/ Neighborhood" text, "Parking" text, "Date Opened" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which station has park & ride lot parking?
SELECT "Stations" FROM table_24014 WHERE "Parking" = 'Park & Ride Lot'
wikisql
CREATE TABLE table_name_89 ( school VARCHAR, locality VARCHAR, capacity VARCHAR, ofsted VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which School has a Capacity larger than 730, and an Ofsted smaller than 106135, and a Locality of heaton mersey?
SELECT school FROM table_name_89 WHERE capacity > 730 AND ofsted < 106135 AND locality = "heaton mersey"
sql_create_context
CREATE TABLE table_name_27 ( losses INTEGER, against VARCHAR, draws VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest losses that had an against score of 2190 and more than 0 draws?
SELECT MIN(losses) FROM table_name_27 WHERE against = 2190 AND draws > 0
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId GROUP BY TagName) AS rate INNER JOIN (SELECT COUNT(PostId)...
sede
CREATE TABLE table_name_2 ( ratio VARCHAR, in_×_in VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Ratio has an in in of 17 22?
SELECT ratio FROM table_name_2 WHERE in_×_in = "17 × 22"
sql_create_context
CREATE TABLE table_name_56 ( laps INTEGER, time VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of laps for the time of +7.277 and the grid number of more than 6?
SELECT SUM(laps) FROM table_name_56 WHERE time = "+7.277" AND grid > 6
sql_create_context
CREATE TABLE table_61996 ( "Source" text, "Date" text, "Kaine (D)" text, "Kilgore (R)" text, "Potts (I)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Kilgore's (R) percentage when Potts (I) polled at 1%?
SELECT "Kilgore (R)" FROM table_61996 WHERE "Potts (I)" = '1%'
wikisql
CREATE TABLE table_17323092_8 ( high_points VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who earned high points in game 69?
SELECT high_points FROM table_17323092_8 WHERE game = 69
sql_create_context
CREATE TABLE table_1676073_12 ( points_for VARCHAR, points_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams had 632 points against?
SELECT COUNT(points_for) FROM table_1676073_12 WHERE points_against = "632"
sql_create_context
CREATE TABLE table_44642 ( "Election" real, "Number of PNC votes" text, "Share of votes" text, "Seats" text, "Outcome of election" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest election with 2 seats and the outcome of the elect...
SELECT MIN("Election") FROM table_44642 WHERE "Outcome of election" = 'minority in parliament' AND "Seats" = '2'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, ...
SELECT CASE WHEN PostTypeId = 1 THEN 'Questions' ELSE 'Answers' END, MAX(CAST(Score AS FLOAT) / DATEDIFF(DAY, CreationDate, GETDATE())) AS Score FROM Posts WHERE DATEDIFF(DAY, CreationDate, GETDATE()) > 0 AND PostTypeId IN (1, 2) GROUP BY PostTypeId
sede
CREATE TABLE table_name_81 ( tonnage INTEGER, name_of_ship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average tonnage of the ship named proletarij?
SELECT AVG(tonnage) FROM table_name_81 WHERE name_of_ship = "proletarij"
sql_create_context
CREATE TABLE table_67298 ( "Name" text, "Country" text, "Status" text, "Moving to" text, "Transfer window" text, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Transfer fee, when the Transfer window is 'winter', and wh...
SELECT "Transfer fee" FROM table_67298 WHERE "Transfer window" = 'winter' AND "Moving to" = 'northwich victoria'
wikisql
CREATE TABLE table_12419515_5 ( written_by VARCHAR, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the people who wrote number 67
SELECT written_by FROM table_12419515_5 WHERE series__number = 67
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labi...
SELECT COUNT(*) 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 = 82235)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'or urine' AND d_it...
mimic_iii
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 AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_CD = '2348' AND IN_HOSP_DATE BETWEEN '2007-10-12' AND '2010-05-02' AND IN_DIAG_DIS_NM = '冠状动脉粥样硬化性心脏病' AND CLINIC_TYPE = '住院'
css
CREATE TABLE table_28357 ( "Road race" text, "Distance" text, "Location" text, "Country" text, "Month held" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the istanbul marathon?
SELECT "Location" FROM table_28357 WHERE "Road race" = 'Istanbul Marathon'
wikisql
CREATE TABLE table_name_30 ( top_10s INTEGER, wins INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the best top 10 when there are fewer than 0 wins?
SELECT MAX(top_10s) FROM table_name_30 WHERE wins < 0
sql_create_context
CREATE TABLE table_1859855_2 ( age INTEGER, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When austin, texas is the hometown what is the lowest age?
SELECT MIN(age) FROM table_1859855_2 WHERE hometown = "Austin, Texas"
sql_create_context
CREATE TABLE table_15887683_1 ( content VARCHAR, television_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the content of the rai 1 television service?
SELECT content FROM table_15887683_1 WHERE television_service = "Rai 1"
sql_create_context
CREATE TABLE table_name_79 ( gold VARCHAR, total VARCHAR, bronze VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many golds for teams ranking below 7 with 3 bronze and less than 5 total medals?
SELECT COUNT(gold) FROM table_name_79 WHERE bronze = 3 AND rank > 7 AND total < 5
sql_create_context
CREATE TABLE table_203_481 ( id number, "n\u00b0" number, "name" text, "position" text, "date of birth" text, "nationality" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many had position s ?
SELECT COUNT(*) FROM table_203_481 WHERE "position" = 's'
squall
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number,...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Iran%' ORDER BY Reputation DESC LIMIT 1000
sede
CREATE TABLE table_name_8 ( name VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has a total of 8 (24)?
SELECT name FROM table_name_8 WHERE total = "8 (24)"
sql_create_context
CREATE TABLE table_name_1 ( area__km_2__ VARCHAR, telephone__052_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which area has a telephone of (052) of 3862279?
SELECT area__km_2__ FROM table_name_1 WHERE telephone__052_ = "3862279"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc21.MED_AMOUT FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '88534904844'
css
CREATE TABLE table_53791 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the Kings game when they had a record of 8 1...
SELECT "Score" FROM table_53791 WHERE "Record" = '8–11–1'
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 COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '0389131' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-09-03' AND '2008-03-14' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 1563.42) AS T
css
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show minimal age from each ...
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job DESC
nvbench
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.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM, AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2092473' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY AVG(t_kc21.IN_HOSP_DAYS)
css
CREATE TABLE table_name_14 ( launched VARCHAR, laid_down VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was launched and laid down in February 1819?
SELECT launched FROM table_name_14 WHERE laid_down = "february 1819"
sql_create_context
CREATE TABLE table_40854 ( "Season" real, "Overall" text, "Slalom" text, "Giant Slalom" text, "Super G" text, "Downhill" text, "Combined" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the giant slalom with a 37 super g?
SELECT "Giant Slalom" FROM table_40854 WHERE "Super G" = '37'
wikisql
CREATE TABLE table_30665 ( "Couple" text, "Style" text, "Music" text, "Trine Dehli Cleve" real, "Tor Fl\u00f8ysvik" real, "Karianne Gulliksen" real, "Christer Tornell" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the...
SELECT "Style" FROM table_30665 WHERE "Total" = '27'
wikisql
CREATE TABLE table_name_67 ( name VARCHAR, games VARCHAR, order VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had an order of 907 and more than 1 game?
SELECT name FROM table_name_67 WHERE games > 1 AND order = 907
sql_create_context
CREATE TABLE gwyjzb ( 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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_NM = '白内障' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_DIS_...
css
CREATE TABLE table_203_375 ( id number, "name" text, "year built" text, "country" text, "town" text, "height" text, "remarks" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of pylons listed ?
SELECT COUNT("name") FROM table_203_375
squall
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Temporary colostomy"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Sarcoidosis" AND prescriptions.route = "NG"
mimicsql_data
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType
nvbench
CREATE TABLE table_name_37 ( school VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which School has a Location of peru?
SELECT school FROM table_name_37 WHERE location = "peru"
sql_create_context
CREATE TABLE table_62121 ( "Date" text, "Ship Name" text, "Tonnage" real, "Ship Type" text, "Location" text, "Disposition of Ship" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Ship Type of the Prize Disposition of ship and a tonnag...
SELECT "Ship Type" FROM table_62121 WHERE "Disposition of Ship" = 'prize' AND "Tonnage" < '151'
wikisql
CREATE TABLE club ( clubname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of all clubs?
SELECT clubname FROM club
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE ref_service_types ( service_type_code text, parent_service_type_code text, service_type_description text ) CREATE TABLE services ( service_id number, service_type_code text, workshop_group_id number, product_description text, product_name text, product_price number, ...
SELECT T1.order_date FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_price > 1000
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.age < "70"
mimicsql_data
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice) DESC
nvbench
CREATE TABLE table_20524090_1 ( obama_percentage VARCHAR, mccain_percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Obama's percentage in those places where McCain's percentage was 55.46%?
SELECT obama_percentage FROM table_20524090_1 WHERE mccain_percentage = "55.46%"
sql_create_context
CREATE TABLE table_name_37 ( year VARCHAR, title VARCHAR, result VARCHAR, genre VARCHAR, label VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year's genre was jazz under the columbia label when it was nominated for the title Trio jeepy?
SELECT year FROM table_name_37 WHERE genre = "jazz" AND label = "columbia" AND result = "nominated" AND title = "trio jeepy"
sql_create_context
CREATE TABLE table_12679326_1 ( district VARCHAR, party VARCHAR, committee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district is represented by a Republican Appropriations Committee?
SELECT district FROM table_12679326_1 WHERE party = "Republican" AND committee = "Appropriations"
sql_create_context
CREATE TABLE table_54524 ( "Grade" text, "Points" real, "Sit-up (reps)" text, "Standing Broad Jump (cm)" text, "Chin-up (reps)" text, "Shuttle Run (sec)" text, "2.4km Run (min:sec)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many poi...
SELECT MAX("Points") FROM table_54524 WHERE "Grade" = 'a'
wikisql
CREATE TABLE table_name_2 ( number_of_households INTEGER, median_household_income VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most households with a median household income of $54,086 with less than 231,236 in populatio...
SELECT MAX(number_of_households) FROM table_name_2 WHERE median_household_income = "$54,086" AND population < 231 OFFSET 236
sql_create_context
CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE discipline_enrollments ( campus number, discipline number, year numbe...
SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = "San Francisco State University"
spider
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4874710' AND t_kc22.SOC_SRT_DIRE_CD = '563098'
css
CREATE TABLE table_10151 ( "Player" text, "Span" text, "Start" real, "Tries" real, "Conv" real, "Pens" real, "Drop" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of tries for a player with conv smaller than 45, 19 starts a...
SELECT COUNT("Tries") FROM table_10151 WHERE "Conv" < '45' AND "Start" = '19' AND "Pens" < '22'
wikisql
CREATE TABLE table_name_52 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the North Melbourne's score when they played as the home team?
SELECT home_team AS score FROM table_name_52 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE table_203_54 ( id number, "selected\nlatin american\ncountries" text, "internl.\ntourism\narrivals\n2010\n(x 1000)" number, "internl.\ntourism\nreceipts.\n2010\n(usd\n(x1000)" number, "average\nreceipt\nper visitor\n2009\n(usd/turista)" number, "tourist\narrivals\nper\n1000 inhab\n(...
SELECT "selected\nlatin american\ncountries" FROM table_203_54 ORDER BY "tourism\nincome\n%\ngdp\n2003" LIMIT 1
squall
CREATE TABLE table_name_12 ( laps INTEGER, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest number of laps completed by a rank 32?
SELECT MIN(laps) FROM table_name_12 WHERE rank = "32"
sql_create_context
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
SELECT COUNT(*) FROM geographic, restaurant WHERE geographic.county = 'santa cruz county' AND restaurant.city_name = geographic.city_name AND restaurant.name = 'jamerican cuisine'
restaurants
CREATE TABLE table_9812 ( "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 Place, when Player is 'Arnold Palmer'?
SELECT "Place" FROM table_9812 WHERE "Player" = 'arnold palmer'
wikisql
CREATE TABLE table_5180 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tiger Woods has played less than 21 events and is what rank?
SELECT COUNT("Rank") FROM table_5180 WHERE "Player" = 'tiger woods' AND "Events" < '21'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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_MZ...
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 patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-39354') AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_52302 ( "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT "D 48 \u221a" FROM table_52302 WHERE "D 46 \u221a" = 'r 33 o'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Exc/dest hrt lesion open"
mimicsql_data
CREATE TABLE table_75415 ( "Model" text, "Engine" text, "Displacement" text, "Valvetrain" text, "Fuel system" text, "Max. power at rpm" text, "Max. torque at rpm" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum torque that...
SELECT "Max. torque at rpm" FROM table_75415 WHERE "Displacement" = '2,445 cc' AND "Engine" = 'iveco 8144.61'
wikisql
CREATE TABLE table_203_47 ( id number, "game" number, "date" text, "opponent" text, "location" text, "score" text, "ot" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games were won by the...
SELECT COUNT("game") FROM table_203_47 WHERE "score" - "score" > 2
squall
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID)
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ...
css
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_10966926_2 ( player_name VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player went to Michigan State?
SELECT player_name FROM table_10966926_2 WHERE college = "Michigan State"
sql_create_context
CREATE TABLE table_20220 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHO WAS THE COVER MODEL OF PLAYBOY WHERE THE CENTERFO...
SELECT "Cover model" FROM table_20220 WHERE "Centerfold model" = 'Shallan Meiers'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT COUNT(*) AS CNT FROM Posts WHERE Tags LIKE '%java%' AND Tags LIKE '%collision-detection%'
sede
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, stud...
SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name
nvbench
CREATE TABLE table_dev_30 ( "id" int, "gender" string, "leukopenia" int, "cd4_count" int, "stroke" bool, "platelets" int, "hematocrit_hct" float, "fasting_triglycerides" int, "coronary_stenosis" int, "hyperlipidemia" bool, "lymphopenia" int, "fasting_ldl_cholesterol" int,...
SELECT * FROM table_dev_30 WHERE (serum_creatinine >= 1.3 AND gender = 'female') OR (serum_creatinine >= 1.5 AND gender = 'male')
criteria2sql
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '97703801' AND t_kc22.t_kc21_MED_SER_ORG_NO = '4175966') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE gwyjzb ( 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.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '6000894' GROUP BY gwyjzb.MED_ORG_DEPT_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINI...
css
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT * FROM t_kc21 WHERE t_kc21.PERSON_NM = '张永望' AND t_kc21.MED_SER_ORG_NO = '6947100' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%科学%'
css
CREATE TABLE table_34429 ( "Tournament" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text, "Win %" real ) -- Using valid SQLite, answer the following questions for the ...
SELECT "2005" FROM table_34429 WHERE "2004" = '3–2'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE pr...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
SELECT COUNT(wdmzjzjlb.ZZYSGH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '82905019' AND wdmzjzjlb.JZKSRQ BETWEEN '2000-09-22' AND '2002-06-22' UNION SELECT COUNT(bdmzjzjlb.ZZYSGH) FROM hz_info JOIN bdmzjzjlb ON hz_...
css
CREATE TABLE staff ( phone_number VARCHAR ) CREATE TABLE customers ( phone_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the phone number of all the customers and staff.
SELECT phone_number FROM customers UNION SELECT phone_number FROM staff
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
SELECT Q.Title, A.* FROM Posts AS A JOIN Posts AS Q ON A.ParentId = Q.Id JOIN PostTags ON PostTags.PostId = Q.Id JOIN Tags ON PostTags.TagId = Tags.Id WHERE A.OwnerUserId = '##UserId##' AND A.PostTypeId = 2 AND Q.PostTypeId = 1 AND TagName = 'algorithm' ORDER BY A.Score DESC
sede
CREATE TABLE table_name_99 ( bronze INTEGER, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Bronze has a Nation of spain?
SELECT MAX(bronze) FROM table_name_99 WHERE nation = "spain"
sql_create_context
CREATE TABLE table_33609 ( "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. -- What was the attendance when the VFL played Glen...
SELECT SUM("Crowd") FROM table_33609 WHERE "Venue" = 'glenferrie oval'
wikisql
CREATE TABLE table_name_22 ( year INTEGER, wins VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year associated with 0 wins and 42 points?
SELECT MIN(year) FROM table_name_22 WHERE wins > 0 AND points = 42
sql_create_context
CREATE TABLE table_75490 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Men's doubles have a Year smaller than 1960,...
SELECT "Men's doubles" FROM table_75490 WHERE "Year" < '1960' AND "Men's singles" = 'noel b. radford'
wikisql
CREATE TABLE table_73505 ( "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. -- Where ...
SELECT "Location Attendance" FROM table_73505 WHERE "High points" = 'Carl Landry (25)'
wikisql
CREATE TABLE table_name_47 ( played INTEGER, goals_conceded VARCHAR, draw VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest number played when there were 21 goals conceded and a draw greater than 3?
SELECT MAX(played) FROM table_name_47 WHERE goals_conceded = 21 AND draw > 3
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'E21.594' AND jyjgzbb.JCZBMC = '降钙素原' UNION SELECT jyjgzbb.CKZFWXX,...
css
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON 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.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGD...
css