instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejectio...
SELECT TagName AS "You can edit the following tag wikis" FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName HAVING COUNT(*) >= 10 ORDER BY TagName...
sede
CREATE TABLE table_4096 ( "Country" text, "Area (km 2 )" real, "Population(2012)" real, "Density (/km 2 )" real, "GDP (nominal), USD (2012)" text, "GDP (nominal) per capita, USD (2012)" text, "HDI (2012)" text, "Capital" text ) -- Using valid SQLite, answer the following questions for ...
SELECT "HDI (2012)" FROM table_4096 WHERE "GDP (nominal) per capita, USD (2012)" = '$849'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '姜逸春' AND hz_info.YLJGDM = '3708794' AND NOT zyjzjlb.JZKSMC LIKE '%药房%'
css
CREATE TABLE table_10362 ( "Candidate" text, "Total Receipts" real, "Loans Received" real, "Receipts w/o Loans" real, "Money Spent" real, "Cash On Hand" real, "Total Debt" real, "Cash on Hand Minus Debt" real ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT AVG("Total Debt") FROM table_10362 WHERE "Total Receipts" > '9,969,292'
wikisql
CREATE TABLE table_27115960_1 ( title VARCHAR, written_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Phil Klemmer wrote all titles and production code is 3t6455.
SELECT title FROM table_27115960_1 WHERE written_by = "Phil Klemmer" AND production_code = "3T6455"
sql_create_context
CREATE TABLE table_1601935_1 ( archive VARCHAR, viewers__in_millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the archive for episode with 6.6 million viewers?
SELECT archive FROM table_1601935_1 WHERE viewers__in_millions_ = "6.6"
sql_create_context
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varcha...
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 (((flight.arrival_time <= 1730 AND flight.arrival_time >= 1630) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_...
atis
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 t_kc21.MED_CLINIC_ID FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '赵凯乐' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-08-29' AND '2016-10-19'
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, s...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18841) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY procedures_icd.charttime DESC LIMIT ...
mimic_iii
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id numbe...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'levetiracetam') AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_name_64 ( grid VARCHAR, laps VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many grids have 102 laps and a Time/Retired of + 6.18?
SELECT COUNT(grid) FROM table_name_64 WHERE laps > 102 AND time_retired = "+ 6.18"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name...
SELECT YEAR(CreationDate), AVG(Score) FROM Posts WHERE PostTypeId = 2 AND Score >= 0 GROUP BY YEAR(CreationDate)
sede
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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, ...
SELECT zyjzjlb.CYKSDM, zyjzjlb.CYKSMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '69572598363'
css
CREATE TABLE table_58570 ( "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 of the North Melbourne's...
SELECT COUNT("Crowd") FROM table_58570 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_name_89 ( constructor VARCHAR, tyre VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the constructor when Eugenio Castellotti was the pole position and the race had a C tyre?
SELECT constructor FROM table_name_89 WHERE tyre = "c" AND pole_position = "eugenio castellotti"
sql_create_context
CREATE TABLE table_24387 ( "Team name" text, "Races" real, "Won" real, "RR1 Pts." real, "RR2 Pts." real, "Total Pts." text, "Ranking" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most races
SELECT MAX("Races") FROM table_24387
wikisql
CREATE TABLE table_34179 ( "Ranking" real, "Nationality" text, "Name" text, "Goals" real, "Years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most goals for josep samitier
SELECT MAX("Goals") FROM table_34179 WHERE "Name" = 'josep samitier'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51663) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '...
mimic_iii
CREATE TABLE table_19149550_9 ( bangladeshi_population INTEGER, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Bangladeshi citizens live in the borough ranked at number 14?
SELECT MAX(bangladeshi_population) FROM table_19149550_9 WHERE rank = 14
sql_create_context
CREATE TABLE table_203_339 ( id number, "year" text, "car" number, "start" number, "qual" number, "rank" number, "finish" number, "laps" number, "led" number, "retired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year -lr...
SELECT "year" FROM table_203_339 WHERE "finish" <= 4
squall
CREATE TABLE table_2273738_1 ( metropolitan_area INTEGER, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total membership for the metropolitan area in the city of Manchester?
SELECT MAX(metropolitan_area) FROM table_2273738_1 WHERE city = "Manchester"
sql_create_context
CREATE TABLE table_name_35 ( venue VARCHAR, event VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue of the 400 M Hurdles for the Olympic Games?
SELECT venue FROM table_name_35 WHERE event = "400 m hurdles" AND tournament = "olympic games"
sql_create_context
CREATE TABLE table_23117208_3 ( viewers__millions_ VARCHAR, prod_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many millions of spectator did has the episode whose prod.code was rp#213?
SELECT viewers__millions_ FROM table_23117208_3 WHERE prod_code = "RP#213"
sql_create_context
CREATE TABLE table_1940144_1 ( change_since_2006 VARCHAR, urban_area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many places has the rank changed since 2006, for Clane?
SELECT change_since_2006 FROM table_1940144_1 WHERE urban_area = "Clane"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_name_54 ( playoffs VARCHAR, year VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Year larger than 1975, and a Record of 13 11 is what playoffs?
SELECT playoffs FROM table_name_54 WHERE year > 1975 AND record = "13–11"
sql_create_context
CREATE TABLE table_name_21 ( score VARCHAR, player VARCHAR, place VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Place is 'T5', when Country is 'United States', and when Player is 'Davis Love III'?
SELECT score FROM table_name_21 WHERE place = "t5" AND country = "united states" AND player = "davis love iii"
sql_create_context
CREATE TABLE table_name_26 ( young_classification VARCHAR, sprint_classification VARCHAR, general_classification VARCHAR, team_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which young classification has general classification of Chri...
SELECT young_classification FROM table_name_26 WHERE general_classification = "christian vande velde" AND team_classification = "team columbia" AND sprint_classification = "mark cavendish"
sql_create_context
CREATE TABLE table_name_48 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If fitzroy was the home team what date did they play?
SELECT date FROM table_name_48 WHERE home_team = "fitzroy"
sql_create_context
CREATE TABLE table_35601 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the rider for laps less than 23 with grid greater than 21 that had a time of +1 lap?
SELECT "Rider" FROM table_35601 WHERE "Laps" < '23' AND "Grid" > '21' AND "Time/Retired" = '+1 lap'
wikisql
CREATE TABLE table_51721 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average point total for arrows racing team before 1983?
SELECT AVG("Points") FROM table_51721 WHERE "Team" = 'arrows racing team' AND "Year" < '1983'
wikisql
CREATE TABLE table_45784 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE PLACE WITH A SCORE OF 73-65-73-71=282?
SELECT "Place" FROM table_45784 WHERE "Score" = '73-65-73-71=282'
wikisql
CREATE TABLE table_13710464_1 ( losing_pitcher VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the losing pitcher when 40583 attended?
SELECT losing_pitcher FROM table_13710464_1 WHERE attendance = 40583
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '孔婉丽' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 1836.29)
css
CREATE TABLE table_6227 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score when february is more than 24 and has a record of 9-8-2
SELECT "Score" FROM table_6227 WHERE "February" > '24' AND "Record" = '9-8-2'
wikisql
CREATE TABLE table_name_96 ( status VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of Prenocephale?
SELECT status FROM table_name_96 WHERE name = "prenocephale"
sql_create_context
CREATE TABLE PRODUCTS ( Product_Name VARCHAR, Product_Price INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all the distinct product names with price higher than the average.
SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT AVG(Product_Price) FROM PRODUCTS)
sql_create_context
CREATE TABLE table_42760 ( "Sport" text, "Record" text, "Nation - athlete(s)" text, "Date" text, "Time (seconds)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date, when the Record is, 'track', when the Time (seconds) is longer than 43...
SELECT "Date" FROM table_42760 WHERE "Record" = 'track' AND "Time (seconds)" > '43.564' AND "Sport" = 'luge - women''s singles'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13528) AND STRFTIME('%y', labevents.charttime) >= '2104'
mimic_iii
CREATE TABLE table_44008 ( "Round" real, "Pick" real, "Name" text, "Position" text, "College" text, "AAFC Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has a Round smaller than 5, and a Pick of 5?
SELECT "Position" FROM table_44008 WHERE "Round" < '5' AND "Pick" = '5'
wikisql
CREATE TABLE table_9026 ( "Name" text, "GP-GS" text, "Effic" real, "Att-Cmp-Int" text, "Avg/G" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the aveg/g for the qb with the Att-Cmp-Int of 117 215 6?
SELECT COUNT("Avg/G") FROM table_9026 WHERE "Att-Cmp-Int" = '117–215–6'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND demographic.admityear < "2129"
mimicsql_data
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_Name, School_ID FROM basketball_match
nvbench
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate t...
WITH MyData AS (SELECT NTILE(100) OVER (ORDER BY Reputation) AS Precentile, Reputation FROM Users AS u) SELECT Precentile, CAST(AVG(Reputation * 1.0) AS INT) AS AvgReputation FROM MyData GROUP BY Precentile
sede
CREATE TABLE table_22800 ( "Year" text, "League" text, "Reg. Season" text, "Playoffs" text, "Owner(s)" text, "Avg. Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in the year 1995/96 what was the reg. season
SELECT "Reg. Season" FROM table_22800 WHERE "Year" = '1995/96'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY Affiliation
nvbench
CREATE TABLE table_19927 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the netflix code for episode 46?
SELECT "Netflix" FROM table_19927 WHERE "Episode" = '46'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ...
SELECT c.Score, c.Id AS "comment_link" FROM Comments AS c WHERE c.CreationDate BETWEEN 'January 1, 2013' AND 'December 31, 2014' AND c.UserId = @userid ORDER BY c.Score
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT demographic.dob, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "25543"
mimicsql_data
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate...
SELECT * FROM PostHistoryTypes
sede
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) DESC
nvbench
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Founder, SUM(Revenue) FROM Manufacturers GROUP BY Founder
nvbench
CREATE TABLE table_name_9 ( draw VARCHAR, place VARCHAR, televotes VARCHAR, song VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Draw(s), when Televotes is greater than 1761, when Song is 'Ils Sont L ', and when Place is le...
SELECT COUNT(draw) FROM table_name_9 WHERE televotes > 1761 AND song = "ils sont là" AND place < 2
sql_create_context
CREATE TABLE table_204_51 ( id number, "week #" text, "theme" text, "song choice" text, "original artist" text, "order #" number, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many songs sung were by cl udio zoli ?
SELECT COUNT("song choice") FROM table_204_51 WHERE "original artist" = 'claudio zoli'
squall
CREATE TABLE table_24547593_1 ( pole_position VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was in the pole position for knockhill?
SELECT pole_position FROM table_24547593_1 WHERE circuit = "Knockhill"
sql_create_context
CREATE TABLE table_51942 ( "Name" text, "Street address" text, "Years as tallest" text, "Height ft (m)" text, "Floors" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many floors does the building on 800 Boylston Street have?
SELECT MAX("Floors") FROM table_51942 WHERE "Street address" = '800 boylston street'
wikisql
CREATE TABLE table_name_92 ( points INTEGER, percentage_of_possible_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points have a percentage of possible points of 67.22%?
SELECT SUM(points) FROM table_name_92 WHERE percentage_of_possible_points = "67.22%"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, Mark...
SELECT t.TagName, COUNT(*) AS "total_posts", SUM(CASE WHEN AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS "unanswered_posts", SUM(CASE WHEN AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) * 1.0 / COUNT(*) AS "%_unanswered" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId...
sede
CREATE TABLE table_75355 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the call sign of the translator in Spring Valley, Nevada?
SELECT "Call sign" FROM table_75355 WHERE "City of license" = 'spring valley, nevada'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGu...
SELECT 'site://tags/' + TagName + '|' + TagName AS "tagname", Count FROM Tags ORDER BY Count DESC
sede
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2115.0" AND procedures.long_title = "Coronary arteriography using two catheters"
mimicsql_data
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE diagnoses_icd ( ...
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19412 AND admissions.dischtime IS NULL) AND NOT transfers.careunit IS NULL ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE film_text ( film_id SMALLINT, title VARCHAR(255), description TEXT ) CREATE TABLE rental ( rental_id INT, rental_date DATETIME, inventory_id MEDIUMINT UNSIGNED, customer_id SMALLINT UNSIGNED, return_date DATETIME, staff_id TINYINT UNSIGNED, last_update TIMESTAMP ) ...
SELECT name, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id ORDER BY name DESC
nvbench
CREATE TABLE table_51070 ( "Poll Source" text, "Dates administered" text, "Democrat: Jay Nixon" text, "Republican: Kenny Hulshof" text, "Lead Margin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the dates where Hulshof had 37% and Nixon h...
SELECT "Dates administered" FROM table_51070 WHERE "Republican: Kenny Hulshof" = '37%' AND "Democrat: Jay Nixon" = '48%'
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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSMC = '小儿耳鼻喉科' AND mzjzjlb.JZKSRQ BETWEEN '2006-04-21' AND '2010-09-27'
css
CREATE TABLE table_16489766_2 ( urban_population__2010_ VARCHAR, pinyin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total urban population of the city with the pinyin translation ch ngch n?
SELECT COUNT(urban_population__2010_) FROM table_16489766_2 WHERE pinyin = "Chángchūn"
sql_create_context
CREATE TABLE table_16457934_5 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the minimum of 25 to 29?
SELECT MIN(25 AS _to_29) FROM table_16457934_5
sql_create_context
CREATE TABLE table_name_57 ( location___state VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The winner, Craig Lowndes, was in what location/state?
SELECT location___state FROM table_name_57 WHERE winner = "craig lowndes"
sql_create_context
CREATE TABLE table_2482547_5 ( average VARCHAR, wickets_taken VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the averages for games with 212 wickets taken?
SELECT average FROM table_2482547_5 WHERE wickets_taken = 212
sql_create_context
CREATE TABLE table_54330 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the lowest laps when the grid is smaller than 5 and the driver is juan manuel fangio?
SELECT MIN("Laps") FROM table_54330 WHERE "Grid" < '5' AND "Driver" = 'juan manuel fangio'
wikisql
CREATE TABLE table_2583036_1 ( camera VARCHAR, wavelength VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the camera used when the wavelength is 814nm (i-band)?
SELECT camera FROM table_2583036_1 WHERE wavelength = "814nm (I-band)"
sql_create_context
CREATE TABLE table_14984078_1 ( record VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record when the game was played at Cleveland Municipal Stadium?
SELECT record FROM table_14984078_1 WHERE game_site = "Cleveland Municipal Stadium"
sql_create_context
CREATE TABLE table_204_678 ( id number, "record" text, "athlete" text, "nation" text, "venue" text, "date" text, "#" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many records does australia hold for pole vaulting ?
SELECT COUNT("record") FROM table_204_678 WHERE "nation" = 'australia'
squall
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 TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid ...
SELECT DISTINCT writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename IN ('ICML', 'Science ( New York , N.Y. )') AND writes.paperid = paper.paperid GROUP BY writes.authorid HAVING COUNT(DISTINCT venue.venueid) = 2
scholar
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "56962"
mimicsql_data
CREATE TABLE table_name_1 ( constructor VARCHAR, grid VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who constructed the car with a grid larger than 20 that got in an accident?
SELECT constructor FROM table_name_1 WHERE grid > 20 AND time_retired = "accident"
sql_create_context
CREATE TABLE table_22771 ( "Year" real, "World" real, "Asia" text, "Africa" text, "Europe" text, "Latin America/Caribbean" text, "Northern America" text, "Oceania" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is population in the ...
SELECT MIN("World") FROM table_22771 WHERE "Latin America/Caribbean" = '788 (8.1%)'
wikisql
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, X...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j...
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "SYNCOPE;TELEMETRY" AND procedures.short_title = "Cardiopulm resuscita NOS"
mimicsql_data
CREATE TABLE table_56357 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance at the Dallas home game on may 12?
SELECT COUNT("Attendance") FROM table_56357 WHERE "Home" = 'dallas' AND "Date" = 'may 12'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY)
nvbench
CREATE TABLE PURCHASES ( purchase_details VARCHAR, purchase_transaction_id VARCHAR ) CREATE TABLE TRANSACTIONS ( transaction_id VARCHAR, amount_of_transaction INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the purchase details of transactio...
SELECT T1.purchase_details FROM PURCHASES AS T1 JOIN TRANSACTIONS AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000
sql_create_context
CREATE TABLE table_73136 ( "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. -- Name the party for new york 4
SELECT "Party" FROM table_73136 WHERE "District" = 'New York 4'
wikisql
CREATE TABLE projects ( code text, name text, hours number ) CREATE TABLE assignedto ( scientist number, project text ) CREATE TABLE scientists ( ssn number, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of scientists ...
SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.ssn WHERE T2.hours = (SELECT MAX(hours) FROM projects)
spider
CREATE TABLE table_59619 ( "Combined" text, "50 yard Freestyle" text, "100 yard Freestyle" text, "200 yard Freestyle" text, "500 yard Freestyle" text, "100 yard Backstroke" text, "100 yard Butterfly" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "100 yard Freestyle" FROM table_59619 WHERE "100 yard Backstroke" = 'palo verde'
wikisql
CREATE TABLE table_name_77 ( position VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position is Kentucky State sitting in?
SELECT position FROM table_name_77 WHERE school = "kentucky state"
sql_create_context
CREATE TABLE table_1855841_1 ( office_running_for VARCHAR, candidate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the officing running for for carol marsh
SELECT office_running_for FROM table_1855841_1 WHERE candidate = "Carol Marsh"
sql_create_context
CREATE TABLE table_6906 ( "Name" text, "Years" text, "Tests" real, "Drew" real, "Lost" real, "Win percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the Win percentage 60%?
SELECT "Years" FROM table_6906 WHERE "Win percentage" = '60%'
wikisql
CREATE TABLE table_75205 ( "Game #" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of points of the game less than number 17 with an 11-...
SELECT SUM("Points") FROM table_75205 WHERE "Record" = '11-6-0' AND "Game #" < '17'
wikisql
CREATE TABLE table_name_68 ( attendance INTEGER, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people on average attended the game in week 14?
SELECT AVG(attendance) FROM table_name_68 WHERE week = 14
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 MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-47232')) AND lab.labname = 'rdw' AND STRFTIME('%y', lab.labresulttime) >= '210...
eicu
CREATE TABLE table_20760407_1 ( date VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date for game 9?
SELECT date FROM table_20760407_1 WHERE game = 9
sql_create_context
CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_percent real ) CREATE TABLE program ( Program_ID int, Name text, Origin text,...
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY SUM(Rating_in_percent)
nvbench
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(Q.Id) FROM Posts AS Q WHERE Q.AnswerCount = 0 AND Q.PostTypeId = 1
sede
CREATE TABLE table_name_22 ( start VARCHAR, entrant VARCHAR, engine VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What start has a ford cosworth dfx as the engine, a year later than 1981, and kraco enterprises as the entrant?
SELECT start FROM table_name_22 WHERE engine = "ford cosworth dfx" AND year > 1981 AND entrant = "kraco enterprises"
sql_create_context
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.JZZDBM, mzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '褚学义'
css
CREATE TABLE table_14039 ( "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. -- who is the away team when the home team is hartlepool united?
SELECT "Away team" FROM table_14039 WHERE "Home team" = 'hartlepool united'
wikisql
CREATE TABLE table_40953 ( "Year" real, "Date" text, "Television" text, "Designated Visitors" text, "Designated Home" text, "Stadium" text, "City" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the home team during the game that air...
SELECT "Designated Home" FROM table_40953 WHERE "Television" = 'fox' AND "Year" > '2007' AND "Date" = 'october 23'
wikisql
CREATE TABLE table_name_20 ( batting_1st VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is batting 1st in game 8?
SELECT batting_1st FROM table_name_20 WHERE game = 8
sql_create_context