table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges... | JanitorTags: tag:Linux but focused on a distro (pacman). | SELECT Id AS "post_link", * FROM Posts JOIN PostTags ON Posts.Id = PostTags.PostId WHERE PostTags.TagId = 4 AND Body LIKE '%pacman%' ORDER BY CreationDate DESC |
CREATE TABLE table_203_815 (
id number,
"pick #" number,
"nfl team" text,
"player" text,
"position" text,
"college" text
) | who was the only player from kansas state ? | SELECT "player" FROM table_203_815 WHERE "college" = 'kansas state' |
CREATE TABLE table_17232 (
"Disc" real,
"Track" real,
"English title" text,
"Japanese title" text,
"R\u014dmaji title" text,
"Artist" text,
"Track time" text
) | What is the smallest track number? | SELECT MIN("Track") FROM table_17232 |
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcod... | What are the first names, office locations of all lecturers who have taught some course? | SELECT T2.emp_fname, T4.prof_office, T3.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 JOIN professor AS T4 ON T2.emp_num = T4.emp_num |
CREATE TABLE table_4053 (
"Executed person" text,
"Date of execution" text,
"Place of execution" text,
"Crime" text,
"Method" text,
"Under President" text
) | under which president was gunther volz executed? | SELECT "Under President" FROM table_4053 WHERE "Executed person" = 'Gunther Volz' |
CREATE TABLE table_72445 (
"County" text,
"Population" real,
"Per capita income" text,
"Median household income" text,
"Median family income" text
) | Name the median family income for riverside | SELECT "Median family income" FROM table_72445 WHERE "County" = 'Riverside' |
CREATE TABLE table_name_77 (
home_team VARCHAR,
away_team VARCHAR
) | Name the home team for carlton away team | SELECT home_team FROM table_name_77 WHERE away_team = "carlton" |
CREATE TABLE table_22767 (
"Year" real,
"World" real,
"Asia" text,
"Africa" text,
"Europe" text,
"Latin America/Caribbean" text,
"Northern America" text,
"Oceania" text
) | what will the population of Asia be when Latin America/Caribbean is 783 (7.5%)? | SELECT "Asia" FROM table_22767 WHERE "Latin America/Caribbean" = '783 (7.5%)' |
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 Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1... | How many faculty members do we have for each gender? Draw a bar chart, order by the Y-axis in descending. | SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex ORDER BY COUNT(*) DESC |
CREATE TABLE table_14656147_2 (
week VARCHAR,
record VARCHAR
) | List the record of 0-1 from the table? | SELECT week FROM table_14656147_2 WHERE record = "0-1" |
CREATE TABLE table_name_24 (
silver VARCHAR,
bronze VARCHAR,
gold VARCHAR,
rank VARCHAR
) | Which silver has a Gold smaller than 12, a Rank smaller than 5, and a Bronze of 5? | SELECT silver FROM table_name_24 WHERE gold < 12 AND rank < 5 AND bronze = 5 |
CREATE TABLE table_47482 (
"Company name" text,
"Hardware Model" text,
"Accreditation type" text,
"Accreditation level" text,
"Date" text
) | When did Samsung Electronics Co LTD make the GT-i9100? | SELECT "Date" FROM table_47482 WHERE "Company name" = 'samsung electronics co ltd' AND "Hardware Model" = 'gt-i9100' |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground_service (
city_code text,
airp... | what are the early morning flights from BOSTON to DENVER | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER... |
CREATE TABLE table_148535_2 (
Id VARCHAR
) | Name the most 3 credits | SELECT MIN(3 AS _credits) FROM table_148535_2 |
CREATE TABLE table_3791 (
"Year" text,
"Stage" real,
"Start of stage" text,
"Distance (km)" text,
"Category of climb" text,
"Stage winner" text,
"Nationality" text,
"Yellow jersey" text,
"Bend" real
) | What is every yellow jersey entry for the distance 125? | SELECT "Yellow jersey" FROM table_3791 WHERE "Distance (km)" = '125' |
CREATE TABLE table_name_63 (
years VARCHAR,
goals VARCHAR,
matches VARCHAR,
rank VARCHAR
) | In what years was there a rank lower than 9, under 84 goals, and more than 158 matches? | SELECT years FROM table_name_63 WHERE matches > 158 AND rank > 9 AND goals < 84 |
CREATE TABLE table_43208 (
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
) | What aired at 10:00 when Flashpoint aired at 9:30? | SELECT "10:00" FROM table_43208 WHERE "9:30" = 'flashpoint' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose insurance is government and procedure short title is rt/left heart card cath? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Rt/left heart card cath" |
CREATE TABLE table_18904831_5 (
record VARCHAR,
high_rebounds VARCHAR
) | What was the record of the game in which Dydek (10) did the most high rebounds? | SELECT record FROM table_18904831_5 WHERE high_rebounds = "Dydek (10)" |
CREATE TABLE table_10130 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When was the game played at glenferrie oval? | SELECT "Date" FROM table_10130 WHERE "Venue" = 'glenferrie oval' |
CREATE TABLE table_7207 (
"Objects" text,
"Date" text,
"SiO 2" real,
"Al 2 O 3" real,
"Fe 2 O 3" real,
"K 2 O" real,
"Na 2 O" real
) | What is the highest K 2 O, when Na 2 O is greater than 1.87, when Fe 2 O 3 is greater than 0.07, when Objects is Ritual Disk, and when Al 2 O 3 is less than 0.62? | SELECT MAX("K 2 O") FROM table_7207 WHERE "Na 2 O" > '1.87' AND "Fe 2 O 3" > '0.07' AND "Objects" = 'ritual disk' AND "Al 2 O 3" < '0.62' |
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 the total number of patients diagnosed with icd9 code 45620 who had a blood test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "45620" AND lab.fluid = "Blood" |
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,
... | count the number of patients whose primary disease is pneumonia;human immunodefiency virus;rule out tuberculosis and year of death is less than or equal to 2168? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.dod_year <= "2168.0" |
CREATE TABLE table_72013 (
"Season" text,
"Level" text,
"Division" text,
"Section" text,
"Position" text
) | Which section is in the 6th position? | SELECT "Section" FROM table_72013 WHERE "Position" = '6th' |
CREATE TABLE table_69300 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What is the area of the coed school with a state authority and a roll number of 122? | SELECT "Area" FROM table_69300 WHERE "Authority" = 'state' AND "Gender" = 'coed' AND "Roll" = '122' |
CREATE TABLE table_name_1 (
type VARCHAR,
location VARCHAR
) | Which type of institution is in Amherst, MA? | SELECT type FROM table_name_1 WHERE location = "amherst, ma" |
CREATE TABLE table_21696 (
"Winner" text,
"Country" text,
"Winter Olympics" text,
"FIS Nordic World Ski Championships" text,
"Holmenkollen" text
) | What years did Birger Ruud win the FIS Nordic World Ski Championships? | SELECT "FIS Nordic World Ski Championships" FROM table_21696 WHERE "Winner" = 'Birger Ruud' |
CREATE TABLE table_203_116 (
id number,
"no." number,
"player" text,
"birth date" text,
"weight" number,
"height" number,
"position" text,
"current club" text
) | how many members of estonia 's men 's national volleyball team were born in 1988 ? | SELECT COUNT("player") FROM table_203_116 WHERE "birth date" = 1988 |
CREATE TABLE table_2818164_5 (
no_in_season VARCHAR,
original_air_date VARCHAR
) | What episoe number in the season originally aired on February 11, 1988? | SELECT no_in_season FROM table_2818164_5 WHERE original_air_date = "February 11, 1988" |
CREATE TABLE table_60686 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What date was the match against adri n men ndez-maceiras? | SELECT "Date" FROM table_60686 WHERE "Opponent" = 'adrián menéndez-maceiras' |
CREATE TABLE table_203_365 (
id number,
"released" text,
"video title" text,
"company" text,
"director" text,
"notes" text
) | did shoko goto make more films in 2004 or 2005 ? | SELECT "released" FROM table_203_365 WHERE "released" IN (2004, 2005) GROUP BY "released" ORDER BY COUNT("video title") DESC LIMIT 1 |
CREATE TABLE table_65116 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What venue listed is dated February 22, 2003? | SELECT "Venue" FROM table_65116 WHERE "Date" = 'february 22, 2003' |
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
)
... | provide the number of patients whose admission type is emergency and lab test name is rbc, csf? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "RBC, CSF" |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | How often does the course POLSCI 659 meet ? | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i... |
CREATE TABLE table_40395 (
"Couple" text,
"Style" text,
"Music" text,
"Choreographer(s)" text,
"Results" text
) | Which couple participated in the Contemporary style of dance? | SELECT "Couple" FROM table_40395 WHERE "Style" = 'contemporary' |
CREATE TABLE table_28772 (
"Portuguese name" text,
"English name" text,
"Subdivides in" text,
"Equivalence in Varas" text,
"Metrical equivalence" text
) | Name the metrical equivalence for linha | SELECT "Metrical equivalence" FROM table_28772 WHERE "Portuguese name" = 'Linha' |
CREATE TABLE table_27132791_3 (
position VARCHAR,
college VARCHAR
) | If the college is SMU, what is the position? | SELECT position FROM table_27132791_3 WHERE college = "SMU" |
CREATE TABLE table_21876 (
"Season" real,
"Date" text,
"Winning Driver" text,
"Car #" real,
"Sponsor" text,
"Make" text,
"Team" text,
"Avg Speed" text,
"Margin of Victory" text
) | What was the represented team on June 27? | SELECT "Team" FROM table_21876 WHERE "Date" = 'June 27' |
CREATE TABLE artist (
artist_id number,
artist text,
age number,
famous_title text,
famous_release_date text
)
CREATE TABLE music_festival (
id number,
music_festival text,
date_of_ceremony text,
category text,
volume number,
result text
)
CREATE TABLE volume (
volume_i... | Please show the songs that have result 'nominated' at music festivals. | SELECT T2.song FROM music_festival AS T1 JOIN volume AS T2 ON T1.volume = T2.volume_id WHERE T1.result = "Nominated" |
CREATE TABLE elimination (
elimination_id text,
wrestler_id text,
team text,
eliminated_by text,
elimination_move text,
time text
)
CREATE TABLE wrestler (
wrestler_id number,
name text,
reign text,
days_held text,
location text,
event text
) | Which teams had more than 3 eliminations? | SELECT team FROM elimination GROUP BY team HAVING COUNT(*) > 3 |
CREATE TABLE table_204_910 (
id number,
"rank" number,
"name" text,
"nationality" text,
"result" number,
"notes" text
) | how many athletes had a better result than tatyana bocharova ? | SELECT COUNT("name") FROM table_204_910 WHERE "result" > (SELECT "result" FROM table_204_910 WHERE "name" = 'tatyana bocharova') |
CREATE TABLE table_8430 (
"Number" text,
"Builder" text,
"Type" text,
"Date" real,
"Length" text,
"Capacity" text
) | Which Type has a Capacity of 28 passengers, and a Number of 16? | SELECT "Type" FROM table_8430 WHERE "Capacity" = '28 passengers' AND "Number" = '16' |
CREATE TABLE people (
people_id number,
district text,
name text,
party text,
age number
)
CREATE TABLE debate_people (
debate_id number,
affirmative number,
negative number,
if_affirmative_win others
)
CREATE TABLE debate (
debate_id number,
date text,
venue text,
... | Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name. | SELECT T3.name, T2.date, T2.venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.debate_id = T2.debate_id JOIN people AS T3 ON T1.negative = T3.people_id ORDER BY T3.name |
CREATE TABLE table_203_564 (
id number,
"hand" text,
"1 credit" number,
"2 credits" number,
"3 credits" number,
"4 credits" number,
"5 credits" number
) | is a 2 credit full house the same as a 5 credit three of a kind ? | SELECT (SELECT "2 credits" FROM table_203_564 WHERE "hand" = 'full house') = (SELECT "5 credits" FROM table_203_564 WHERE "hand" = 'three of a kind') |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
dep... | Next semester , what time does the EDUC 510 lecture begin ? | SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'EDUC' AND course.nu... |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of code , and group by attribute name, sort total number of code in asc order. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code |
CREATE TABLE table_name_18 (
round INTEGER,
school VARCHAR
) | What was the highest round that had northwestern? | SELECT MAX(round) FROM table_name_18 WHERE school = "northwestern" |
CREATE TABLE table_name_19 (
wins INTEGER,
position VARCHAR,
poles VARCHAR
) | What is the smallest Wins with a Position of 20th, and Poles smaller than 0? | SELECT MIN(wins) FROM table_name_19 WHERE position = "20th" AND poles < 0 |
CREATE TABLE table_30306 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | Who is listed under mens singles when womens has wang nan zhang yining? | SELECT "Mens Singles" FROM table_30306 WHERE "Womens Doubles" = 'Wang Nan Zhang Yining' |
CREATE TABLE Behavior_Incident (
date_incident_start VARCHAR,
date_incident_end VARCHAR,
incident_type_code VARCHAR
) | What are the start and end dates for incidents with incident type code 'NOISE'? | SELECT date_incident_start, date_incident_end FROM Behavior_Incident WHERE incident_type_code = "NOISE" |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | 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, return a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, display by the the average of manager id in ascending please. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) |
CREATE TABLE table_204_988 (
id number,
"responsible minister(s)" text,
"crown entities" text,
"monitoring department(s)" text,
"category / type" text,
"empowering legislation" text
) | who is listed as the last responsible mister -lrb- s -rrb- on this chart ? | SELECT "responsible minister(s)" FROM table_204_988 ORDER BY id DESC LIMIT 1 |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
... | Users with highest reputation both in SO and Math ( geometric mean = average digits). | SELECT s.DisplayName, s.Reputation AS RepSO, m.Reputation AS RepMath, (LOG10(s.Reputation) + LOG10(m.Reputation)) / 2 AS RepAvDigits FROM "stackexchange.math".Users AS m, "stackoverflow".Users AS s WHERE s.Reputation > 10000 AND m.Reputation > 10000 AND s.AccountId = m.AccountId ORDER BY 4 DESC |
CREATE TABLE table_29747178_2 (
series__number VARCHAR,
directed_by VARCHAR
) | What is the series # when the director is john showalter? | SELECT series__number FROM table_29747178_2 WHERE directed_by = "John Showalter" |
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... | provide the number of patients whose admission type is emergency and diagnosis long title is other drugs and medicinal substances causing adverse effects in therapeutic use. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Other drugs and medicinal substances causing adverse effects in therapeutic use" |
CREATE TABLE table_19191 (
"Year" real,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"US Open Cup" text,
"Avg. Attendance" real
) | What was the regular season standings for the year when the playoffs reached the conference semifinals and the team did not qualify for the US Open Cup? | SELECT "Reg. Season" FROM table_19191 WHERE "Playoffs" = 'Conference Semifinals' AND "US Open Cup" = 'Did not qualify' |
CREATE TABLE table_37490 (
"Name" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/G" real
) | How much Long has a Loss larger than 2, and a Gain of 157, and an Avg/G smaller than 129? | SELECT SUM("Long") FROM table_37490 WHERE "Loss" > '2' AND "Gain" = '157' AND "Avg/G" < '129' |
CREATE TABLE table_7363 (
"Vol. #" real,
"Title" text,
"Material collected" text,
"Pages" real,
"ISBN" text
) | How many pages does the edition with a volume # smaller than 8 and an ISBM of 1-40122-892-5 have? | SELECT SUM("Pages") FROM table_7363 WHERE "Vol. #" < '8' AND "ISBN" = '1-40122-892-5' |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAno... | Ranking of questions by score. | SELECT Posts.Id AS "post_link", Posts.Title, Posts.Score AS Score FROM Posts ORDER BY Posts.Score DESC LIMIT 100 |
CREATE TABLE table_name_40 (
game VARCHAR,
score VARCHAR
) | Which Game has a Score of w 90 82 (ot)? | SELECT game FROM table_name_40 WHERE score = "w 90–82 (ot)" |
CREATE TABLE table_name_67 (
crowd INTEGER,
away_team VARCHAR
) | What was the largest crowd when Collingwood was the away team? | SELECT MAX(crowd) FROM table_name_67 WHERE away_team = "collingwood" |
CREATE TABLE table_24185 (
"Station" text,
"Line" text,
"Planned" real,
"Cancelled" real,
"Proposal" text,
"Details" text
) | Name the number of cancelled for turnham green | SELECT COUNT("Cancelled") FROM table_24185 WHERE "Station" = 'Turnham Green' |
CREATE TABLE table_name_59 (
attendance INTEGER,
score VARCHAR,
away VARCHAR
) | What is the highest attendance of the match with a 2:0 score and vida as the away team? | SELECT MAX(attendance) FROM table_name_59 WHERE score = "2:0" AND away = "vida" |
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
) | Visualize a pie chart with what are the names and seatings for all tracks opened after 2000? | SELECT Name, Seating FROM track WHERE Year_Opened > 2000 |
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_cit... | Show the name for regions and the number of storms for each region by a bar chart, and sort from high to low by the X-axis. | 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 DESC |
CREATE TABLE table_name_44 (
attendance INTEGER,
record VARCHAR,
points VARCHAR
) | What is the Attendance of the game with a Record of 37 21 12 and less than 86 Points? | SELECT AVG(attendance) FROM table_name_44 WHERE record = "37–21–12" AND points < 86 |
CREATE TABLE table_name_17 (
yards_per_attempt INTEGER,
net_yards INTEGER
) | How many yards per attempt have net yards greater than 631? | SELECT SUM(yards_per_attempt) FROM table_name_17 WHERE net_yards > 631 |
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 diagnoses (
... | What is the primary disease and diagnosis icd9 code of Josette Orr? | SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Josette Orr" |
CREATE TABLE table_23575917_2 (
scores VARCHAR,
davids_team VARCHAR
) | Name the scores for david baddiel and maureen lipman | SELECT COUNT(scores) FROM table_23575917_2 WHERE davids_team = "David Baddiel and Maureen Lipman" |
CREATE TABLE table_name_62 (
role VARCHAR,
studio VARCHAR,
title VARCHAR
) | Name the role for mono studio and title of paradise canyon | SELECT role FROM table_name_62 WHERE studio = "mono" AND title = "paradise canyon" |
CREATE TABLE table_name_24 (
total VARCHAR,
finish VARCHAR
) | Name the total with finish of t22 | SELECT total FROM table_name_24 WHERE finish = "t22" |
CREATE TABLE table_3782 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Location/Attendance" text,
"Record" text
) | If the opponent was @ Boston Bruins, what was the Location/Attendance? | SELECT "Location/Attendance" FROM table_3782 WHERE "Opponent" = '@ Boston Bruins' |
CREATE TABLE table_64443 (
"Date(s)" text,
"Venue" text,
"City" text,
"Ticket price(s)" text,
"Ticket sold / available" text,
"Ticket grossing" text
) | What was the ticket price on September 16, 1986? | SELECT "Ticket price(s)" FROM table_64443 WHERE "Date(s)" = 'september 16, 1986' |
CREATE TABLE table_17060277_7 (
high_rebounds VARCHAR,
team VARCHAR
) | Name the high rebounds for memphis | SELECT high_rebounds FROM table_17060277_7 WHERE team = "Memphis" |
CREATE TABLE settlements (
settlement_id number,
claim_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number,
customer_policy_id number
)
CREATE TABLE customers (
customer_id number,
customer_details text
)
CREATE TABLE claims (
... | Tell me the the date when the first claim was made. | SELECT date_claim_made FROM claims ORDER BY date_claim_made LIMIT 1 |
CREATE TABLE table_77878 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | Tell me the outgoing manager for 22 november date of vacancy | SELECT "Outgoing manager" FROM table_77878 WHERE "Date of vacancy" = '22 november' |
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 products with a price between 60 and 120, return a bar chart about the distribution of name and manufacturer , and sort in desc by the y-axis. | SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer DESC |
CREATE TABLE table_50927 (
"Winner" text,
"Country" text,
"Winter Olympics" real,
"FIS Nordic World Ski Championships" text,
"Holmenkollen" text
) | Who won the FIS Nordic World Ski Championships in 1972? | SELECT "Winner" FROM table_50927 WHERE "FIS Nordic World Ski Championships" = '1972' |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For those employees who was hired before 2002-06-21, give me the comparison about the average of department_id over the job_id , and group by attribute job_id, show x-axis in descending order. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC |
CREATE TABLE table_2187178_1 (
listed_owner_s_ VARCHAR,
team VARCHAR
) | Name the listed owners for brevak racing | SELECT listed_owner_s_ FROM table_2187178_1 WHERE team = "Brevak Racing" |
CREATE TABLE table_7061 (
"Year" real,
"Foundry" text,
"Diameter (mm)" real,
"Weight (kg)" text,
"Nominal Tone" text
) | What is the sum total of all the years with a bell that weighed 857 kilograms? | SELECT SUM("Year") FROM table_7061 WHERE "Weight (kg)" = '857' |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
P... | Questions with 'Magento' in title. | SELECT Id AS "post_link" FROM Posts WHERE Title LIKE '%Magento%' |
CREATE TABLE table_name_46 (
money___$__ VARCHAR,
player VARCHAR
) | What is Chris Riley's Money? | SELECT money___$__ FROM table_name_46 WHERE player = "chris riley" |
CREATE TABLE country (
country_id number,
name text,
population number,
area number,
languages text
)
CREATE TABLE roller_coaster (
roller_coaster_id number,
name text,
park text,
country_id number,
length number,
height number,
speed text,
opened text,
status te... | What are the speeds of the longest roller coaster? | SELECT speed FROM roller_coaster ORDER BY length DESC LIMIT 1 |
CREATE TABLE table_name_48 (
points INTEGER,
year VARCHAR,
goals VARCHAR
) | What are the lowest points with 2013 as the year, and goals less than 0? | SELECT MIN(points) FROM table_name_48 WHERE year = "2013" AND goals < 0 |
CREATE TABLE table_16888 (
"Year" real,
"Championship" text,
"54 holes" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Who were the runner(s)-up when Tiger won by 11 strokes? | SELECT "Runner(s)-up" FROM table_16888 WHERE "Margin of victory" = '11 strokes' |
CREATE TABLE table_15187735_8 (
segment_a VARCHAR,
series_ep VARCHAR
) | Name the segment a for 8-08 | SELECT segment_a FROM table_15187735_8 WHERE series_ep = "8-08" |
CREATE TABLE table_25276250_3 (
outputs VARCHAR,
notes VARCHAR
) | How many outputs are there for solid state, battery operated for portable use listed in notes? | SELECT COUNT(outputs) FROM table_25276250_3 WHERE notes = "Solid state, battery operated for portable use" |
CREATE TABLE table_24990183_7 (
name VARCHAR,
rank VARCHAR
) | If the rank is 17, what are the names? | SELECT name FROM table_24990183_7 WHERE rank = 17 |
CREATE TABLE table_name_51 (
reservation VARCHAR
) | What is the 1979 number for Standing Rock Indian Reservation when the 1989 is less than 54.9? | SELECT SUM(1979) FROM table_name_51 WHERE reservation = "standing rock indian reservation" AND 1989 < 54.9 |
CREATE TABLE table_49308 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What is Opponent, when Attendance is 58,836? | SELECT "Opponent" FROM table_49308 WHERE "Attendance" = '58,836' |
CREATE TABLE table_41893 (
"Name" text,
"Level" real,
"Digits" real,
"Average size (square miles)" text,
"Number of HUs (approximate)" real,
"Example name" text,
"Example code (HUC)" real
) | What is the mean huc example code when the example name's lower snake, there are 6 digits, and less than 3 levels? | SELECT AVG("Example code (HUC)") FROM table_41893 WHERE "Example name" = 'lower snake' AND "Digits" = '6' AND "Level" < '3' |
CREATE TABLE table_29572 (
"Name/Name of Act" text,
"Age(s)" text,
"Genre" text,
"Act" text,
"Hometown" text,
"Qtr. Final (Week)" real,
"Semi Final (Week)" text,
"Position Reached" text
) | What is the quarterfinal week for Austin Anderson? | SELECT MIN("Qtr. Final (Week)") FROM table_29572 WHERE "Name/Name of Act" = 'Austin Anderson' |
CREATE TABLE table_30696 (
"Reservoir" text,
"Basin" text,
"Location" text,
"Type" text,
"Height (m)" text,
"Length along the top (m)" text,
"Drainage basin (km\u00b2)" text,
"Reservoir surface (ha)" text,
"Volume (hm\u00b3)" text
) | What is the volume when the resrvoir is Tanes? | SELECT "Volume (hm\u00b3)" FROM table_30696 WHERE "Reservoir" = 'Tanes' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | provide the number of patients whose days of hospital stay is greater than 23 and drug code is acyc400? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "23" AND prescriptions.formulary_drug_cd = "ACYC400" |
CREATE TABLE table_23576 (
"Story #" real,
"Target #" text,
"Title" text,
"Author" text,
"Reader" text,
"Format" text,
"Company" text,
"Release Date" text,
"Notes" text
) | What's the title of the audio book with story number 91? | SELECT "Title" FROM table_23576 WHERE "Story #" = '91' |
CREATE TABLE table_name_9 (
class VARCHAR,
erp_w VARCHAR
) | What class is ERP W of 800? | SELECT class FROM table_name_9 WHERE erp_w = 800 |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | tell me the cost of the diagnosis for smoking cessation counseling given? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'smoking cessation counseling given') |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | what is the total number of patients who were diagnosed with icd9 code 2254? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "2254" |
CREATE TABLE station (
id number,
network_name text,
services text,
local_authority text
)
CREATE TABLE route (
train_id number,
station_id number
)
CREATE TABLE weekly_weather (
station_id number,
day_of_week text,
high_temperature number,
low_temperature number,
precipita... | Give me the maximum low temperature and average precipitation at the Amersham station. | SELECT MAX(t1.low_temperature), AVG(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id WHERE t2.network_name = "Amersham" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.