answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
SELECT COUNT(international_freight) FROM table_1754531_4 WHERE domestic_mail = 260 | Name the number of international frieghts for domestic mail of 260 | CREATE TABLE table_1754531_4 (international_freight VARCHAR, domestic_mail VARCHAR) |
SELECT fname, lname FROM student WHERE major <> (SELECT major FROM student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1) | Find the first and last name of students who are not in the largest major. | CREATE TABLE student (fname VARCHAR, lname VARCHAR, major VARCHAR) |
SELECT SUM(erp_w) FROM table_name_5 WHERE call_sign = "k222al" | What is the sum of the erp w of the k222al call sign? | CREATE TABLE table_name_5 (
erp_w INTEGER,
call_sign VARCHAR
) |
SELECT COUNT(domestic_mail) FROM table_1754531_4 WHERE total_freight_and_mail = 7853 | Name the total number of domestic mail for 7853 for total frieght and mail | CREATE TABLE table_1754531_4 (domestic_mail VARCHAR, total_freight_and_mail VARCHAR) |
SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex | Find the number of students whose age is older than the average age for each gender. | CREATE TABLE student (sex VARCHAR, age INTEGER) |
SELECT p.Id AS "post_link", 'site://posts/' + CAST(p.Id AS TEXT) + '/edit|' + 'Edit' AS "edit_link", p.OwnerUserId AS "user_link", p.CreationDate FROM Posts AS p, PostHistory AS ph WHERE ph.PostId = p.Id AND ph.PostHistoryTypeId IN (2, 5, 8) AND NOT EXISTS(SELECT * FROM PostHistory AS phtwo WHERE phtwo.PostId = p.Id AN... | \\ bug query on markdown. with bits stolen from http://data.stackexchange.com/stackoverflow/query/494264/longest-answers-by-markdown | 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 VoteTypes (
Id number,
Name text
)
CREATE TABLE Po... |
SELECT COUNT(domestic_freight) FROM table_1754531_4 WHERE international_mail > 1.0 AND domestic_mail = 260 | Namw the total number for domestic freight for international mail is larger than 1.0 with domestic mail for 260 | CREATE TABLE table_1754531_4 (domestic_freight VARCHAR, international_mail VARCHAR, domestic_mail VARCHAR) |
SELECT AVG(T1.age), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name | Find the average age of students living in each dorm and the name of dorm. | CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Intraoperative cardiac pacemaker" AND lab."CATEGORY" = "Chemistry" | provide the number of patients whose procedure long title is intraoperative cardiac pacemaker and lab test category is chemistry? | 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 MAX(others_number) FROM table_1756284_1 | What was the highest vote for others? | CREATE TABLE table_1756284_1 (others_number INTEGER) |
SELECT COUNT(*), T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid | Find the number of amenities for each of the dorms that can accommodate more than 100 students. | CREATE TABLE dorm (dormid VARCHAR, student_capacity INTEGER); CREATE TABLE has_amenity (dormid VARCHAR) |
SELECT "company (country)" FROM table_204_681 WHERE "arms sales as share of company's total sales (%)," < 10 | which is the only company to have under 10 % arms sales as share of company 's total sales ? | CREATE TABLE table_204_681 (
id number,
"2011 rank" number,
"2010 rank" number,
"2009 rank" number,
"2008 rank" number,
"2007 rank" number,
"company (country)" text,
"2011 arms sales (us$ m.)" number,
"2010 arms sales (us$ m.)" number,
"2009 arms sales (us$ m.)" number,
"2008... |
SELECT kerry_percentage FROM table_1756284_1 WHERE kerry_number = 199060 | When Kerry# was 199060, what was the percentage? | CREATE TABLE table_1756284_1 (kerry_percentage VARCHAR, kerry_number VARCHAR) |
SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name | Find the number of students who is older than 20 in each dorm. | CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (stuid VARCHAR, age INTEGER) |
SELECT MAX("Goal Difference") FROM table_14735 WHERE "Points" = '33-5' AND "Wins" < '12' | What is the highest goal difference that the club with 33-5 points and less than 12 wins? | CREATE TABLE table_14735 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) |
SELECT MAX(bush_number) FROM table_1756284_1 | What was the highest vote number for Bush? | CREATE TABLE table_1756284_1 (bush_number INTEGER) |
SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' | Find the first name of students who are living in the Smith Hall. | CREATE TABLE student (fname VARCHAR, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR) |
SELECT MIN(lost) FROM table_21991074_3 | Name the least lost | CREATE TABLE table_21991074_3 (
lost INTEGER
) |
SELECT COUnT AS transfer_window FROM table_17596418_4 WHERE moving_from = "Crystal palace" | How many transfer windows coming from Crystal Palace? | CREATE TABLE table_17596418_4 (COUnT VARCHAR, moving_from VARCHAR) |
SELECT AVG(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.student_capacity = (SELECT MAX(student_capacity) FROM dorm) | Find the average age of students who are living in the dorm with the largest capacity. | CREATE TABLE dorm (student_capacity INTEGER); CREATE TABLE student (age INTEGER, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, student_capacity INTEGER) |
SELECT MAX(goals) FROM table_name_91 WHERE minutes = 2428 | What was the highest number of goals when 2428 minutes were played? | CREATE TABLE table_name_91 (
goals INTEGER,
minutes VARCHAR
) |
SELECT country FROM table_17596418_4 WHERE p = "GK" | What country has a P of GK? | CREATE TABLE table_17596418_4 (country VARCHAR, p VARCHAR) |
SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M' | Find the total number of students living in the male dorm (with gender M). | CREATE TABLE dorm (dormid VARCHAR, gender VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (stuid VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "C-Reactive Protein" | provide the number of patients whose insurance is self pay and lab test name is c-reactive protein? | 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... |
SELECT p FROM table_17596418_4 WHERE moving_from = "Everton" | What is the P for the player moving from Everton? | CREATE TABLE table_17596418_4 (p VARCHAR, moving_from VARCHAR) |
SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F' | Find the number of female students (with F sex) living in Smith Hall | CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (stuid VARCHAR, sex VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR) |
SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team | Draw a pie chart for what are the proportion of the teams in elimination? | CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
) |
SELECT competition FROM table_17594659_1 WHERE opposition = "Panathinaikos" | Name the competition of panathinaikos | CREATE TABLE table_17594659_1 (competition VARCHAR, opposition VARCHAR) |
SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' | Find the name of amenities Smith Hall dorm have. | CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR) |
SELECT MIN("Miss United Continent") FROM table_21792 | What is the least number of miss united continents? | CREATE TABLE table_21792 (
"Rank" real,
"Country" text,
"Miss United Continent" real,
"Virreina" real,
"1st RU" real,
"2nd RU" real,
"3rd RU" real,
"4th RU" real,
"Semifinalists" real,
"Total" real
) |
SELECT viewers__in_millions_ FROM table_175980_2 WHERE ranking = "#51" AND timeslot = "Tuesday 9:00 p.m." | What is every value for viewers for ranking #51 for the Tuesday 9:00 p.m. timeslot? | CREATE TABLE table_175980_2 (viewers__in_millions_ VARCHAR, ranking VARCHAR, timeslot VARCHAR) |
SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name | Find the name of amenities Smith Hall dorm have. ordered the results by amenity names. | CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR); CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR) |
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 18726 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | what is patient 18726's insurance plan in the last hospital encounter. | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... |
SELECT finale FROM table_175980_2 WHERE timeslot = "Tuesday 9:30 p.m." | What finales took place in the Tuesday 9:30 p.m. timeslot? | CREATE TABLE table_175980_2 (finale VARCHAR, timeslot VARCHAR) |
SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1 | Find the name of amenity that is most common in all dorms. | CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR); CREATE TABLE has_amenity (amenid VARCHAR) |
SELECT MIN("GFR 2006") FROM table_70053 WHERE "Whites as % of Pop." = '95.80%' AND "TFR 2006" > '2.14' | What is the lowest total GFR that has 95.80% of the population as Whites, and a TFR total larger than 2.14, in 2006? | CREATE TABLE table_70053 (
"County" text,
"Live births 2006" real,
"GFR 2006" real,
"TFR 2006" real,
"Whites as % of Pop." text
) |
SELECT premiere FROM table_175980_2 WHERE finale = "May 25, 2004" | What premieres had a finale on May 25, 2004? | CREATE TABLE table_175980_2 (premiere VARCHAR, finale VARCHAR) |
SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY COUNT(*) DESC LIMIT 1) | Find the first name of students who are living in the dorm that has most number of amenities. | CREATE TABLE dorm_amenity (amenid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm (dormid VARCHAR); CREATE TABLE student (fname VARCHAR, stuid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR) |
SELECT "20 Questions" FROM table_20233 WHERE "Cover model" = 'Linda Brava' | Who was asked 20 questions in the issue where the cover model is Linda Brava? | CREATE TABLE table_20233 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
) |
SELECT season FROM table_175980_2 WHERE finale = "May 25, 2004" | What seasons had a finale on May 25, 2004? | CREATE TABLE table_175980_2 (season VARCHAR, finale VARCHAR) |
SELECT T1.dorm_name, T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY COUNT(*) LIMIT 1 | Find the name and capacity of the dorm with least number of amenities. | CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR); CREATE TABLE dorm (dorm_name VARCHAR, student_capacity VARCHAR, dormid VARCHAR) |
SELECT record FROM table_name_34 WHERE date = "october 11" | Name the record for october 11 | CREATE TABLE table_name_34 (
record VARCHAR,
date VARCHAR
) |
SELECT season FROM table_175980_2 WHERE ranking = "#47" | What seasons had a ranking of #47? | CREATE TABLE table_175980_2 (season VARCHAR, ranking VARCHAR) |
SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' | Find the name of dorms that do not have amenity TV Lounge. | CREATE TABLE dorm (dorm_name VARCHAR, dormid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm (dorm_name VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR) |
SELECT * FROM table_train_256 WHERE language = 'english' OR language = 'spanish' | english ( wumc ) or spanish speaking ( dh ) | CREATE TABLE table_train_256 (
"id" int,
"mini_mental_state_examination_mmse" int,
"language" string,
"mild_cognitive_impairment" bool,
"moca_score" int,
"dementia" bool,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) |
SELECT viewers__in_millions_ FROM table_175980_2 WHERE season = "1st" | What are all values for viewers for 1st season? | CREATE TABLE table_175980_2 (viewers__in_millions_ VARCHAR, season VARCHAR) |
SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') | Find the first and last name of students who are living in the dorms that have amenity TV Lounge. | CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE student (fname VARCHAR, lname VARCHAR, stuid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR) |
SELECT visitor FROM table_name_98 WHERE decision = "osgood" AND home = "edmonton" | Who was the visiting team at the game where Edmonton was the home team and the decision was Osgood? | CREATE TABLE table_name_98 (
visitor VARCHAR,
decision VARCHAR,
home VARCHAR
) |
SELECT date_withdrawn FROM table_17607663_1 WHERE secr_no = 771 | What is the withdraw date for secr no. 771? | CREATE TABLE table_17607663_1 (date_withdrawn VARCHAR, secr_no VARCHAR) |
SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') | Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge. | CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE student (fname VARCHAR, age VARCHAR, stuid VARCHAR); CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR); CREATE TABLE dorm_amenity (amenid VARCHAR, amenity_name VARCHAR) |
SELECT COUNT(first_elected) FROM table_25030512_4 WHERE district = "Alabama 3" | Name the first elected for alabama 3 | CREATE TABLE table_25030512_4 (
first_elected VARCHAR,
district VARCHAR
) |
SELECT builder FROM table_17607663_1 WHERE br_no = 31779 | Who is the builder for br no. 31779? | CREATE TABLE table_17607663_1 (builder VARCHAR, br_no VARCHAR) |
SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith' | Find the name of amenities of the dorm where the student with last name Smith is living in. | CREATE TABLE student (stuid VARCHAR, lname VARCHAR); CREATE TABLE dorm (dormid VARCHAR); CREATE TABLE lives_in (dormid VARCHAR, stuid VARCHAR); CREATE TABLE has_amenity (dormid VARCHAR, amenid VARCHAR); CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR) |
SELECT COUNT(matches) FROM table_name_24 WHERE runs < 6106 AND inns < 146 | Runs smaller than 6106, and Inns smaller than 146 has what total number of matches? | CREATE TABLE table_name_24 (
matches VARCHAR,
runs VARCHAR,
inns VARCHAR
) |
SELECT country FROM table_17596418_5 WHERE loan_club = "Fulham" | what ist he country where the loan club is fulham? | CREATE TABLE table_17596418_5 (country VARCHAR, loan_club VARCHAR) |
SELECT email_address, phone_number FROM customers ORDER BY email_address, phone_number | Find the emails and phone numbers of all the customers, ordered by email address and phone number. | CREATE TABLE customers (email_address VARCHAR, phone_number VARCHAR) |
SELECT "Date" FROM table_53520 WHERE "Home team score" = '22.15 (147)' AND "Away team score" = '9.8 (62)' | On which date was the game where the home teams score was 22.15 (147), and the away teams score was 9.8 (62) | CREATE TABLE table_53520 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) |
SELECT COUNT(age) FROM table_17596418_5 WHERE started = "6 November" | what ist he total number of ages where the start date is 6 november? | CREATE TABLE table_17596418_5 (age VARCHAR, started VARCHAR) |
SELECT town_city FROM customers WHERE customer_type_code = "Good Credit Rating" GROUP BY town_city ORDER BY COUNT(*) LIMIT 1 | Which city has the least number of customers whose type code is "Good Credit Rating"? | CREATE TABLE customers (town_city VARCHAR, customer_type_code VARCHAR) |
SELECT "Year" FROM table_21480 WHERE "West Manila" = '6.5' | What was the year when West Manila has a tariff increase of 6.5? | CREATE TABLE table_21480 (
"Year" real,
"West Manila" text,
"East Manila" text,
"Consumer Price Index (2005=100)" text,
"West Manila as a share of 1996 real tariff" text,
"East Manila as a share of 1996 real tariff" text
) |
SELECT title FROM table_17624965_1 WHERE production_code = 618 | What was the name of eipsode 618? | CREATE TABLE table_17624965_1 (title VARCHAR, production_code VARCHAR) |
SELECT t1.product_name, COUNT(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name | List the name of all products along with the number of complaints that they have received. | CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE complaints (product_id VARCHAR) |
SELECT AVG("On-site ATMs") FROM table_43964 WHERE "Off-site ATMs" = '1567' AND "Total ATMs" < '4772' | What is the mean on-site ATMS that have off-site ATMs of 1567, and the total number of ATMs less than 4772? | CREATE TABLE table_43964 (
"Bank type" text,
"Number of branches" real,
"On-site ATMs" real,
"Off-site ATMs" real,
"Total ATMs" real
) |
SELECT COUNT(written_by) FROM table_17624965_1 WHERE directed_by = "Alison Maclean" | How many episodes did Alison Maclean direct? | CREATE TABLE table_17624965_1 (written_by VARCHAR, directed_by VARCHAR) |
SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) LIMIT 1 | Find the emails of customers who has filed a complaints of the product with the most complaints. | CREATE TABLE customers (email_address VARCHAR, customer_id VARCHAR); CREATE TABLE complaints (customer_id VARCHAR) |
SELECT "Date" FROM table_43536 WHERE "Away team" = 'aston villa' | What date is aston villa away? | CREATE TABLE table_43536 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) |
SELECT high_points FROM table_17622423_12 WHERE date = "May 29" | Name the high points for may 29 | CREATE TABLE table_17622423_12 (high_points VARCHAR, date VARCHAR) |
SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY COUNT(*) LIMIT 1 | Which products has been complained by the customer who has filed least amount of complaints? | CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE complaints (product_id VARCHAR) |
SELECT conv FROM table_name_39 WHERE pens = "0" AND tries = "0" | How many conversions had 0 pens and 0 tries? | CREATE TABLE table_name_39 (
conv VARCHAR,
pens VARCHAR,
tries VARCHAR
) |
SELECT date FROM table_17622423_12 WHERE series = "2-2" | Name the date for series 2-2 | CREATE TABLE table_17622423_12 (date VARCHAR, series VARCHAR) |
SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1 | What is the phone number of the customer who has filed the most recent complaint? | CREATE TABLE customers (phone_number VARCHAR, customer_id VARCHAR); CREATE TABLE complaints (customer_id VARCHAR, date_complaint_raised VARCHAR) |
SELECT Position, COUNT(*) FROM match_season GROUP BY Position | How many players played each position. Show a pie chart. | CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL tex... |
SELECT high_assists FROM table_17622423_12 WHERE date = "May 21" | Name the high assists for may 21 | CREATE TABLE table_17622423_12 (high_assists VARCHAR, date VARCHAR) |
SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints) | Find the email and phone number of the customers who have never filed a complaint before. | CREATE TABLE complaints (email_address VARCHAR, phone_number VARCHAR, customer_id VARCHAR); CREATE TABLE customers (email_address VARCHAR, phone_number VARCHAR, customer_id VARCHAR) |
SELECT score_in_final FROM table_name_21 WHERE date = "february 24, 2002" | What was the Final Score on February 24, 2002? | CREATE TABLE table_name_21 (
score_in_final VARCHAR,
date VARCHAR
) |
SELECT COUNT(play_by_play) FROM table_17628022_2 WHERE pregame_analysts = "Darren Flutie, Eric Tillman and Greg Frers" | How many different play-by-play announcers also had pregame analysis by Darren Flutie, Eric Tillman and Greg Frers? | CREATE TABLE table_17628022_2 (play_by_play VARCHAR, pregame_analysts VARCHAR) |
SELECT phone_number FROM customers UNION SELECT phone_number FROM staff | Find the phone number of all the customers and staff. | CREATE TABLE staff (phone_number VARCHAR); CREATE TABLE customers (phone_number VARCHAR) |
SELECT format FROM table_name_53 WHERE date = "february 14, 2002" | What is the format of the date February 14, 2002? | CREATE TABLE table_name_53 (
format VARCHAR,
date VARCHAR
) |
SELECT play_by_play FROM table_17628022_2 WHERE pregame_host = "Brian Williams" AND sideline_reporters = "Steve Armitage and Brenda Irving" | Who did the play-by-play when the pregame host was Brian Williams and the sideline reporters were Steve Armitage and Brenda Irving? | CREATE TABLE table_17628022_2 (play_by_play VARCHAR, pregame_host VARCHAR, sideline_reporters VARCHAR) |
SELECT product_description FROM products WHERE product_name = "Chocolate" | What is the description of the product named "Chocolate"? | CREATE TABLE products (product_description VARCHAR, product_name VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Severe sepsis" AND prescriptions.route = "PB" | count the number of patients who are diagnosed with severe sepsis and have pb route of drug administration. | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... |
SELECT pregame_host FROM table_17628022_2 WHERE sideline_reporters = "Steve Armitage and Brenda Irving" | Who were the pregame hosts when the sideline reporters were Steve Armitage and Brenda Irving? | CREATE TABLE table_17628022_2 (pregame_host VARCHAR, sideline_reporters VARCHAR) |
SELECT product_name, product_category_code FROM products ORDER BY product_price DESC LIMIT 1 | Find the name and category of the most expensive product. | CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR, product_price VARCHAR) |
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 138 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | what is an insurance plan for patient 138 in the first hospital visit? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_care... |
SELECT pregame_analysts FROM table_17628022_2 WHERE year = 2002 | Who did pregame analysis in 2002? | CREATE TABLE table_17628022_2 (pregame_analysts VARCHAR, year VARCHAR) |
SELECT product_price FROM products WHERE NOT product_id IN (SELECT product_id FROM complaints) | Find the prices of products which has never received a single complaint. | CREATE TABLE products (product_price VARCHAR, product_id VARCHAR); CREATE TABLE complaints (product_price VARCHAR, product_id VARCHAR) |
SELECT "2009" FROM table_61449 WHERE "2012" = 'lq' AND "2011" = '2r' AND "2008" = 'lq' | What is the 2009 value with lq in 2012, 2r in 2011, and lq in 2008? | CREATE TABLE table_61449 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) |
SELECT state FROM table_1762887_1 WHERE county = "Lake county" | Name the state for lake county | CREATE TABLE table_1762887_1 (state VARCHAR, county VARCHAR) |
SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code | What is the average price of the products for each category? | CREATE TABLE products (product_category_code VARCHAR, product_price INTEGER) |
SELECT DISTINCT * FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND a.DeletionDate IS NULL AND q.ClosedDate IS NULL AND q.AnswerCount >= '##numOfAnswers?1##' | [draft] Questions with no up-voted or down-voted answers. | CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
U... |
SELECT MIN(season) FROM table_17632217_1 | What is the lowest season? | CREATE TABLE table_17632217_1 (season INTEGER) |
SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price LIMIT 1 | Find the last name of the staff member who processed the complaint of the cheapest product. | CREATE TABLE products (product_id VARCHAR, product_price VARCHAR); CREATE TABLE complaints (staff_id VARCHAR, product_id VARCHAR); CREATE TABLE staff (last_name VARCHAR, staff_id VARCHAR) |
SELECT date FROM table_name_39 WHERE attendance = "45,122" | What was the date of the game attended by 45,122? | CREATE TABLE table_name_39 (
date VARCHAR,
attendance VARCHAR
) |
SELECT COUNT(number_of_clubs) FROM table_17632217_1 WHERE runners_up = "Shandong" | How many values for number of clubs have Shandong as the runner-up? | CREATE TABLE table_17632217_1 (number_of_clubs VARCHAR, runners_up VARCHAR) |
SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING COUNT(*) > 3 | Which complaint status has more than 3 records on file? | CREATE TABLE complaints (complaint_status_code VARCHAR) |
SELECT "song" FROM table_204_56 WHERE "year" = 1993 | what was the only single released in 1993 ? | CREATE TABLE table_204_56 (
id number,
"year" number,
"song" text,
"us r&b" number,
"us rap" number,
"album" text
) |
SELECT COUNT(total_wins) FROM table_17632217_1 WHERE runners_up = "Shanghai" | How many total wins with Shanghai as runner-up? | CREATE TABLE table_17632217_1 (total_wins VARCHAR, runners_up VARCHAR) |
SELECT last_name FROM staff WHERE email_address LIKE "%wrau%" | Find the last name of the staff whose email address contains "wrau". | CREATE TABLE staff (last_name VARCHAR, email_address VARCHAR) |
SELECT MAX(2 AS nd__m_) FROM table_name_14 WHERE rank > 2 AND points > 249.3 | What is the highest 2nd in (m) that has a Rank more than 2 and Points more than 249.3 | CREATE TABLE table_name_14 (
rank VARCHAR,
points VARCHAR
) |
SELECT club FROM table_17625749_1 WHERE tries_for = "32" | Name the club for when tries for is 32 | CREATE TABLE table_17625749_1 (club VARCHAR, tries_for VARCHAR) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.