context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Po...
users who got a welcome comment within 24 hours.
SELECT udfp.OwnerUserId, COUNT(c.Id) AS numwelcomes FROM (SELECT p.OwnerUserId, MIN(p.CreationDate) AS dfp FROM Posts AS p WHERE p.PostTypeId < 3 GROUP BY p.OwnerUserId) AS udfp LEFT OUTER JOIN Posts AS p ON p.OwnerUserId = udfp.OwnerUserId AND p.PostTypeId < 3 LEFT OUTER JOIN Comments AS c ON UPPER(c.Text) LIKE '%WELC...
sede
CREATE TABLE table_45482 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
WHAT IS THE SCORE FOR 2010 fifa world cup qualification?
SELECT "Score" FROM table_45482 WHERE "Competition" = '2010 fifa world cup qualification'
wikisql
CREATE TABLE table_name_5 ( team VARCHAR, arena VARCHAR )
What team is in the dhl-h llin arena?
SELECT team FROM table_name_5 WHERE arena = "dhl-höllin"
sql_create_context
CREATE TABLE table_26719 ( "Pitcher" text, "Strikeouts" real, "Season" real, "Team" text, "League" text, "Overall Rank" real )
Name the most overall rank for nl/ua league
SELECT MAX("Overall Rank") FROM table_26719 WHERE "League" = 'NL/UA'
wikisql
CREATE TABLE table_28446 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text )
How many seasons have points totals of N/A?
SELECT COUNT("Season") FROM table_28446 WHERE "Points" = 'N/A'
wikisql
CREATE TABLE table_name_22 ( ground VARCHAR, score VARCHAR )
Where was the game played the ended with a score of 62-69?
SELECT ground FROM table_name_22 WHERE score = "62-69"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, ...
when did patient 21074 come for the last time until 2 years ago via the transfer from hosp/extram into the hospital?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 21074 AND admissions.admission_location = 'transfer from hosp/extram' AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PendingFlags ( ...
Editors in a time interval.
SELECT UserId AS "user_link", COUNT(*) AS Edits FROM PostHistory WHERE PostHistoryTypeId IN (4, 5, 6) AND CreationDate >= '##start##' AND CreationDate < '##end##' GROUP BY UserId ORDER BY Edits DESC
sede
CREATE TABLE table_42553 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was the time of the bout against Dave Menne?
SELECT "Time" FROM table_42553 WHERE "Opponent" = 'dave menne'
wikisql
CREATE TABLE table_20217456_7 ( season VARCHAR, rl_süd__2nd_ VARCHAR )
What season was Freiburger FC the RL S d (2nd) team?
SELECT season FROM table_20217456_7 WHERE rl_süd__2nd_ = "Freiburger FC"
sql_create_context
CREATE TABLE table_name_87 ( runs VARCHAR, average INTEGER )
What is the total number of runs where the average is less than 27.22?
SELECT COUNT(runs) FROM table_name_87 WHERE average < 27.22
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id...
show me flights from BALTIMORE to DALLAS
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALL...
atis
CREATE TABLE table_name_53 ( manufacturer VARCHAR, rider VARCHAR, laps VARCHAR, grid VARCHAR )
Which manufacturer has more than 28 laps and less than 9 grids with jeremy mcwilliams?
SELECT manufacturer FROM table_name_53 WHERE laps < 28 AND grid < 9 AND rider = "jeremy mcwilliams"
sql_create_context
CREATE TABLE table_2430014_8 ( directed_by VARCHAR, uk_ratings__bbc2_rank_ VARCHAR )
How many directors worked on the episode with 2.27m (5) is the ratings?
SELECT COUNT(directed_by) FROM table_2430014_8 WHERE uk_ratings__bbc2_rank_ = "2.27m (5)"
sql_create_context
CREATE TABLE table_7230 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
What is on at 8:30 when million dollar password is on at 8:00?
SELECT "8:30" FROM table_7230 WHERE "8:00" = 'million dollar password'
wikisql
CREATE TABLE table_30684 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text )
Who directed the episode titled 'Everything That Rises Must Converge'?
SELECT "Directed by" FROM table_30684 WHERE "Title" = 'Everything That Rises Must Converge'
wikisql
CREATE TABLE table_203_622 ( id number, "date" text, "team" text, "name" text, "position" text, "years in nba" number, "notes" text )
bruce bowen and mark madsen both played what position ?
SELECT "position" FROM table_203_622 WHERE "name" = 'bruce bowen'
squall
CREATE TABLE table_49230 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text )
Who are the semifinalists when the tournament is in Cincinnati?
SELECT "Semifinalists" FROM table_49230 WHERE "Tournament" = 'cincinnati'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many unmarried patients have diagnoses icd9 code 70724?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.icd9_code = "70724"
mimicsql_data
CREATE TABLE table_14928 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the highest Lane used by a racer from Malta?
SELECT MAX("Lane") FROM table_14928 WHERE "Nationality" = 'malta'
wikisql
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,...
在编号为24475565910的这次医疗就诊中,统筹基金的支出占医疗费总额的百分比是多少
SELECT (SELECT OVE_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '24475565910') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '24475565910')
css
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...
A bar chart compares the ages of all artists, rank by the X from low to high.
SELECT Name, Age FROM artist ORDER BY Name
nvbench
CREATE TABLE table_name_64 ( rebuilt VARCHAR, builder VARCHAR, name_as_rebuilt VARCHAR )
Which Rebuilt has a Builder of derby, and a Name as rebuilt of ben madigan?
SELECT rebuilt FROM table_name_64 WHERE builder = "derby" AND name_as_rebuilt = "ben madigan"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
what is the number of patients whose admission location is emergency room admit and procedure icd9 code is 12?
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.icd9_code = "12"
mimicsql_data
CREATE TABLE table_name_56 ( november INTEGER, record VARCHAR )
Which November is the lowest one that has a Record of 12 2 4 1?
SELECT MIN(november) FROM table_name_56 WHERE record = "12–2–4–1"
sql_create_context
CREATE TABLE table_6812 ( "Name" text, "Position" text, "Number" text, "School/Club Team" text, "Season" text, "Acquisition via" text )
What is the number for the forward position from the school/club team La Salle?
SELECT "Number" FROM table_6812 WHERE "Position" = 'forward' AND "School/Club Team" = 'la salle'
wikisql
CREATE TABLE table_train_219 ( "id" int, "hematocrit_hct" float, "fasting_plasma_glucose" int, "hba1c" float, "urine_protein" int, "iothalamate_clearance" int, "NOUSE" float )
iothalamate clearance < 70 cc / min
SELECT * FROM table_train_219 WHERE iothalamate_clearance < 70
criteria2sql
CREATE TABLE table_name_6 ( home_captain VARCHAR, date VARCHAR )
Which Home captain has Date of 25,26,27,29,30 march 1994?
SELECT home_captain FROM table_name_6 WHERE date = "25,26,27,29,30 march 1994"
sql_create_context
CREATE TABLE company ( id int, name text, country_code varchar ) CREATE TABLE made_by ( id int, msid int, pid int ) CREATE TABLE directed_by ( id int, msid int, did int ) CREATE TABLE copyright ( id int, msid int, cid int ) CREATE TABLE actor ( aid int, gender...
Find all actors who acted in the same movie as ' Tom Hanks
SELECT ACTOR_0.name FROM actor AS ACTOR_0, actor AS ACTOR_1, cast AS CAST_0, cast AS CAST_1, movie WHERE ACTOR_1.name = 'Tom Hanks' AND CAST_0.aid = ACTOR_0.aid AND CAST_1.aid = ACTOR_1.aid AND movie.mid = CAST_0.msid AND movie.mid = CAST_1.msid
imdb
CREATE TABLE table_73269 ( "Gas name" text, "Chemical formula" text, "Lifetime (years)" text, "20-yr" text, "100-yr" text, "500-yr" text )
What is the 20 year for Sulfur Hexafluoride?
SELECT "20-yr" FROM table_73269 WHERE "Gas name" = 'Sulfur hexafluoride'
wikisql
CREATE TABLE table_79293 ( "Time" text, "Home team" text, "Score" text, "Away team" text, "Venue" text )
What is the score of the match at happy valley recreation ground pitch #2 with a 14:30 time?
SELECT "Score" FROM table_79293 WHERE "Time" = '14:30' AND "Venue" = 'happy valley recreation ground pitch #2'
wikisql
CREATE TABLE table_name_32 ( tournament VARCHAR, winning_score VARCHAR )
Which tournament has a winning score at 7 (66-72-69-74=281)?
SELECT tournament FROM table_name_32 WHERE winning_score = –7(66 - 72 - 69 - 74 = 281)
sql_create_context
CREATE TABLE table_71831 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the Final" text, "Score in the Final" text )
When did Mathieu play against Antonio Vei ?
SELECT "Date" FROM table_71831 WHERE "Opponent in the Final" = 'antonio veić'
wikisql
CREATE TABLE table_53680 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average Gold where the Nation is Russia (rus) and the number of silver is less than 2?
SELECT AVG("Gold") FROM table_53680 WHERE "Nation" = 'russia (rus)' AND "Silver" < '2'
wikisql
CREATE TABLE table_train_143 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "agitation" bool, "npi" int, "aggression_domain" bool, "delusions_hallucinations" bool, "pulse_rate" int, "fridericia_corrected_qt_interval_qtcf" int, "diastolic_blood_pressure_dbp" int, ...
blood pressure ( sitting ) must be diastolic < 95 mmhg, and systolic < 145
SELECT * FROM table_train_143 WHERE diastolic_blood_pressure_dbp < 95 AND systolic_blood_pressure_sbp < 145
criteria2sql
CREATE TABLE table_49549 ( "Volume:Issue" text, "Issue date(s)" text, "Weeks at number one" real, "Song" text, "Artist(s)" text )
Which Weeks at number one has a Volume:Issue of 61:22-23?
SELECT MAX("Weeks at number one") FROM table_49549 WHERE "Volume:Issue" = '61:22-23'
wikisql
CREATE TABLE Royal_Family ( Royal_Family_ID INTEGER, Royal_Family_Details VARCHAR(255) ) CREATE TABLE Photos ( Photo_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(255), Description VARCHAR(255), Filename VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Theme_Parks ( ...
What is the average price range of hotels for each each star rating code. Show scatter chart.
SELECT star_rating_code, AVG(price_range) FROM Hotels GROUP BY star_rating_code
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 )
For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum of code , and group by attribute founder in a bar chart, and I want to rank in descending by the bar.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC
nvbench
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE T...
Top 100 Users by Median Score (with Avg score).
SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Answers, (SELECT MAX(Score) FROM (SELECT PERCENT AS Score FROM Posts AS PU WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND PU.OwnerUserId = Users.Id ORDER BY Score LIMIT 50) AS t) AS MedianAnswerScore FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE ...
sede
CREATE TABLE table_5094 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
On which date was the game played against the Milwaukee Bucks?
SELECT "Date" FROM table_5094 WHERE "Opponent" = 'milwaukee bucks'
wikisql
CREATE TABLE table_name_33 ( venue VARCHAR, away_team VARCHAR )
What was the Venue of the North Melbourne Away Team?
SELECT venue FROM table_name_33 WHERE away_team = "north melbourne"
sql_create_context
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 ) ...
how many patients whose admission year is less than 2174 and lab test name is potassium, urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2174" AND lab.label = "Potassium, Urine"
mimicsql_data
CREATE TABLE table_48921 ( "Model Number" text, "Clock Speed" text, "L2 Cache" text, "FSB Speed" text, "Voltage Range" text, "Socket" text )
Name the Voltage Range which has a FSB Speed of 400 mhz, and a Clock Speed of 1 ghz?
SELECT "Voltage Range" FROM table_48921 WHERE "FSB Speed" = '400 mhz' AND "Clock Speed" = '1 ghz'
wikisql
CREATE TABLE table_58223 ( "Ship" text, "Pennant number" text, "Laid down" text, "Launched" text, "Completed" text )
What is the Laid down for the Hyperion ship?
SELECT "Laid down" FROM table_58223 WHERE "Ship" = 'hyperion'
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...
how many patients whose diagnoses icd9 code is e8859 and drug type is additive?
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.icd9_code = "E8859" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_name_36 ( frequency VARCHAR, call_sign VARCHAR )
What is the frequency of KFNW?
SELECT frequency FROM table_name_36 WHERE call_sign = "kfnw"
sql_create_context
CREATE TABLE table_name_33 ( Id VARCHAR )
Name the 2003 which has a 2000 of , and a 2007 of , and a 2010 of ?
SELECT 2003 FROM table_name_33 WHERE 2000 = "—" AND 2007 = "—" AND 2010 = "—"
sql_create_context
CREATE TABLE table_name_45 ( tournament VARCHAR )
What result in 1994 has a SR as the tournament?
SELECT 1994 FROM table_name_45 WHERE tournament = "sr"
sql_create_context
CREATE TABLE table_6402 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Time" text, "Jockey" text, "Winner/2nd" text )
What was the combined weight in kilograms of the horses in the race at Chelmsford stakes?
SELECT COUNT("Weight (kg)") FROM table_6402 WHERE "Race" = 'chelmsford stakes'
wikisql
CREATE TABLE table_2355 ( "Sd" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text )
What was the max when they score 2200?
SELECT MAX("New points") FROM table_2355 WHERE "Points" = '2200'
wikisql
CREATE TABLE table_67681 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
What event (Extra) in 2002 did the competitor compete in and place 8th?
SELECT "Extra" FROM table_67681 WHERE "Year" = '2002' AND "Result" = '8th'
wikisql
CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text ) CREATE TABLE appellations ( no number, appelation text, county text, state text, area text,...
Count the number of appelations in Napa County.
SELECT COUNT(*) FROM appellations WHERE county = "Napa"
spider
CREATE TABLE table_46883 ( "Year" real, "Title" text, "Role" text, "Network" text, "Notes" text )
What is the sum of Year, when Title is 'Mnet Director's Cut'?
SELECT SUM("Year") FROM table_46883 WHERE "Title" = 'mnet director''s cut'
wikisql
CREATE TABLE table_1464 ( "Season" text, "Winner" text, "Winning Song" text, "Winning Song (English Title)" text, "Debut Album" text )
What is the winning song for the artist with a debut album 'the winner'?
SELECT "Winning Song" FROM table_1464 WHERE "Debut Album" = 'The Winner'
wikisql
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE t...
What is the average of number_of_platforms for each location? Show the comparison with a bar chart.
SELECT Location, AVG(Number_of_Platforms) FROM station GROUP BY Location
nvbench
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, ...
give me the number of patients whose age is less than 50 and diagnoses icd9 code is 34830?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "50" AND diagnoses.icd9_code = "34830"
mimicsql_data
CREATE TABLE table_28253870_1 ( founded VARCHAR, institution VARCHAR )
Name the founded for florida state university
SELECT founded FROM table_28253870_1 WHERE institution = "Florida State University"
sql_create_context
CREATE TABLE table_19813 ( "Software" text, "Version" text, "Operating systems" text, "Developer" text, "License" text )
What is hte license for beeone smod/hms software?
SELECT "License" FROM table_19813 WHERE "Software" = 'BeeOne SMOD/HMS'
wikisql
CREATE TABLE table_29586 ( "Represent" real, "Contestant" text, "Age" real, "Sizes" text, "Height" text, "Hometown" text, "Agency" text )
where is the participant marelissa him from
SELECT "Hometown" FROM table_29586 WHERE "Contestant" = 'Marelissa Him'
wikisql
CREATE TABLE table_24890 ( "English short name (upper/lower case)" text, "Alpha-2 code" text, "Alpha-3 code" text, "Numeric code" real, "ISO 3166-2 codes" text )
What is the alpha 2 code for the area also known as NZL?
SELECT "Alpha-2 code" FROM table_24890 WHERE "Alpha-3 code" = 'NZL'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
Out of total number of patients admitted before 2157, how many of them had long-term use of steroids?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2175" AND diagnoses.short_title = "Long-term use steroids"
mimicsql_data
CREATE TABLE table_name_49 ( bowling_style VARCHAR, player VARCHAR )
What is Damien Martyn's bowling style?
SELECT bowling_style FROM table_name_49 WHERE player = "damien martyn"
sql_create_context
CREATE TABLE table_15702 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
What was the total number of places in which the draw was less than 4 and the amount lost was less than 6?
SELECT COUNT("Place") FROM table_15702 WHERE "Draw" < '4' AND "Lost" < '6'
wikisql
CREATE TABLE table_59303 ( "Country" text, "Electricity production (Kw/h, billion)" real, "% Coal" real, "% Natural gas" real, "% Oil" real, "% Hydropower" real, "% Other renewable" real, "% Nuclear power" real )
what is the highest % hydropower when the % oil is less than 24.5, country is united arab emirates and the % nuclear power is 0?
SELECT MAX("% Hydropower") FROM table_59303 WHERE "% Oil" < '24.5' AND "Country" = 'united arab emirates' AND "% Nuclear power" < '0'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) 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...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by time.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_19789597_5 ( date VARCHAR, score VARCHAR )
Name the total number of date for l 63-77
SELECT COUNT(date) FROM table_19789597_5 WHERE score = "L 63-77"
sql_create_context
CREATE TABLE table_204_970 ( id number, "year" number, "award" text, "category" text, "title" text, "result" text )
was he nominated more than he actually won ?
SELECT (SELECT COUNT(*) FROM table_204_970 WHERE "result" = 'nominated') > (SELECT COUNT(*) FROM table_204_970 WHERE "result" = 'won')
squall
CREATE TABLE table_20717 ( "Institution" text, "Location" text, "Team Nickname" text, "Joined TSCHL" real, "Home Arena" text, "Capacity" real, "Team Website" text )
Which city has the cincinnati hockey website?
SELECT "Location" FROM table_20717 WHERE "Team Website" = 'Cincinnati Hockey'
wikisql
CREATE TABLE table_51543 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Event" text )
When was the first year he placed 2nd in Izmir, Turkey?
SELECT MIN("Year") FROM table_51543 WHERE "Result" = '2nd' AND "Venue" = 'izmir, turkey'
wikisql
CREATE TABLE table_name_28 ( year INTEGER, country VARCHAR, location VARCHAR )
What is the average Year, when Country is 'U.S.', and when Location is 'Edmond , OK'?
SELECT AVG(year) FROM table_name_28 WHERE country = "u.s." AND location = "edmond , ok"
sql_create_context
CREATE TABLE table_37563 ( "Date" text, "Race Name" text, "Location" text, "UCI Rating" text, "Winner" text, "Team" text )
What is the date of the gp citt di camaiore race?
SELECT "Date" FROM table_37563 WHERE "Race Name" = 'gp città di camaiore'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLO...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, could you list in descending by the JOB_ID?
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE...
How many departments are in each school Show bar chart, display by the bars in ascending.
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT ORDER BY SCHOOL_CODE
nvbench
CREATE TABLE table_28650 ( "Year (Ceremony)" text, "Film title" text, "Main Language(s)" text, "Director" text, "Result" text )
What is the number of directors for the film title Eldra?
SELECT COUNT("Director") FROM table_28650 WHERE "Film title" = 'Eldra'
wikisql
CREATE TABLE table_1342393_17 ( party VARCHAR, incumbent VARCHAR )
how many party with incumbent being whitmell p. martin
SELECT COUNT(party) FROM table_1342393_17 WHERE incumbent = "Whitmell P. Martin"
sql_create_context
CREATE TABLE table_39826 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the lowest Top-25, when Events is 10, and when Wins is greater than 0?
SELECT MIN("Top-25") FROM table_39826 WHERE "Events" = '10' AND "Wins" > '0'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
tell me the number of patients with delta abnormal lab test status who have diagnoses icd9 code 25002.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "25002" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_65685 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Which Record has a Round larger than 2, and an Event of bellator 38?
SELECT "Record" FROM table_65685 WHERE "Round" > '2' AND "Event" = 'bellator 38'
wikisql
CREATE TABLE table_name_68 ( overall INTEGER, round VARCHAR, pick__number VARCHAR )
How much Overall has a Round smaller than 6, and a Pick # of 26?
SELECT SUM(overall) FROM table_name_68 WHERE round < 6 AND pick__number = 26
sql_create_context
CREATE TABLE table_name_66 ( date VARCHAR, opponent VARCHAR, result VARCHAR )
Which Date has an Opponent of newcastle united, and a Result of 2 1?
SELECT date FROM table_name_66 WHERE opponent = "newcastle united" AND result = "2–1"
sql_create_context
CREATE TABLE table_name_68 ( surface VARCHAR, date VARCHAR )
On what surface was the 26 August 2001 tournament played?
SELECT surface FROM table_name_68 WHERE date = "26 august 2001"
sql_create_context
CREATE TABLE table_213088_1 ( gross_capacity__mw_ INTEGER, net_capacity__mw_ VARCHAR )
What is the gross capacity where the net capacity is 1380?
SELECT MIN(gross_capacity__mw_) FROM table_213088_1 WHERE net_capacity__mw_ = 1380
sql_create_context
CREATE TABLE table_61067 ( "State" text, "City" text, "Population" real, "Violent Crime" text, "Murder and Non-Negligent Manslaughter" real, "Forcible Rape" text, "Robbery" real, "Aggravated Assault" real, "Property Crime" text, "Burglary" real, "Larceny-Theft" text, "Mot...
What is the total rate of murder and non-negligent manslaughter when larceny-theft is 3,693.9 and burglary is more than 1,027.0?
SELECT SUM("Murder and Non-Negligent Manslaughter") FROM table_61067 WHERE "Larceny-Theft" = '3,693.9' AND "Burglary" > '1,027.0'
wikisql
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, ...
查询出院诊断为牙体缺损的最少和最多医疗费总额,主要针对医院2100333的医疗记录
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2100333' AND gwyjzb.OUT_DIAG_DIS_NM = '牙体缺损' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2100333' AND fgwyjzb.OUT_DIAG...
css
CREATE TABLE table_38830 ( "States" text, "Fall 05" real, "Fall 06" real, "Fall 07" real, "Fall 08" real, "Fall 09" real )
What is the mean Fall 09 number where fall 05 is less than 3?
SELECT AVG("Fall 09") FROM table_38830 WHERE "Fall 05" < '3'
wikisql
CREATE TABLE table_name_43 ( attendance VARCHAR, date VARCHAR, week VARCHAR )
Name the total number of attendance for october 20, 1946 with week less than 4
SELECT COUNT(attendance) FROM table_name_43 WHERE date = "october 20, 1946" AND week < 4
sql_create_context
CREATE TABLE table_28423 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Rank (week)" real, "Original air date" text, "Production code" text )
How many air dates does the episode with 15.50 million viewers have?
SELECT COUNT("Original air date") FROM table_28423 WHERE "U.S. viewers (million)" = '15.50'
wikisql
CREATE TABLE table_50844 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the date when Aston Villa is the away team?
SELECT "Date" FROM table_50844 WHERE "Away team" = 'aston villa'
wikisql
CREATE TABLE table_37278 ( "Date" text, "Episode" real, "Performer 1" text, "Performer 2" text, "Performer 3" text, "Performer 4" text )
Who was the 3rd performer when Rory Bremner was the 4th performer?
SELECT "Performer 3" FROM table_37278 WHERE "Performer 4" = 'rory bremner'
wikisql
CREATE TABLE table_name_50 ( title VARCHAR, production_code VARCHAR )
What is the title of the episode with a production code of ad1b04?
SELECT title FROM table_name_50 WHERE production_code = "ad1b04"
sql_create_context
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
For all employees who have the letters D or S in their first name, a line chart shows the trend of commission_pct over hire_date , and show x-axis in desc order.
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_name_99 ( mountains_classification VARCHAR, asian_team_classification VARCHAR, winner VARCHAR )
WHich Mountains classification has an Asian team classification of seoul cycling team, and a Winner of alexandre usov?
SELECT mountains_classification FROM table_name_99 WHERE asian_team_classification = "seoul cycling team" AND winner = "alexandre usov"
sql_create_context
CREATE TABLE table_name_48 ( date VARCHAR, time VARCHAR )
What date has 2:48 as the time?
SELECT date FROM table_name_48 WHERE time = "2:48"
sql_create_context
CREATE TABLE table_32918 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text )
What was the average round when he had a 3-0 record?
SELECT AVG("Round") FROM table_32918 WHERE "Record" = '3-0'
wikisql
CREATE TABLE table_15584067_7 ( written_by VARCHAR, us_viewers__million_ VARCHAR )
Name who wrote the episode when the viewers was 1.81
SELECT written_by FROM table_15584067_7 WHERE us_viewers__million_ = "1.81"
sql_create_context
CREATE TABLE table_name_86 ( format VARCHAR, region VARCHAR, catalog VARCHAR )
What Format has the Region of Europe and a Catalog of 74321 45851 2?
SELECT format FROM table_name_86 WHERE region = "europe" AND catalog = "74321 45851 2"
sql_create_context
CREATE TABLE table_23251 ( "Order" real, "Couple" text, "Karen" text, "Nicky" text, "Jason" text, "Ruthie" text, "Robin" text, "Total" text, "Skating song" text, "Scoreboard" text, "Public vote" text )
Name the karen when nicky is 2.5
SELECT "Karen" FROM table_23251 WHERE "Nicky" = '2.5'
wikisql
CREATE TABLE table_train_184 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "renal_disease" bool, "hematocrit_hct" float, "allergy_to_insulin_lispro" bool, "diastolic_blood_pressure_dbp" int, "serum_creatinine" float, "hypertension" bool, ...
allergy or adverse reaction to lispro insulin
SELECT * FROM table_train_184 WHERE allergy_to_insulin_lispro = 1
criteria2sql
CREATE TABLE table_name_26 ( player VARCHAR, original_team VARCHAR )
What player originally played for the Los Angeles Kings?
SELECT player FROM table_name_26 WHERE original_team = "los angeles kings"
sql_create_context
CREATE TABLE table_203_192 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
in 2008 , david oliver came in first during what competition ?
SELECT "competition" FROM table_203_192 WHERE "year" = 2008 AND "position" = 1
squall