table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_name_2 ( fs VARCHAR, sp INTEGER, places VARCHAR, name VARCHAR )
Name the average SP+FS with places less tha 94 for renata baierova
SELECT AVG(sp) + fs FROM table_name_2 WHERE places < 94 AND name = "renata baierova"
CREATE TABLE table_name_76 ( name VARCHAR, pick__number VARCHAR, round VARCHAR )
Which player was picked in round 15 with a pick smaller than 13?
SELECT name FROM table_name_76 WHERE pick__number < 13 AND round = 15
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDa...
Number of unique users with accept answers for tagslike.
SELECT COUNT(DISTINCT Posts.OwnerUserId) FROM Posts, PostTags, Tags WHERE Posts.PostTypeId = 2 AND Posts.Id IN (SELECT Posts.AcceptedAnswerId FROM Posts, PostTags, Tags WHERE Posts.PostTypeId = 1 AND Posts.Id = PostTags.PostId AND PostTags.TagId = Tags.Id AND Tags.TagName LIKE '%##TagName##%')
CREATE TABLE table_36697 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text, "TV Time" text )
What was the TV time for the road game against Phoenix where the score was 98-99?
SELECT "TV Time" FROM table_36697 WHERE "Home Team" = 'phoenix' AND "Result" = '98-99'
CREATE TABLE table_203_88 ( id number, "language" text, "number" number, "percentage (%)" number, "males" number, "females" number )
what is the highest percentage of speakers other than polish ?
SELECT "language" FROM table_203_88 WHERE "language" <> 'polish' ORDER BY "percentage (%)" DESC LIMIT 1
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) 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 EMPLOYEE ( EMP_NUM int, ...
Show the number of courses for each course description in a stacked bar chart The x-axis is course description and group by instructor's name, rank CRS_DESCRIPTION in asc order.
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY EMP_FNAME, CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
Visualize the average experience working length of journalists working on different role type using a bar chart.
SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type
CREATE TABLE table_42469 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
What is the Position for Orlando for 1989 1999?
SELECT "Position" FROM table_42469 WHERE "Years in Orlando" = '1989–1999'
CREATE TABLE Project_outcomes ( outcome_code VARCHAR )
How many Patent outcomes are generated from all the projects?
SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent'
CREATE TABLE table_204_530 ( id number, "type" text, "stage" number, "cyclist" text, "team" text, "reason" text )
how many people withdrew in the 4th stage ?
SELECT COUNT("type") FROM table_204_530 WHERE "stage" = 4
CREATE TABLE table_name_6 ( position INTEGER, points VARCHAR, bike_no VARCHAR, driver___passenger VARCHAR )
What is the lowest Postion, when Bike No is greater than 10, when Driver / Passenger is Nicky Pulinx / Ondrej Cermak, and when Points is greater than 244?
SELECT MIN(position) FROM table_name_6 WHERE bike_no > 10 AND driver___passenger = "nicky pulinx / ondrej cermak" AND points > 244
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, ...
tell me the minimum cost of a hospital that involved pancreatitis - relapsing last year?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'pancreatitis - relapsing')) AND DATETIME(cos...
CREATE TABLE table_204_467 ( id number, "date" text, "opponents" text, "h/a" text, "result\nf-a" text, "scorers" text, "attendance" number )
what was the difference in score on january 2 1922 ?
SELECT ABS("result\nf-a" - "result\nf-a") FROM table_204_467 WHERE "date" = '2 january 1922'
CREATE TABLE table_name_12 ( driver VARCHAR, grid VARCHAR )
Which driver drove in grid 19?
SELECT driver FROM table_name_12 WHERE grid = 19
CREATE TABLE table_9647 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text )
What is Round, when Method is 'submission (reverse armbar)'?
SELECT "Round" FROM table_9647 WHERE "Method" = 'submission (reverse armbar)'
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is lab test name of subject id 19187?
SELECT lab.label FROM lab WHERE lab.subject_id = "19187"
CREATE TABLE table_203_394 ( id number, "title" text, "author" text, "date" number, "length\n(first edition)" text )
who authored the least number of titles ?
SELECT "author" FROM table_203_394 GROUP BY "author" ORDER BY COUNT("title") LIMIT 1
CREATE TABLE table_30557 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Which team drafted a player from HC Slavia Praha (Czechoslovakia)?
SELECT "NHL team" FROM table_30557 WHERE "College/junior/club team" = 'HC Slavia Praha (Czechoslovakia)'
CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty...
Find the first names of the faculty members who participate in Canoeing and Kayaking.
SELECT T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T2.actid = T2.actid WH...
CREATE TABLE Catalog_Contents_Additional_Attributes ( catalog_entry_id INTEGER, catalog_level_number INTEGER, attribute_id INTEGER, attribute_value VARCHAR(255) ) CREATE TABLE Catalog_Contents ( catalog_entry_id INTEGER, catalog_level_number INTEGER, parent_entry_id INTEGER, previous_en...
Visualize a bar chart for what are the name and level of catalog structure with level number between 5 and 10, and I want to list in ascending by the y axis.
SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_number
CREATE TABLE table_203_269 ( id number, "season" text, "competition" text, "round" text, "club" text, "home" text, "away" text, "aggregate" text )
who had the least aggregate wins ?
SELECT "club" FROM table_203_269 ORDER BY "aggregate" LIMIT 1
CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE enzyme ( id number, name text, location text, product text, chromosom...
How many medicines were not approved by the FDA?
SELECT COUNT(*) FROM medicine WHERE fda_approved = 'No'
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline...
i'd like a flight from COLUMBUS to PHOENIX stopping in CINCINNATI and serving DINNER what 's available
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop, food_service WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'CINCINN...
CREATE TABLE table_name_47 ( result VARCHAR, attendance VARCHAR )
What was the result of the game that was attended by 16,000 people?
SELECT result FROM table_name_47 WHERE attendance = "16,000"
CREATE TABLE department ( dept_name text, building text, budget number ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE takes ( id text, course_id text, sec_id text, s...
What is the year and semester with the most courses?
SELECT semester, year FROM section GROUP BY semester, year ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_2593 ( "Year" text, "Day" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
What was the report for the Sunday race where the winner had an average speed of 128.27 mph?
SELECT "Report" FROM table_2593 WHERE "Day" = 'Sunday' AND "Average Speed (mph)" = '128.27'
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...
Count the number of patients whose diagnosis short title is ocl crtd art without infrct that have a lab test abnormal status of delta.
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.short_title = "Ocl crtd art wo infrct" AND lab.flag = "delta"
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...
among patients diagnosed with poison-drug/medicin nec, how many of them were married?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "Poison-drug/medicin NEC"
CREATE TABLE table_name_43 ( championship VARCHAR, margin VARCHAR )
Which championship had a margin of 10 strokes?
SELECT championship FROM table_name_43 WHERE margin = "10 strokes"
CREATE TABLE table_name_21 ( player VARCHAR, total_reb VARCHAR, fg_pct VARCHAR, def_reb VARCHAR )
Which player has a FG Pct less than 45.9, a def reb less than 43, and a total reb of 9?
SELECT player FROM table_name_21 WHERE fg_pct < 45.9 AND def_reb < 43 AND total_reb = 9
CREATE TABLE table_49754 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
what is the iata for malta international airport?
SELECT "IATA" FROM table_49754 WHERE "Airport" = 'malta international airport'
CREATE TABLE table_name_98 ( score VARCHAR, date VARCHAR )
Can you tell me the Score that has the Date of 11/17/1979?
SELECT score FROM table_name_98 WHERE date = "11/17/1979"
CREATE TABLE table_201_36 ( id number, "year" number, "title" text, "role" text, "notes" text )
which film has their role under igiyook ?
SELECT "title" FROM table_201_36 WHERE "role" = 'igiyook'
CREATE TABLE table_63706 ( "Year" real, "Baden" text, "W\u00fcrttemberg" text, "Nordbayern" text, "S\u00fcdbayern" text )
What's the Nordbayern with a W rttemberg of Union B ckingen in the year before 1932?
SELECT "Nordbayern" FROM table_63706 WHERE "Year" < '1932' AND "W\u00fcrttemberg" = 'union böckingen'
CREATE TABLE table_name_82 ( floors INTEGER, name VARCHAR )
What is the lowest number of floors recorded for buildings built by Dubai Marriott Harbour Hotel & Suites?
SELECT MIN(floors) FROM table_name_82 WHERE name = "dubai marriott harbour hotel & suites"
CREATE TABLE table_name_26 ( fate VARCHAR, ship VARCHAR )
What is the fate for the Bremen ship?
SELECT fate FROM table_name_26 WHERE ship = "bremen"
CREATE TABLE table_24425976_2 ( episode_title VARCHAR, production_code VARCHAR )
What is the name of the episode with a production code of 107?
SELECT episode_title FROM table_24425976_2 WHERE production_code = "107"
CREATE TABLE table_4558 ( "Actor/actress" text, "Character" text, "Rank" text, "Tenure" text, "Episodes" text )
What character did actor Damien Richardson play?
SELECT "Character" FROM table_4558 WHERE "Actor/actress" = 'damien richardson'
CREATE TABLE table_13677808_1 ( technology VARCHAR, rank VARCHAR )
How many times is denmark ranked in technology?
SELECT COUNT(technology) FROM table_13677808_1 WHERE rank = "Denmark"
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the average of code , and group by attribute name, and could you show by the Name in ascending please?
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
CREATE TABLE table_47271 ( "Name" text, "Years" text, "League" real, "Scottish Cup" real, "League Cup" real, "Europe" real, "Total" real )
Which Scottish Cup has a League smaller than 561, Years of 1989 1995 1997 2001, and Europe smaller than 11?
SELECT COUNT("Scottish Cup") FROM table_47271 WHERE "League" < '561' AND "Years" = '1989–1995 1997–2001' AND "Europe" < '11'
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, ...
how many patients had coronary arteriogram nec on urgent admission?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Coronary arteriogram NEC"
CREATE TABLE table_16088 ( "Character" text, "Australia & New Zealand (Sydney - first run, Melbourne, Auckland)" text, "London" text, "Toronto / Broadway" text, "Brazil" text, "UK Tour" text, "US Tour" text, "Italy (Milan, Rome, Trieste)" text )
How many characters is by Babs Rubenstein?
SELECT COUNT("London") FROM table_16088 WHERE "US Tour" = 'Babs Rubenstein'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepi...
count the number of patients who received a electrolyte administration - intravenous procedure during the same month following a diagnosis of acute coronary syndrome since 3 years ago.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute coronary syndrome' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year')) AS t1...
CREATE TABLE table_66003 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
who is the athlete with the rank smaller than 2?
SELECT "Athlete" FROM table_66003 WHERE "Rank" < '2'
CREATE TABLE table_name_38 ( high_schools INTEGER, cemeteries VARCHAR )
How many High schools in the Region with 8 Cemeteries?
SELECT SUM(high_schools) FROM table_name_38 WHERE cemeteries = 8
CREATE TABLE table_68538 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Who was the opponent when the loss was Wells (4-7)?
SELECT "Opponent" FROM table_68538 WHERE "Loss" = 'wells (4-7)'
CREATE TABLE table_name_38 ( reference VARCHAR, strain VARCHAR )
what is the reference when the strain is msb8?
SELECT reference FROM table_name_38 WHERE strain = "msb8"
CREATE TABLE table_26131 ( "Election Year" real, "Assembly" text, "Winning Party/Coalition" text, "Chief Minister" text, "Speaker" text )
What is the name of the speaker if the chief minister is M.G. Ramachandran?
SELECT "Speaker" FROM table_26131 WHERE "Chief Minister" = 'M.G. Ramachandran'
CREATE TABLE table_203_290 ( id number, "game" number, "date" text, "opponent" text, "location" text, "score" text, "ot" text, "attendance" number, "record" text )
how many games did they win in 2009 ?
SELECT COUNT("game") FROM table_203_290 WHERE "score" = 'w'
CREATE TABLE table_1595 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text )
at area 191.43 what is the total number of census ranking?
SELECT COUNT("Census Ranking") FROM table_1595 WHERE "Area km 2" = '191.43'
CREATE TABLE table_name_79 ( competition VARCHAR, final_score VARCHAR )
what is the competition that had a final score of 6:5?
SELECT competition FROM table_name_79 WHERE final_score = "6:5"
CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Nu...
Draw a bar chart for how many storms occured in each region?, and show bars from low to high order.
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY Region_name
CREATE TABLE table_name_31 ( district VARCHAR, college_or_campus_name VARCHAR )
What District has a College or Campus Name of anna university college of engineering kanchipuram?
SELECT district FROM table_name_31 WHERE college_or_campus_name = "anna university college of engineering kanchipuram"
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE S...
Do Higher bounties lead to faster answers?.
WITH FirstAnswers AS (SELECT p.Id AS PostID, MIN(a.CreationDate) AS FirstAnswerDate FROM Posts AS p LEFT JOIN Posts AS a ON a.ParentId = p.Id WHERE p.PostTypeId = 1 GROUP BY p.Id) SELECT BountyAmount /* count(*) BountyCount, */, AVG(CAST((JULIANDAY(FirstAnswerDate) - JULIANDAY(v.CreationDate)) AS INT)) AS AvgMinutesToA...
CREATE TABLE table_name_30 ( score VARCHAR, february VARCHAR, game VARCHAR )
What was the score after february 4 in the game 61?
SELECT score FROM table_name_30 WHERE february > 4 AND game = 61
CREATE TABLE table_name_72 ( away_team VARCHAR, venue VARCHAR )
What team was the away team at Arden Street Oval?
SELECT away_team FROM table_name_72 WHERE venue = "arden street oval"
CREATE TABLE table_1721 ( "Player" text, "League" real, "Scottish Cup" real, "League Cup" real, "Challenge Cup" real, "Total" real )
Name the total number of league cup for mark roberts
SELECT COUNT("League Cup") FROM table_1721 WHERE "Player" = 'Mark Roberts'
CREATE TABLE table_70895 ( "Year" text, "Category" text, "Genre" text, "Recording" text, "Result" text )
Name the recording for 2012
SELECT "Recording" FROM table_70895 WHERE "Year" = '2012'
CREATE TABLE ref_document_types ( document_type_code text, document_type_description text ) CREATE TABLE addresses ( address_id number, address_details text ) CREATE TABLE ref_shipping_agents ( shipping_agent_code text, shipping_agent_name text, shipping_agent_description text ) CREATE TA...
How many employees do we have?
SELECT COUNT(*) FROM employees
CREATE TABLE table_name_9 ( year VARCHAR, open_cup VARCHAR )
How many years did Real Colorado Foxes make it to the Open Cup 1st Round?
SELECT COUNT(year) FROM table_name_9 WHERE open_cup = "1st round"
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text )
A scatter chart shows the correlation between Body_Builder_ID and Clean_Jerk .
SELECT Body_Builder_ID, Clean_Jerk FROM body_builder
CREATE TABLE table_name_79 ( set_3 VARCHAR, date VARCHAR, set_1 VARCHAR )
What is the Set 3 on 30 may, and a Set 1 is 20 25?
SELECT set_3 FROM table_name_79 WHERE date = "30 may" AND set_1 = "20–25"
CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, departm...
Give the maximum product price for each product type in a bar chart, sort by the y axis from low to high.
SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY MAX(product_price)
CREATE TABLE player_college ( player_id text, college_id text, year number ) CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots number, needed number, votes number, inducted text, category text, needed_note text ) CREATE TABLE team ( ye...
How many times in total did the team Boston Red Stockings participate in postseason games?
SELECT COUNT(*) FROM (SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings')
CREATE TABLE table_39780 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Which method led to a record of 9-4?
SELECT "Method" FROM table_39780 WHERE "Record" = '9-4'
CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Students ( student_id I...
Return a bar chart about the distribution of date_address_to and the amount of date_address_to bin date_address_to by weekday.
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses ORDER BY monthly_rental DESC
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Would taking EECS 695 be easier or would taking EECS 499 be easier ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 695 OR course.number = 499) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
CREATE TABLE table_58030 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
In which year was the Tournament of european indoor championships played where the Extra was 800 m and the Result was 2nd?
SELECT "Year" FROM table_58030 WHERE "Extra" = '800 m' AND "Tournament" = 'european indoor championships' AND "Result" = '2nd'
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId n...
What are the vote types?.
SELECT * FROM VoteTypes
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...
how many patients have stayed in the hospital for more than 3 days with a drug name phenylephrine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "3" AND prescriptions.drug = "PHENYLEPHrine"
CREATE TABLE table_name_79 ( player VARCHAR, position VARCHAR, year_born VARCHAR )
What player is a center born in 1977?
SELECT player FROM table_name_79 WHERE position = "center" AND year_born = 1977
CREATE TABLE table_24153 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
What was the court surface on year 1971?
SELECT "Surface" FROM table_24153 WHERE "Year" = '1971'
CREATE TABLE table_12264 ( "Draft" real, "Round" text, "Pick" real, "Player" text, "Nationality" text )
What is the pick for round 8 with a USA nationality in the 2000 draft?
SELECT "Pick" FROM table_12264 WHERE "Round" = '8' AND "Nationality" = 'usa' AND "Draft" = '2000'
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal bool...
Mining for evidence of Jon Skeet 'bias'..
WITH rankScores AS (SELECT p.ParentId, p.Id, p.OwnerUserId, parent.AcceptedAnswerId, RANK() OVER (PARTITION BY p.ParentId ORDER BY p.Score DESC) AS Rank FROM Posts AS p INNER JOIN Posts AS parent ON p.ParentId = parent.Id WHERE p.PostTypeId = 2 LIMIT 10000) SELECT SUM(CASE WHEN Rank = 1 AND NOT AcceptedAnswerId IS NULL...
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 Votes ( Id number, PostId number, VoteTypeId nu...
Total Posts by Programming Languages Per Month - 2015.
SELECT COUNT(*) AS PostCount, T.TagName, YEAR(P.CreationDate) FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE YEAR(P.CreationDate) > 2014 AND P.CreationDate < '2015-12-01' AND NOT TagName LIKE '%rails%' GROUP BY YEAR(P.CreationDate), T.TagName HAVING COUNT...
CREATE TABLE table_24540893_6 ( position VARCHAR, school VARCHAR )
What position does the player from kent state play?
SELECT position FROM table_24540893_6 WHERE school = "Kent State"
CREATE TABLE table_17911 ( "Year" real, "Delaware" text, "Maryland" text, "New Jersey" text, "New York" text, "Pennsylvania" text, "Washington, D.C." text )
After the year 2008.0, who played for Maryland the same year M.O.T. LL Middletown played in Delaware?
SELECT "Maryland" FROM table_17911 WHERE "Delaware" = 'M.O.T. LL Middletown' AND "Year" > '2008.0'
CREATE TABLE table_67344 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
What is the highest points total scored by Dan Clarke in a grid higher than 10?
SELECT MAX("Points") FROM table_67344 WHERE "Driver" = 'dan clarke' AND "Grid" > '10'
CREATE TABLE city ( City_ID int, County_ID int, Name text, White real, Black real, Amerindian real, Asian real, Multiracial real, Hispanic real ) CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_offi...
What is the number of cities in each country? Return a bar chart, I want to sort from high to low by the y-axis please.
SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name ORDER BY COUNT(T2.Name) DESC
CREATE TABLE table_28209 ( "Celebrity" text, "Known for" text, "Age" real, "Professional" text, "Series" real, "Place" text, "Dances" real, "Highest score" real, "Lowest score" real, "Aggregate" real, "Average" text )
What was the aggregate for the celebrity who was known for being a singer and had 7 dances?
SELECT "Aggregate" FROM table_28209 WHERE "Dances" = '7' AND "Known for" = 'Singer'
CREATE TABLE table_22171978_1 ( athletic_nickname VARCHAR, location VARCHAR )
For the location of quezon city , metro manila what is the athletic nickname?
SELECT athletic_nickname FROM table_22171978_1 WHERE location = "Quezon City , Metro Manila"
CREATE TABLE table_1696 ( "Year" real, "Total" text, "Less than a year" real, "One year" real, "Two years" real, "Three years" real, "Four years" real, "5\u20139 years" real, "10\u201314 years" real, "15\u201319 years" real, "20\u201324 years" real, "25 and more" real, ...
If unknown is larger than 1.0, what is the maximum two year amount?
SELECT MAX("Two years") FROM table_1696 WHERE "Unknown" > '1.0'
CREATE TABLE table_name_8 ( gold VARCHAR, bronze VARCHAR, total VARCHAR )
How many golds were there in a game that has 17 bronze and a total of 31?
SELECT gold FROM table_name_8 WHERE bronze = "17" AND total = "31"
CREATE TABLE table_name_20 ( city VARCHAR )
What place is listed in the 2002-2003 season for the City of Aveiro?
SELECT 2002 AS _2003_season FROM table_name_20 WHERE city = "aveiro"
CREATE TABLE table_40572 ( "Name" text, "Rank" real, "Out of" real, "Source" text, "Year" text )
Which Name had a Rank of 18 Out of a number smaller than 149?
SELECT "Name" FROM table_40572 WHERE "Out of" < '149' AND "Rank" = '18'
CREATE TABLE table_20411 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
Name the total number when date is 30 may 2010
SELECT COUNT("No.") FROM table_20411 WHERE "Date" = '30 May 2010'
CREATE TABLE table_61211 ( "Date" text, "Series" text, "Circuit" text, "City / State" text, "Winner" text, "Team" text )
Which team won at winton motor raceway?
SELECT "Team" FROM table_61211 WHERE "Circuit" = 'winton motor raceway'
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate tim...
how many times patient 32160 had visited the hospital?
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 32160
CREATE TABLE table_50858 ( "Internet Plan" text, "Downstream" text, "Upstream" text, "Bandwidth Included" text, "Price" text )
What is Upstream, when Price is '14 EUR'?
SELECT "Upstream" FROM table_50858 WHERE "Price" = '14 eur'
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Count the job title of all people using a pie chart.
SELECT job, COUNT(job) FROM Person GROUP BY job
CREATE TABLE table_26842217_16 ( broadcast VARCHAR, home_team VARCHAR )
On what network was the Kentucky game broadcast?
SELECT broadcast FROM table_26842217_16 WHERE home_team = "Kentucky"
CREATE TABLE table_name_12 ( bubbles VARCHAR, attribute VARCHAR )
Name the bubbles for onscroll
SELECT bubbles FROM table_name_12 WHERE attribute = "onscroll"
CREATE TABLE table_2603017_2 ( bb___blind_bear VARCHAR, ba___running_bear VARCHAR )
what is bb - blind bear where ba - running bear is mf - mountain falcon?
SELECT bb___blind_bear FROM table_2603017_2 WHERE ba___running_bear = "MF - Mountain Falcon"
CREATE TABLE table_204_794 ( id number, "iec\nworld plugs\nType" text, "standard" text, "power\nrating" text, "earthed" text, "polarised" text, "fused" text, "insulated\npins" text, "europlug\ncompatible" text )
how many are europlug compatible -lrb- yes -rrb- ?
SELECT COUNT(*) FROM table_204_794 WHERE "europlug\ncompatible" = 'yes'
CREATE TABLE table_name_23 ( investment_earnings VARCHAR, total_revenue VARCHAR )
What were the investment earnings in a year when total revenue was $21,779,618?
SELECT investment_earnings FROM table_name_23 WHERE total_revenue = "21,779,618"
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Return a bar chart about the distribution of Team_Name and School_ID , list by the Y in desc.
SELECT Team_Name, School_ID FROM basketball_match ORDER BY School_ID DESC
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 ) ...
what is admission time and diagnoses short title of subject name paul edwards?
SELECT demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Paul Edwards"
CREATE TABLE table_7558 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the Score of the game with a Record of 12 12?
SELECT "Score" FROM table_7558 WHERE "Record" = '12–12'
CREATE TABLE table_name_8 ( player VARCHAR, school_club_team VARCHAR )
Who is the player who went to Stanford?
SELECT player FROM table_name_8 WHERE school_club_team = "stanford"