answer
stringlengths 6
3.91k
| question
stringlengths 7
766
| context
stringlengths 27
7.14k
|
---|---|---|
SELECT team FROM elimination GROUP BY team HAVING COUNT(*) > 3 | Which teams had more than 3 eliminations? | 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
) |
SELECT incumbent FROM table_1341604_19 WHERE first_elected = 1976 | Who's the incumbent in the district first elected in 1976? | CREATE TABLE table_1341604_19 (incumbent VARCHAR, first_elected VARCHAR) |
SELECT Official_Name FROM city WHERE Population > 1500 OR Population < 500 | Find the official names of cities with population bigger than 1500 or smaller than 500. | CREATE TABLE city (Official_Name VARCHAR, Population VARCHAR) |
SELECT COUNT("name") FROM table_204_910 WHERE "result" > (SELECT "result" FROM table_204_910 WHERE "name" = 'tatyana bocharova') | how many athletes had a better result than tatyana bocharova ? | CREATE TABLE table_204_910 (
id number,
"rank" number,
"name" text,
"nationality" text,
"result" number,
"notes" text
) |
SELECT incumbent FROM table_1341604_22 WHERE district = "Massachusetts 2" | what's the incumbent with district being massachusetts 2 | CREATE TABLE table_1341604_22 (incumbent VARCHAR, district VARCHAR) |
SELECT Census_Ranking FROM city WHERE Status <> "Village" | Show the census ranking of cities whose status are not "Village". | CREATE TABLE city (Census_Ranking VARCHAR, Status VARCHAR) |
SELECT "Type" FROM table_8430 WHERE "Capacity" = '28 passengers' AND "Number" = '16' | Which Type has a Capacity of 28 passengers, and a Number of 16? | CREATE TABLE table_8430 (
"Number" text,
"Builder" text,
"Type" text,
"Date" real,
"Length" text,
"Capacity" text
) |
SELECT party FROM table_1341604_22 WHERE candidates = "Silvio Conte (R) Unopposed" | what's the party with candidates being silvio conte (r) unopposed | CREATE TABLE table_1341604_22 (party VARCHAR, candidates VARCHAR) |
SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY COUNT(*) DESC LIMIT 1 | which course has most number of registered students? | CREATE TABLE courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE student_course_registrations (course_Id VARCHAR) |
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 | Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name. | 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,
num_of_audience number
) |
SELECT first_elected FROM table_1341604_22 WHERE incumbent = "Joseph D. Early" | what's the first elected with incumbent being joseph d. early | CREATE TABLE table_1341604_22 (first_elected VARCHAR, incumbent VARCHAR) |
SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY COUNT(*) LIMIT 1 | what is id of students who registered some courses but the least number of courses in these students? | CREATE TABLE student_course_registrations (student_id VARCHAR) |
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') | is a 2 credit full house the same as a 5 credit three of a kind ? | CREATE TABLE table_203_564 (
id number,
"hand" text,
"1 credit" number,
"2 credits" number,
"3 credits" number,
"4 credits" number,
"5 credits" number
) |
SELECT party FROM table_1341604_22 WHERE district = "Massachusetts 3" | what's the party with dbeingtrict being massachusetts 3 | CREATE TABLE table_1341604_22 (party VARCHAR, district VARCHAR) |
SELECT T2.first_name, T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id | what are the first name and last name of all candidates? | CREATE TABLE candidates (candidate_id VARCHAR); CREATE TABLE people (first_name VARCHAR, last_name VARCHAR, person_id VARCHAR) |
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.number = 510 AND semester.semester = 'FA' AND semester.year = 2016 | Next semester , what time does the EDUC 510 lecture begin ? | 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,
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_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
) |
SELECT COUNT(candidates) FROM table_1341604_39 WHERE incumbent = "Bud Shuster" | How many candidates won the election in the district whose incumbent is Bud Shuster? | CREATE TABLE table_1341604_39 (candidates VARCHAR, incumbent VARCHAR) |
SELECT student_id FROM students WHERE NOT student_id IN (SELECT student_id FROM student_course_attendance) | List the id of students who never attends courses? | CREATE TABLE student_course_attendance (student_id VARCHAR); CREATE TABLE students (student_id VARCHAR) |
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 | 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. | 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
) |
SELECT candidates FROM table_1341604_39 WHERE incumbent = "Gus Yatron" | What are the candidates in the district whose incumbent is Gus Yatron? | CREATE TABLE table_1341604_39 (candidates VARCHAR, incumbent VARCHAR) |
SELECT student_id FROM student_course_attendance | List the id of students who attended some courses? | CREATE TABLE student_course_attendance (student_id VARCHAR) |
SELECT MAX(round) FROM table_name_18 WHERE school = "northwestern" | What was the highest round that had northwestern? | CREATE TABLE table_name_18 (
round INTEGER,
school VARCHAR
) |
SELECT party FROM table_1341604_39 WHERE district = "Pennsylvania 6" | What's the winning party in the Pennsylvania 6 district? | CREATE TABLE table_1341604_39 (party VARCHAR, district VARCHAR) |
SELECT T1.student_id, T2.course_name FROM student_course_registrations AS T1 JOIN courses AS T2 ON T1.course_id = T2.course_id | What are the ids of all students for courses and what are the names of those courses? | CREATE TABLE courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE student_course_registrations (student_id VARCHAR, course_id VARCHAR) |
SELECT MIN(wins) FROM table_name_19 WHERE position = "20th" AND poles < 0 | What is the smallest Wins with a Position of 20th, and Poles smaller than 0? | CREATE TABLE table_name_19 (
wins INTEGER,
position VARCHAR,
poles VARCHAR
) |
SELECT candidates FROM table_1341640_39 WHERE party = "Republican" | What candidate is a member of the Republican party? | CREATE TABLE table_1341640_39 (candidates VARCHAR, party VARCHAR) |
SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1 | What is detail of the student who most recently registered course? | CREATE TABLE student_course_registrations (student_id VARCHAR, registration_date VARCHAR); CREATE TABLE students (student_details VARCHAR, student_id VARCHAR) |
SELECT "Mens Singles" FROM table_30306 WHERE "Womens Doubles" = 'Wang Nan Zhang Yining' | Who is listed under mens singles when womens has wang nan zhang yining? | CREATE TABLE table_30306 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) |
SELECT district FROM table_1341640_39 WHERE incumbent = "Ray Musto" | What district is Ray Musto the incumbent of? | CREATE TABLE table_1341640_39 (district VARCHAR, incumbent VARCHAR) |
SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English" | How many students attend course English? | CREATE TABLE student_course_attendance (course_id VARCHAR); CREATE TABLE courses (course_id VARCHAR, course_name VARCHAR) |
SELECT date_incident_start, date_incident_end FROM Behavior_Incident WHERE incident_type_code = "NOISE" | What are the start and end dates for incidents with incident type code 'NOISE'? | CREATE TABLE Behavior_Incident (
date_incident_start VARCHAR,
date_incident_end VARCHAR,
incident_type_code VARCHAR
) |
SELECT COUNT(party) FROM table_1341640_39 WHERE incumbent = "Donald A. Bailey" | How many parties does the incumbent Donald A. Bailey a member of? | CREATE TABLE table_1341640_39 (party VARCHAR, incumbent VARCHAR) |
SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171 | How many courses do the student whose id is 171 attend? | CREATE TABLE courses (course_id VARCHAR); CREATE TABLE student_course_attendance (course_id VARCHAR, student_id VARCHAR) |
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) | 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. | 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),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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 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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
) |
SELECT result FROM table_1341640_39 WHERE district = "Pennsylvania 6" | What was the outcome of the election in Pennsylvania 6 district? | CREATE TABLE table_1341640_39 (result VARCHAR, district VARCHAR) |
SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = "[email protected]" | Find id of the candidate whose email is [email protected]? | CREATE TABLE candidates (candidate_id VARCHAR); CREATE TABLE people (person_id VARCHAR, email_address VARCHAR) |
SELECT "responsible minister(s)" FROM table_204_988 ORDER BY id DESC LIMIT 1 | who is listed as the last responsible mister -lrb- s -rrb- on this chart ? | CREATE TABLE table_204_988 (
id number,
"responsible minister(s)" text,
"crown entities" text,
"monitoring department(s)" text,
"category / type" text,
"empowering legislation" text
) |
SELECT district FROM table_1341640_43 WHERE incumbent = "Al Gore" | Where was Al Gore elected | CREATE TABLE table_1341640_43 (district VARCHAR, incumbent VARCHAR) |
SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1 | Find id of the candidate who most recently accessed the course? | CREATE TABLE candidate_assessments (candidate_id VARCHAR, assessment_date VARCHAR) |
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 | Users with highest reputation both in SO and Math ( geometric mean = average digits). | 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,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
) |
SELECT result FROM table_1341640_43 WHERE first_elected = 1976 | Election results of 1976 | CREATE TABLE table_1341640_43 (result VARCHAR, first_elected VARCHAR) |
SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 | What is detail of the student who registered the most number of courses? | CREATE TABLE students (student_details VARCHAR, student_id VARCHAR); CREATE TABLE student_course_registrations (student_id VARCHAR) |
SELECT series__number FROM table_29747178_2 WHERE directed_by = "John Showalter" | What is the series # when the director is john showalter? | CREATE TABLE table_29747178_2 (
series__number VARCHAR,
directed_by VARCHAR
) |
SELECT incumbent FROM table_1341640_26 WHERE district = "Missouri 1" | What was the incumbent for missouri 1? | CREATE TABLE table_1341640_26 (incumbent VARCHAR, district VARCHAR) |
SELECT T1.student_id, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id | List the id of students who registered some courses and the number of their registered courses? | CREATE TABLE students (student_id VARCHAR); CREATE TABLE student_course_registrations (student_id VARCHAR) |
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" | 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. | 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 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 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
) |
SELECT result FROM table_1341640_14 WHERE first_elected = 1960 | What was the result of the election when someone was first elected in 1960? | CREATE TABLE table_1341640_14 (result VARCHAR, first_elected VARCHAR) |
SELECT T3.course_name, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id | How many registed students do each course have? List course name and the number of their registered students? | CREATE TABLE students (student_id VARCHAR); CREATE TABLE courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE student_course_registrations (course_id VARCHAR, student_id VARCHAR) |
SELECT "Reg. Season" FROM table_19191 WHERE "Playoffs" = 'Conference Semifinals' AND "US Open Cup" = 'Did not qualify' | 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? | CREATE TABLE table_19191 (
"Year" real,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"US Open Cup" text,
"Avg. Attendance" real
) |
SELECT first_elected FROM table_1341640_14 WHERE incumbent = "Phil Crane" | What year was incumbent phil crane first elected? | CREATE TABLE table_1341640_14 (first_elected VARCHAR, incumbent VARCHAR) |
SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = "Pass" | Find id of candidates whose assessment code is "Pass"? | CREATE TABLE candidate_assessments (candidate_id VARCHAR, asessment_outcome_code VARCHAR) |
SELECT SUM("Long") FROM table_37490 WHERE "Loss" > '2' AND "Gain" = '157' AND "Avg/G" < '129' | How much Long has a Loss larger than 2, and a Gain of 157, and an Avg/G smaller than 129? | CREATE TABLE table_37490 (
"Name" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/G" real
) |
SELECT candidates FROM table_1341640_14 WHERE first_elected = 1974 | What candidates were featured in the 1974 election? | CREATE TABLE table_1341640_14 (candidates VARCHAR, first_elected VARCHAR) |
SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = "Fail" | Find the cell mobile number of the candidates whose assessment code is "Fail"? | CREATE TABLE candidates (candidate_id VARCHAR); CREATE TABLE people (cell_mobile_number VARCHAR, person_id VARCHAR); CREATE TABLE candidate_assessments (candidate_id VARCHAR, asessment_outcome_code VARCHAR) |
SELECT SUM("Pages") FROM table_7363 WHERE "Vol. #" < '8' AND "ISBN" = '1-40122-892-5' | How many pages does the edition with a volume # smaller than 8 and an ISBM of 1-40122-892-5 have? | CREATE TABLE table_7363 (
"Vol. #" real,
"Title" text,
"Material collected" text,
"Pages" real,
"ISBN" text
) |
SELECT first_elected FROM table_1341663_19 WHERE incumbent = "Jerry Huckaby" | What year was Jerry Huckaby first elected? | CREATE TABLE table_1341663_19 (first_elected VARCHAR, incumbent VARCHAR) |
SELECT student_id FROM student_course_attendance WHERE course_id = 301 | What are the id of students who registered course 301? | CREATE TABLE student_course_attendance (student_id VARCHAR, course_id VARCHAR) |
SELECT Posts.Id AS "post_link", Posts.Title, Posts.Score AS Score FROM Posts ORDER BY Posts.Score DESC LIMIT 100 | Ranking of questions by score. | 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,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
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 TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
) |
SELECT candidates FROM table_1341663_19 WHERE incumbent = "Dave Treen" | What other cadidate ran against Dave Treen? | CREATE TABLE table_1341663_19 (candidates VARCHAR, incumbent VARCHAR) |
SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1 | What is the id of the student who most recently registered course 301? | CREATE TABLE student_course_attendance (student_id VARCHAR, course_id VARCHAR, date_of_attendance VARCHAR) |
SELECT game FROM table_name_40 WHERE score = "w 90–82 (ot)" | Which Game has a Score of w 90 82 (ot)? | CREATE TABLE table_name_40 (
game VARCHAR,
score VARCHAR
) |
SELECT MIN(first_elected) FROM table_1341663_19 | What year was the earliest first elected? | CREATE TABLE table_1341663_19 (first_elected INTEGER) |
SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id | Find distinct cities of addresses of people? | CREATE TABLE addresses (city VARCHAR, address_id VARCHAR); CREATE TABLE people_addresses (address_id VARCHAR) |
SELECT MAX(crowd) FROM table_name_67 WHERE away_team = "collingwood" | What was the largest crowd when Collingwood was the away team? | CREATE TABLE table_name_67 (
crowd INTEGER,
away_team VARCHAR
) |
SELECT district FROM table_1341663_19 WHERE incumbent = "Dave Treen" | What district did Dave Treen serve? | CREATE TABLE table_1341663_19 (district VARCHAR, incumbent VARCHAR) |
SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id | Find distinct cities of address of students? | CREATE TABLE students (student_id VARCHAR); CREATE TABLE addresses (city VARCHAR, address_id VARCHAR); CREATE TABLE people_addresses (address_id VARCHAR, person_id VARCHAR) |
SELECT COUNT("Cancelled") FROM table_24185 WHERE "Station" = 'Turnham Green' | Name the number of cancelled for turnham green | CREATE TABLE table_24185 (
"Station" text,
"Line" text,
"Planned" real,
"Cancelled" real,
"Proposal" text,
"Details" text
) |
SELECT COUNT(incumbent) FROM table_1341663_11 WHERE first_elected = 1972 | How many sitting politicians were originally elected in 1972? | CREATE TABLE table_1341663_11 (incumbent VARCHAR, first_elected VARCHAR) |
SELECT course_name FROM courses ORDER BY course_name | List the names of courses in alphabetical order? | CREATE TABLE courses (course_name VARCHAR) |
SELECT MAX(attendance) FROM table_name_59 WHERE score = "2:0" AND away = "vida" | What is the highest attendance of the match with a 2:0 score and vida as the away team? | CREATE TABLE table_name_59 (
attendance INTEGER,
score VARCHAR,
away VARCHAR
) |
SELECT party FROM table_1341663_11 WHERE district = "Georgia 6" | In the Georgia 6 district, what is the elected party? | CREATE TABLE table_1341663_11 (party VARCHAR, district VARCHAR) |
SELECT first_name FROM people ORDER BY first_name | List the first names of people in alphabetical order? | CREATE TABLE people (first_name VARCHAR) |
SELECT Name, Seating FROM track WHERE Year_Opened > 2000 | Visualize a pie chart with what are the names and seatings for all tracks opened after 2000? | 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
) |
SELECT result FROM table_1341663_11 WHERE incumbent = "Billy Lee Evans" | In the race involving Billy Lee Evans as the seated Representative, was he elected again? | CREATE TABLE table_1341663_11 (result VARCHAR, incumbent VARCHAR) |
SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance | What are the id of students who registered courses or attended courses? | CREATE TABLE student_course_attendance (student_id VARCHAR); CREATE TABLE student_course_registrations (student_id VARCHAR) |
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 | 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. | 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_city_affected real
) |
SELECT COUNT(party) FROM table_1341663_11 WHERE incumbent = "Dawson Mathis" | How many parties are there in races involving Dawson Mathis? | CREATE TABLE table_1341663_11 (party VARCHAR, incumbent VARCHAR) |
SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121 | Find the id of courses which are registered or attended by student whose id is 121? | CREATE TABLE student_course_attendance (course_id VARCHAR, student_id VARCHAR); CREATE TABLE student_course_registrations (course_id VARCHAR, student_id VARCHAR) |
SELECT AVG(attendance) FROM table_name_44 WHERE record = "37–21–12" AND points < 86 | What is the Attendance of the game with a Record of 37 21 12 and less than 86 Points? | CREATE TABLE table_name_44 (
attendance INTEGER,
record VARCHAR,
points VARCHAR
) |
SELECT district FROM table_1341663_44 WHERE party = "Republican" | Which district is republican? | CREATE TABLE table_1341663_44 (district VARCHAR, party VARCHAR) |
SELECT * FROM student_course_registrations WHERE NOT student_id IN (SELECT student_id FROM student_course_attendance) | What are all info of students who registered courses but not attended courses? | CREATE TABLE student_course_attendance (student_id VARCHAR); CREATE TABLE student_course_registrations (student_id VARCHAR) |
SELECT SUM(yards_per_attempt) FROM table_name_17 WHERE net_yards > 631 | How many yards per attempt have net yards greater than 631? | CREATE TABLE table_name_17 (
yards_per_attempt INTEGER,
net_yards INTEGER
) |
SELECT result FROM table_1341663_44 WHERE incumbent = "George H. Mahon" | Name the result when the incumbent was george h. mahon | CREATE TABLE table_1341663_44 (result VARCHAR, incumbent VARCHAR) |
SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.registration_date | List the id of students who registered course statistics in the order of registration date. | CREATE TABLE student_course_registrations (student_id VARCHAR, course_id VARCHAR, registration_date VARCHAR); CREATE TABLE courses (course_id VARCHAR, course_name VARCHAR) |
SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Josette Orr" | What is the primary disease and diagnosis icd9 code of Josette Orr? | 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 (
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
) |
SELECT incumbent FROM table_1341663_44 WHERE district = "Texas 3" | What was the incumbent of texas 3? | CREATE TABLE table_1341663_44 (incumbent VARCHAR, district VARCHAR) |
SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance | List the id of students who attended statistics courses in the order of attendance date. | CREATE TABLE student_course_attendance (student_id VARCHAR, course_id VARCHAR, date_of_attendance VARCHAR); CREATE TABLE courses (course_id VARCHAR, course_name VARCHAR) |
SELECT COUNT(scores) FROM table_23575917_2 WHERE davids_team = "David Baddiel and Maureen Lipman" | Name the scores for david baddiel and maureen lipman | CREATE TABLE table_23575917_2 (
scores VARCHAR,
davids_team VARCHAR
) |
SELECT incumbent FROM table_1341663_44 WHERE district = "Texas 19" | What was the incumbent for texas 19? | CREATE TABLE table_1341663_44 (incumbent VARCHAR, district VARCHAR) |
SELECT date FROM weather WHERE max_temperature_f > 85 | Give me the dates when the max temperature was higher than 85. | CREATE TABLE weather (date VARCHAR, max_temperature_f INTEGER) |
SELECT role FROM table_name_62 WHERE studio = "mono" AND title = "paradise canyon" | Name the role for mono studio and title of paradise canyon | CREATE TABLE table_name_62 (
role VARCHAR,
studio VARCHAR,
title VARCHAR
) |
SELECT district FROM table_1341663_26 WHERE candidates = "Dick Gephardt (D) 81.9% Lee Buchschacher (R) 18.1%" | Which district has candidates is dick gephardt (d) 81.9% lee buchschacher (r) 18.1%? | CREATE TABLE table_1341663_26 (district VARCHAR, candidates VARCHAR) |
SELECT name FROM station WHERE lat < 37.5 | What are the names of stations that have latitude lower than 37.5? | CREATE TABLE station (name VARCHAR, lat INTEGER) |
SELECT total FROM table_name_24 WHERE finish = "t22" | Name the total with finish of t22 | CREATE TABLE table_name_24 (
total VARCHAR,
finish VARCHAR
) |
SELECT result FROM table_1341663_26 WHERE district = "Missouri 2" | What is the result for the district missouri 2? | CREATE TABLE table_1341663_26 (result VARCHAR, district VARCHAR) |
SELECT city, MAX(lat) FROM station GROUP BY city | For each city, return the highest latitude among its stations. | CREATE TABLE station (city VARCHAR, lat INTEGER) |
SELECT "Location/Attendance" FROM table_3782 WHERE "Opponent" = '@ Boston Bruins' | If the opponent was @ Boston Bruins, what was the Location/Attendance? | CREATE TABLE table_3782 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Location/Attendance" text,
"Record" text
) |
SELECT MIN(first_elected) FROM table_1341663_26 WHERE district = "Missouri 7" | When was the first elected for district missouri 7? | CREATE TABLE table_1341663_26 (first_elected INTEGER, district VARCHAR) |
SELECT start_station_name, end_station_name FROM trip ORDER BY id LIMIT 3 | Give me the start station and end station for the trips with the three oldest id. | CREATE TABLE trip (start_station_name VARCHAR, end_station_name VARCHAR, id VARCHAR) |
SELECT "Ticket price(s)" FROM table_64443 WHERE "Date(s)" = 'september 16, 1986' | What was the ticket price on September 16, 1986? | CREATE TABLE table_64443 (
"Date(s)" text,
"Venue" text,
"City" text,
"Ticket price(s)" text,
"Ticket sold / available" text,
"Ticket grossing" text
) |