answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID) DESC | 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, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday, and order in desc by the the average of department id. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... |
SELECT MIN(rnd) FROM table_16732659_2 WHERE date = "June 11" | ON JUNE 11, WHAT WAS THE NUMBER OF RNDS ? | CREATE TABLE table_16732659_2 (rnd INTEGER, date VARCHAR) |
SELECT AVG(age) FROM Person | What is the average age for all person? | CREATE TABLE Person (age INTEGER) |
SELECT date FROM table_name_39 WHERE catalog = "rr 8655-2" | What is the release Date of Catalog RR 8655-2? | CREATE TABLE table_name_39 (
date VARCHAR,
catalog VARCHAR
) |
SELECT MAX(rnd) FROM table_16732659_2 WHERE date = "August 13" | FOR AUGUST 13 WHAT IS THE RND ? | CREATE TABLE table_16732659_2 (rnd INTEGER, date VARCHAR) |
SELECT COUNT(DISTINCT city) FROM Person | How many different cities are they from? | CREATE TABLE Person (city VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.short_title = "Spinal tap" | how many patients stayed in hospital for more than 1 day and were procedured with spinal tap? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... |
SELECT race_name FROM table_16732659_2 WHERE rnd = 13 | PLEASE LIST ALL RACES WHERE THE RND IS 13. | CREATE TABLE table_16732659_2 (race_name VARCHAR, rnd VARCHAR) |
SELECT COUNT(DISTINCT job) FROM Person | How many type of jobs do they have? | CREATE TABLE Person (job VARCHAR) |
SELECT 'site://users/' + CAST(u.Id AS VARCHAR) + '|' + CAST(u.DisplayName AS VARCHAR) AS "user", SUM(p.Score) AS "Total Score", u.Reputation, u.LastAccessDate FROM Users AS u, Posts AS p WHERE u.Reputation >= @Repmin AND u.Reputation <= @Repmax AND u.Id = p.OwnerUserId AND p.PostTypeId = 1 AND DATEDIFF(day, u.LastAcces... | Users with at least one post in a reputation bracket. | CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CRE... |
SELECT COUNT(rank_07_11) FROM table_167354_2 WHERE world_ranking = "4" | How many figures are there for Rank 07-11 when the world ranking is 4? | CREATE TABLE table_167354_2 (rank_07_11 VARCHAR, world_ranking VARCHAR) |
SELECT name FROM Person WHERE age = (SELECT MAX(age) FROM person) | Who is the oldest person? | CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, age INTEGER) |
SELECT demographic.age, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" | tell me the age and lab test abnormal status for patient with patient id 2560. | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... |
SELECT COUNT(pubs_2011) FROM table_167354_2 WHERE location = "Chennai" | How many figures are given for pubs 2011 in Chennai? | CREATE TABLE table_167354_2 (pubs_2011 VARCHAR, location VARCHAR) |
SELECT name FROM Person WHERE job = 'student' AND age = (SELECT MAX(age) FROM person WHERE job = 'student') | Who is the oldest person whose job is student? | CREATE TABLE person (name VARCHAR, job VARCHAR, age INTEGER); CREATE TABLE Person (name VARCHAR, job VARCHAR, age INTEGER) |
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | what are the three most commonly prescribed drugs that were prescribed to the patients 40s within the same month after having been diagnosed with prim cardiomyopathy nec until 2 years ago? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime ... |
SELECT COUNT(location) FROM table_16734640_1 WHERE institution = "Georgia Perimeter College" | Name the number location of georgia perimeter college | CREATE TABLE table_16734640_1 (location VARCHAR, institution VARCHAR) |
SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM person WHERE gender = 'male') | Who is the youngest male? | CREATE TABLE Person (name VARCHAR, gender VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, gender VARCHAR, age INTEGER) |
SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3918)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'enfamilad... | on 07/16/2105, patient 3918 has had any enfamiladdedrice po intake? | CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
chart... |
SELECT location FROM table_16734640_1 WHERE institution = "Chattahoochee Technical College" | Name the location for chattahoochee technical college | CREATE TABLE table_16734640_1 (location VARCHAR, institution VARCHAR) |
SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach' | How old is the doctor named Zach? | CREATE TABLE Person (age VARCHAR, job VARCHAR, name VARCHAR) |
SELECT score FROM table_name_88 WHERE player = "olin dutra" | What was Olin Dutra's score? | CREATE TABLE table_name_88 (
score VARCHAR,
player VARCHAR
) |
SELECT location FROM table_16734640_1 WHERE institution = "Abraham Baldwin Agricultural College" | Name the location for abraham baldwin agricultural college | CREATE TABLE table_16734640_1 (location VARCHAR, institution VARCHAR) |
SELECT name FROM Person WHERE age < 30 | Who is the person whose age is below 30? | CREATE TABLE Person (name VARCHAR, age INTEGER) |
SELECT 2004 FROM table_name_86 WHERE 2009 = "grand slam tournaments" | What is the 2004 value for the 2009 Grand slam tournaments? | CREATE TABLE table_name_86 (
Id VARCHAR
) |
SELECT COUNT(nickname) FROM table_16734640_1 WHERE institution = "Andrew College" | Name the total number of nicknames for andrew college | CREATE TABLE table_16734640_1 (nickname VARCHAR, institution VARCHAR) |
SELECT COUNT(*) FROM Person WHERE age > 30 AND job = 'engineer' | How many people whose age is greater 30 and job is engineer? | CREATE TABLE Person (age VARCHAR, job VARCHAR) |
SELECT MIN("Overall") FROM table_36892 WHERE "Name" = 'tony baker' | Name the least overall for tony baker | CREATE TABLE table_36892 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) |
SELECT MAX(enrollment) FROM table_16734640_1 WHERE nickname = "Hawks" | Name the most enrollment when nickname is hawks | CREATE TABLE table_16734640_1 (enrollment INTEGER, nickname VARCHAR) |
SELECT AVG(age), gender FROM Person GROUP BY gender | What is the average age for each gender? | CREATE TABLE Person (gender VARCHAR, age INTEGER) |
SELECT COUNT(losses) FROM table_name_85 WHERE last_appearance = "2003" AND wins > 2 | What is the total number of Losses, when Last Appearance is 2003, and when Wins is greater than 2? | CREATE TABLE table_name_85 (
losses VARCHAR,
last_appearance VARCHAR,
wins VARCHAR
) |
SELECT surface FROM table_16741821_8 WHERE opponent = "George Khrikadze" | WHAT WAS THE SURFACE MADE OF WHEN THE OPPONENT WAS GEORGE KHRIKADZE? | CREATE TABLE table_16741821_8 (surface VARCHAR, opponent VARCHAR) |
SELECT AVG(age), job FROM Person GROUP BY job | What is average age for different job title? | CREATE TABLE Person (job VARCHAR, age INTEGER) |
SELECT brand FROM table_name_28 WHERE entrant = "mark henry" | What is Mark Henry's brand? | CREATE TABLE table_name_28 (
brand VARCHAR,
entrant VARCHAR
) |
SELECT result FROM table_16741821_8 WHERE surface = "Clay" AND against = "Lithuania" | WHAT WERE ALL OF THE RESULTS WHEN THEY PLAYED AGAINST LITHUANIA AND THE SURFACE WAS MADE OF CLAY? | CREATE TABLE table_16741821_8 (result VARCHAR, surface VARCHAR, against VARCHAR) |
SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job | What is average age of male for different job title? | CREATE TABLE Person (job VARCHAR, age INTEGER, gender VARCHAR) |
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-17204')) AND intakeoutput.celllabel = 'tube ... | what is the yearly minimum dose of tube feeding flush (ml) that patient 016-17204 has taken until 11/2105? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... |
SELECT republican AS :_steve_sauerberg FROM table_16751596_2 WHERE dates_administered = "September 15-September 18, 2008" | Name the republican steve sauerberg where dates administered september 15-september 18, 2008 | CREATE TABLE table_16751596_2 (republican VARCHAR, dates_administered VARCHAR) |
SELECT MIN(age), job FROM Person GROUP BY job | What is minimum age for different job title? | CREATE TABLE Person (job VARCHAR, age INTEGER) |
SELECT SUM("Top-25") FROM table_35980 WHERE "Top-5" > '9' AND "Wins" < '11' | Which Top-25 has a Top-5 larger than 9, and Wins smaller than 11? | CREATE TABLE table_35980 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) |
SELECT republican AS :_steve_sauerberg FROM table_16751596_2 WHERE dates_administered = "August 12, 2008" | Name the republican steve sauerberg for august 12, 2008 | CREATE TABLE table_16751596_2 (republican VARCHAR, dates_administered VARCHAR) |
SELECT COUNT(*), gender FROM Person WHERE age < 40 GROUP BY gender | Find the number of people who is under 40 for each gender. | CREATE TABLE Person (gender VARCHAR, age INTEGER) |
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15945) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | is patient 15945's arterial bp [diastolic] last measured on the last icu visit greater than first measured on the last icu visit? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod... |
SELECT poll_source FROM table_16751596_2 WHERE dates_administered = "July 12, 2008" | Name the poll source for july 12, 2008 | CREATE TABLE table_16751596_2 (poll_source VARCHAR, dates_administered VARCHAR) |
SELECT name FROM Person WHERE age > (SELECT MIN(age) FROM person WHERE job = 'engineer') ORDER BY age | Find the name of people whose age is greater than any engineer sorted by their age. | CREATE TABLE Person (name VARCHAR, age INTEGER, job VARCHAR); CREATE TABLE person (name VARCHAR, age INTEGER, job VARCHAR) |
SELECT "Date" FROM table_22648 WHERE "Dolphins points" = '6' | How many dates do the dolphins have 6 points? | CREATE TABLE table_22648 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Dolphins points" real,
"Opponents" real,
"Record" text,
"Attendance" real
) |
SELECT democrat AS :_vivian_davis_figures FROM table_16751596_12 WHERE lead_margin = 35 | When the lead margin was 35, what were the Democrat: Vivian Davis Figures? | CREATE TABLE table_16751596_12 (democrat VARCHAR, lead_margin VARCHAR) |
SELECT COUNT(*) FROM Person WHERE age > (SELECT MAX(age) FROM person WHERE job = 'engineer') | Find the number of people whose age is greater than all engineers. | CREATE TABLE Person (age INTEGER, job VARCHAR); CREATE TABLE person (age INTEGER, job VARCHAR) |
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | what's the name of the procedure that patient 005-26011 got two times in 01/last year? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... |
SELECT republican AS :_jeff_sessions FROM table_16751596_12 WHERE dates_administered = "June 30, 2008" | On June 30, 2008 who what was the Republican: Jeff Sessions percentage? | CREATE TABLE table_16751596_12 (republican VARCHAR, dates_administered VARCHAR) |
SELECT name, job FROM Person ORDER BY name | list the name, job title of all people ordered by their names. | CREATE TABLE Person (name VARCHAR, job VARCHAR) |
SELECT MAX(year) FROM table_name_82 WHERE engine = "offenhauser l4" AND chassis = "kurtis kraft 500c" AND entrant = "federal engineering" | Which is the latest year that has an engine of Offenhauser l4, a chassis of Kurtis Kraft 500c, and the entrant of Federal Engineering? | CREATE TABLE table_name_82 (
year INTEGER,
entrant VARCHAR,
engine VARCHAR,
chassis VARCHAR
) |
SELECT COUNT(republican) AS :_jeff_sessions FROM table_16751596_12 WHERE dates_administered = "November 14, 2007" | On November 14, 2007, how many different Republican: Jeff Sessions are there? | CREATE TABLE table_16751596_12 (republican VARCHAR, dates_administered VARCHAR) |
SELECT name FROM Person ORDER BY age DESC | Find the names of all person sorted in the descending order using age. | CREATE TABLE Person (name VARCHAR, age VARCHAR) |
SELECT "Surface" FROM table_70261 WHERE "Cage dive" = '2' | What surface has 2 as a cage dive? | CREATE TABLE table_70261 (
"1-person dive" text,
"2-person dive" text,
"3-person dive" text,
"Surface" text,
"Cage dive" text,
"Seal/turtle decoy" text,
"Catch release" text,
"Attached camera" text,
"Remote camera" text
) |
SELECT democrat AS :_vivian_davis_figures FROM table_16751596_12 WHERE dates_administered = "November 14, 2007" | On November 14, 2007, what are the Democrat: Vivian Davis Figures percentages? | CREATE TABLE table_16751596_12 (democrat VARCHAR, dates_administered VARCHAR) |
SELECT name FROM Person WHERE gender = 'male' ORDER BY age | Find the name and age of all males in order of their age. | CREATE TABLE Person (name VARCHAR, gender VARCHAR, age VARCHAR) |
SELECT "Spike" FROM table_62736 WHERE "2008 club" = 'karava' | Which spike has a 2008 club Karava? | CREATE TABLE table_62736 (
"Name" text,
"Height" text,
"Weight" text,
"Spike" text,
"2008 club" text
) |
SELECT democrat AS :_vivian_davis_figures FROM table_16751596_12 WHERE dates_administered = "July 31, 2008" | On July 31, 2008, what are the Democrat: Vivian Davis Figures percentages? | CREATE TABLE table_16751596_12 (democrat VARCHAR, dates_administered VARCHAR) |
SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' | Find the name and age of the person who is a friend of both Dan and Alice. | CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) |
SELECT content FROM table_15887683_1 WHERE television_service = "LA7" | What is the content of la7 television service? | CREATE TABLE table_15887683_1 (
content VARCHAR,
television_service VARCHAR
) |
SELECT democrat AS :_mark_begich FROM table_16751596_13 WHERE dates_administered = "October 6, 2008" | What was Mark Begich polling on October 6, 2008? | CREATE TABLE table_16751596_13 (democrat VARCHAR, dates_administered VARCHAR) |
SELECT DISTINCT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice' | Find the name and age of the person who is a friend of Dan or Alice. | CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) |
SELECT points_against FROM table_14070062_4 WHERE points_for = "743" | was the the score when the tries was 743 | CREATE TABLE table_14070062_4 (
points_against VARCHAR,
points_for VARCHAR
) |
SELECT COUNT(dates_administered) FROM table_16751596_13 WHERE poll_source = "Research 2000/Daily Kos" | When the poll source is research 2000/daily kos, what is the total number of dates administered? | CREATE TABLE table_16751596_13 (dates_administered VARCHAR, poll_source VARCHAR) |
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30) | Find the name of the person who has friends with age above 40 and under age 30? | CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) |
SELECT Fname, AVG(Age) FROM Student WHERE Sex = 'F' GROUP BY Fname ORDER BY Fname DESC | Show the average age for all female students and group them by first name in a bar chart, and display x axis in desc order please. | CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... |
SELECT COUNT(lead_maragin) FROM table_16751596_13 WHERE dates_administered = "July 17, 2008" | On July 17, 2008, what was the total number of lead maragin? | CREATE TABLE table_16751596_13 (lead_maragin VARCHAR, dates_administered VARCHAR) |
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30) | Find the name of the person who has friends with age above 40 but not under age 30? | CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) |
SELECT player FROM table_name_28 WHERE year = "2001-2002" | Which player is featured for 2001-2002? | CREATE TABLE table_name_28 (
player VARCHAR,
year VARCHAR
) |
SELECT club FROM table_1676073_12 WHERE points_against = "608" | What clubs had 608 points against? | CREATE TABLE table_1676073_12 (club VARCHAR, points_against VARCHAR) |
SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student' | Find the name of the person who has no student friends. | CREATE TABLE Person (name VARCHAR, job VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE person (name VARCHAR) |
SELECT ABS((SELECT "founded" FROM table_204_540 WHERE "name" = 'st. agnes') - (SELECT "founded" FROM table_204_540 WHERE "name" = 'good shepherd')) | what was the difference , in years between the founding of st. agnes and the founding of good shepherd ? | CREATE TABLE table_204_540 (
id number,
"name" text,
"town" text,
"deanery" text,
"vicariate" text,
"founded" number,
"original ethnic community" text
) |
SELECT played FROM table_1676073_12 WHERE points = "48" | How many games played for the team with 48 points? | CREATE TABLE table_1676073_12 (played VARCHAR, points VARCHAR) |
SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1 | Find the person who has exactly one friend. | CREATE TABLE PersonFriend (name VARCHAR) |
SELECT album FROM table_name_44 WHERE composer_s_ = "jimmie lee sloas" | Jimmie Lee Sloas was the composer for what album? | CREATE TABLE table_name_44 (
album VARCHAR,
composer_s_ VARCHAR
) |
SELECT played FROM table_1676073_12 WHERE points_against = "686" | How many games played for the team with 686 points against? | CREATE TABLE table_1676073_12 (played VARCHAR, points_against VARCHAR) |
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob' | Who are the friends of Bob? | CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR) |
SELECT MAX(year) FROM table_name_33 WHERE chassis = "ats hs1" | What's the top year with the Chassis ats hs1? | CREATE TABLE table_name_33 (
year INTEGER,
chassis VARCHAR
) |
SELECT club FROM table_1676073_12 WHERE points_for = "748" | What clubs recorded 748 points to the good? | CREATE TABLE table_1676073_12 (club VARCHAR, points_for VARCHAR) |
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob' | Find the name of persons who are friends with Bob. | CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) |
SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age LIMIT 1 | What is the total point count of the youngest gymnast? | CREATE TABLE gymnast (
Total_Points VARCHAR,
Gymnast_ID VARCHAR
)
CREATE TABLE people (
People_ID VARCHAR,
Age VARCHAR
) |
SELECT COUNT(points_for) FROM table_1676073_12 WHERE points_against = "632" | How many teams had 632 points against? | CREATE TABLE table_1676073_12 (points_for VARCHAR, points_against VARCHAR) |
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female' | Find the names of females who are friends with Zach | CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR) |
SELECT "Mountains classification" FROM table_19834 WHERE "Winner" = 'Alejandro Valverde' AND "Points classification" = 'Erik Zabel' | If winner is alejandro Valverde and the points Classification is by Erik Zabel, who is the mountain classification? | CREATE TABLE table_19834 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination classification" text,
"Team classification" text
) |
SELECT drawn FROM table_1676073_12 WHERE lost = "11" AND points_for = "748" | How many games drawn for the team that lost 11 and had 748 points? | CREATE TABLE table_1676073_12 (drawn VARCHAR, lost VARCHAR, points_for VARCHAR) |
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female' | Find the female friends of Alice. | CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR) |
SELECT to_par FROM table_name_39 WHERE place = "t5" AND score = 74 - 69 - 66 = 209 | What was the to par at the T5 for the player with a score of 74-69-66=209? | CREATE TABLE table_name_39 (
to_par VARCHAR,
place VARCHAR,
score VARCHAR
) |
SELECT COUNT(republican) AS :_jack_hoogendyk FROM table_16751596_6 WHERE poll_source = "Public Policy Polling" | How many times did Public Policy Polling under Republican: Jack Hoogendyk? | CREATE TABLE table_16751596_6 (republican VARCHAR, poll_source VARCHAR) |
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor' | Find the male friend of Alice whose job is a doctor? | CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, job VARCHAR, gender VARCHAR) |
SELECT "Date" FROM table_75946 WHERE "Score" = '0 - 0' | On which date was the score 0 - 0? | CREATE TABLE table_75946 (
"Round" text,
"Date" text,
"Home team" text,
"Score" text,
"Away team" text
) |
SELECT poll_source FROM table_16751596_6 WHERE dates_administered = "July 10, 2008" | What poll source had an administered date on July 10, 2008? | CREATE TABLE table_16751596_6 (poll_source VARCHAR, dates_administered VARCHAR) |
SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city' | Who has a friend that is from new york city? | CREATE TABLE Person (name VARCHAR, city VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) |
SELECT television_service FROM table_name_90 WHERE content = "presentazione" | What is Television Service, when Content is Presentazione? | CREATE TABLE table_name_90 (
television_service VARCHAR,
content VARCHAR
) |
SELECT latitude FROM table_16768245_2 WHERE diameter = "184.0" | What is the latitude when the diameter is 184.0? | CREATE TABLE table_16768245_2 (latitude VARCHAR, diameter VARCHAR) |
SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person) | Who has friends that are younger than the average age? | CREATE TABLE person (age INTEGER); CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) |
SELECT championship FROM table_name_17 WHERE year > 1985 AND winning_score = –8(68 - 72 - 69 - 71 = 280) | Which championship after 1985 had a winning score of 8 (68-72-69-71=280)? | CREATE TABLE table_name_17 (
championship VARCHAR,
year VARCHAR,
winning_score VARCHAR
) |
SELECT COUNT(longitude) FROM table_16768245_2 WHERE diameter = "224.0" | How many longitudes have a diameter of 224.0? | CREATE TABLE table_16768245_2 (longitude VARCHAR, diameter VARCHAR) |
SELECT DISTINCT T2.name, T2.friend, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM person) | Who has friends that are older than the average age? Print their friends and their ages as well | CREATE TABLE person (age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (age INTEGER, name VARCHAR) |
SELECT opponent FROM table_name_34 WHERE attendance = "60,594" | Which Opponent has Attendances of 60,594? | CREATE TABLE table_name_34 (
opponent VARCHAR,
attendance VARCHAR
) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.