instruction
stringlengths 0
1.06k
| input
stringlengths 33
7.14k
| response
stringlengths 2
4.44k
| source
stringclasses 25
values | text
stringlengths 302
8.5k
|
---|---|---|---|---|
Which player is from Tampa, Florida?
|
CREATE TABLE table_name_68 (
player VARCHAR,
hometown VARCHAR
)
|
SELECT player FROM table_name_68 WHERE hometown = "tampa, florida"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player is from Tampa, Florida? ### Input: CREATE TABLE table_name_68 (
player VARCHAR,
hometown VARCHAR
) ### Response: SELECT player FROM table_name_68 WHERE hometown = "tampa, florida"
|
what is the average age of patients whose marital status is single and primary disease is sepsis?
|
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
)
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid 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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "SEPSIS"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the average age of patients whose marital status is single and primary disease is sepsis? ### Input: 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
)
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid 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
) ### Response: SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "SEPSIS"
|
What are the names of the people who are older 40 but no friends under age 30?
|
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
)
|
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)
|
spider
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names of the people who are older 40 but no friends under age 30? ### Input: CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
) ### Response: 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)
|
Highly viewed questions with no accepted answer.
|
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange 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 VoteTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTags (
PostId number,
TagId 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 PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name 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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId 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 Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
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 ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
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 ReviewTaskStates (
Id number,
Name text,
Description text
)
|
SELECT p.ViewCount, p.Id AS "Post Id", p.Title, p.AnswerCount FROM Posts AS p WHERE p.PostTypeId = 1 AND p.AcceptedAnswerId IS NULL AND p.ClosedDate IS NULL AND p.CommunityOwnedDate IS NULL AND p.AnswerCount = 0 ORDER BY p.ViewCount DESC LIMIT 100
|
sede
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Highly viewed questions with no accepted answer. ### Input: CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange 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 VoteTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTags (
PostId number,
TagId 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 PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name 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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId 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 Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
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 ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
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 ReviewTaskStates (
Id number,
Name text,
Description text
) ### Response: SELECT p.ViewCount, p.Id AS "Post Id", p.Title, p.AnswerCount FROM Posts AS p WHERE p.PostTypeId = 1 AND p.AcceptedAnswerId IS NULL AND p.ClosedDate IS NULL AND p.CommunityOwnedDate IS NULL AND p.AnswerCount = 0 ORDER BY p.ViewCount DESC LIMIT 100
|
Which term in office has an Electorate of hinkler?
|
CREATE TABLE table_name_65 (
term_in_office VARCHAR,
electorate VARCHAR
)
|
SELECT term_in_office FROM table_name_65 WHERE electorate = "hinkler"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which term in office has an Electorate of hinkler? ### Input: CREATE TABLE table_name_65 (
term_in_office VARCHAR,
electorate VARCHAR
) ### Response: SELECT term_in_office FROM table_name_65 WHERE electorate = "hinkler"
|
What is the appointment day for 4 December 2008 vacancy?
|
CREATE TABLE table_name_40 (
date_of_appointment VARCHAR,
date_of_vacancy VARCHAR
)
|
SELECT date_of_appointment FROM table_name_40 WHERE date_of_vacancy = "4 december 2008"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the appointment day for 4 December 2008 vacancy? ### Input: CREATE TABLE table_name_40 (
date_of_appointment VARCHAR,
date_of_vacancy VARCHAR
) ### Response: SELECT date_of_appointment FROM table_name_40 WHERE date_of_vacancy = "4 december 2008"
|
What is the lowest Lane, when Mark is 7.66?
|
CREATE TABLE table_50081 (
"Lane" real,
"Name" text,
"Country" text,
"Mark" text,
"React" real
)
|
SELECT MIN("Lane") FROM table_50081 WHERE "Mark" = '7.66'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest Lane, when Mark is 7.66? ### Input: CREATE TABLE table_50081 (
"Lane" real,
"Name" text,
"Country" text,
"Mark" text,
"React" real
) ### Response: SELECT MIN("Lane") FROM table_50081 WHERE "Mark" = '7.66'
|
How many winning scores were there in the rr donnelley lpga founders cup?
|
CREATE TABLE table_17335602_1 (
winning_score VARCHAR,
tournament VARCHAR
)
|
SELECT COUNT(winning_score) FROM table_17335602_1 WHERE tournament = "RR Donnelley LPGA Founders Cup"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many winning scores were there in the rr donnelley lpga founders cup? ### Input: CREATE TABLE table_17335602_1 (
winning_score VARCHAR,
tournament VARCHAR
) ### Response: SELECT COUNT(winning_score) FROM table_17335602_1 WHERE tournament = "RR Donnelley LPGA Founders Cup"
|
how many patients whose lab test chart time is 2151-12-28 15:30:00?
|
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE 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
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2151-12-28 15:30:00"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose lab test chart time is 2151-12-28 15:30:00? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE 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
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2151-12-28 15:30:00"
|
i want to know the cheapest way to fly from DENVER to OAKLAND
|
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
|
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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'DENVER' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'OAKLAND' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id
|
atis
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i want to know the cheapest way to fly from DENVER to OAKLAND ### Input: CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
) ### Response: 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'DENVER' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'OAKLAND' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id
|
What is the availability of section MILSCI 301 between 11:00 and 1:00 ?
|
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname 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 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 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 gsi (
course_offering_id int,
student_id int
)
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 jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
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 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 offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
|
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '1:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'MILSCI' AND course.number = 301 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016
|
advising
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the availability of section MILSCI 301 between 11:00 and 1:00 ? ### Input: CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname 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 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 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 gsi (
course_offering_id int,
student_id int
)
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 jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
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 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 offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE area (
course_id int,
area varchar
) ### Response: SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '1:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'MILSCI' AND course.number = 301 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016
|
count the number of patients whose diagnosis short title is status autm crd dfbrltr and drug route is im.
|
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
)
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
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status autm crd dfbrltr" AND prescriptions.route = "IM"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose diagnosis short title is status autm crd dfbrltr and drug route is im. ### Input: 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
)
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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status autm crd dfbrltr" AND prescriptions.route = "IM"
|
What team has a national league in 2001?
|
CREATE TABLE table_name_31 (
team VARCHAR,
league VARCHAR,
year VARCHAR
)
|
SELECT team FROM table_name_31 WHERE league = "national" AND year = 2001
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What team has a national league in 2001? ### Input: CREATE TABLE table_name_31 (
team VARCHAR,
league VARCHAR,
year VARCHAR
) ### Response: SELECT team FROM table_name_31 WHERE league = "national" AND year = 2001
|
How many parks are called mt. olympus
|
CREATE TABLE table_2665085_1 (
name VARCHAR,
park VARCHAR
)
|
SELECT COUNT(name) FROM table_2665085_1 WHERE park = "Mt. Olympus"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many parks are called mt. olympus ### Input: CREATE TABLE table_2665085_1 (
name VARCHAR,
park VARCHAR
) ### Response: SELECT COUNT(name) FROM table_2665085_1 WHERE park = "Mt. Olympus"
|
How many players were the running back draft pick for the New England Patriots?
|
CREATE TABLE table_2508633_9 (
player VARCHAR,
nfl_team VARCHAR,
position VARCHAR
)
|
SELECT COUNT(player) FROM table_2508633_9 WHERE nfl_team = "New England Patriots" AND position = "Running back"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many players were the running back draft pick for the New England Patriots? ### Input: CREATE TABLE table_2508633_9 (
player VARCHAR,
nfl_team VARCHAR,
position VARCHAR
) ### Response: SELECT COUNT(player) FROM table_2508633_9 WHERE nfl_team = "New England Patriots" AND position = "Running back"
|
Who was the Centerfold model in the issue in which the Interview subject was Paul Simon?
|
CREATE TABLE table_40079 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"Pictorials" text
)
|
SELECT "Centerfold model" FROM table_40079 WHERE "Interview subject" = 'paul simon'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the Centerfold model in the issue in which the Interview subject was Paul Simon? ### Input: CREATE TABLE table_40079 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"Pictorials" text
) ### Response: SELECT "Centerfold model" FROM table_40079 WHERE "Interview subject" = 'paul simon'
|
what is the yearly maximum intake of pe 24 fs ng that patient 3677 is getting until 11/04/2100?
|
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 prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
|
SELECT MAX(inputevents_cv.amount) 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 = 3677)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pe 24 fs ng' AND d_items.linksto = 'inputevents_cv') AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) <= '2100-11-04' GROUP BY STRFTIME('%y', inputevents_cv.charttime)
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the yearly maximum intake of pe 24 fs ng that patient 3677 is getting until 11/04/2100? ### Input: 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 prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT MAX(inputevents_cv.amount) 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 = 3677)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pe 24 fs ng' AND d_items.linksto = 'inputevents_cv') AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) <= '2100-11-04' GROUP BY STRFTIME('%y', inputevents_cv.charttime)
|
Tag badges per question for each year (all classes, combined score).
|
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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense 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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name 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 PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId 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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskStates (
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 PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
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 SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
|
SELECT YearBadges.Y, CAST(NumQuestions AS FLOAT) / CAST(BadgeScore AS FLOAT) AS Ratio FROM (SELECT SUM(CASE B.Class WHEN 1 THEN 10 WHEN 2 THEN 4 WHEN 3 THEN 1 END) AS BadgeScore, YEAR(Date) AS Y FROM Badges AS B WHERE B.TagBased = 1 AND B.Name = '##TagName##' AND YEAR(B.Date) < 2017 AND YEAR(B.Date) > 2008 GROUP BY YEAR(Date)) AS YearBadges INNER JOIN (SELECT COUNT(PostId) AS NumQuestions, YEAR(CreationDate) AS Y FROM Posts AS P INNER JOIN PostTags AS PT ON PT.PostId = P.Id INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE PostTypeId = 1 AND T.TagName = '##TagName##' GROUP BY YEAR(CreationDate)) AS YearQuestions ON YearQuestions.Y = YearBadges.Y ORDER BY YearBadges.Y
|
sede
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tag badges per question for each year (all classes, combined score). ### Input: 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense 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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name 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 PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId 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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskStates (
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 PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
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 SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
) ### Response: SELECT YearBadges.Y, CAST(NumQuestions AS FLOAT) / CAST(BadgeScore AS FLOAT) AS Ratio FROM (SELECT SUM(CASE B.Class WHEN 1 THEN 10 WHEN 2 THEN 4 WHEN 3 THEN 1 END) AS BadgeScore, YEAR(Date) AS Y FROM Badges AS B WHERE B.TagBased = 1 AND B.Name = '##TagName##' AND YEAR(B.Date) < 2017 AND YEAR(B.Date) > 2008 GROUP BY YEAR(Date)) AS YearBadges INNER JOIN (SELECT COUNT(PostId) AS NumQuestions, YEAR(CreationDate) AS Y FROM Posts AS P INNER JOIN PostTags AS PT ON PT.PostId = P.Id INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE PostTypeId = 1 AND T.TagName = '##TagName##' GROUP BY YEAR(CreationDate)) AS YearQuestions ON YearQuestions.Y = YearBadges.Y ORDER BY YearBadges.Y
|
Which classes do n't have any labs ?
|
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text 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 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 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 gsi (
course_offering_id int,
student_id int
)
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 course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
|
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
|
advising
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which classes do n't have any labs ? ### Input: CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text 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 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 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 gsi (
course_offering_id int,
student_id int
)
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 course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
) ### Response: SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
|
In the Fall or Winter , what courses meet the Core requirement ?
|
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
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 semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
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 course_prerequisite (
pre_course_id int,
course_id int
)
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 instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
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_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
)
|
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_course.category LIKE '%Core%' AND semester.semester IN ('FA', 'WN') AND semester.year = 2016
|
advising
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the Fall or Winter , what courses meet the Core requirement ? ### Input: CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
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 semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
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 course_prerequisite (
pre_course_id int,
course_id int
)
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 instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
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_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
) ### Response: SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_course.category LIKE '%Core%' AND semester.semester IN ('FA', 'WN') AND semester.year = 2016
|
What Opponent has a Site of razorback stadium fayetteville, ar, and a Date of october 7, 1967?
|
CREATE TABLE table_61508 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
)
|
SELECT "Opponent" FROM table_61508 WHERE "Site" = 'razorback stadium • fayetteville, ar' AND "Date" = 'october 7, 1967'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Opponent has a Site of razorback stadium fayetteville, ar, and a Date of october 7, 1967? ### Input: CREATE TABLE table_61508 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
) ### Response: SELECT "Opponent" FROM table_61508 WHERE "Site" = 'razorback stadium • fayetteville, ar' AND "Date" = 'october 7, 1967'
|
What was the To par when the Score was 67-68=135?
|
CREATE TABLE table_7267 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
|
SELECT "To par" FROM table_7267 WHERE "Score" = '67-68=135'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the To par when the Score was 67-68=135? ### Input: CREATE TABLE table_7267 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) ### Response: SELECT "To par" FROM table_7267 WHERE "Score" = '67-68=135'
|
What is the score of match 15?
|
CREATE TABLE table_40525 (
"Match No." text,
"Home Team" text,
"Score" text,
"Away Team" text,
"Attendance" text
)
|
SELECT "Score" FROM table_40525 WHERE "Match No." = '15'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score of match 15? ### Input: CREATE TABLE table_40525 (
"Match No." text,
"Home Team" text,
"Score" text,
"Away Team" text,
"Attendance" text
) ### Response: SELECT "Score" FROM table_40525 WHERE "Match No." = '15'
|
What is the value of D 45 O, when the value of D 41 is r 41 ?
|
CREATE TABLE table_name_60 (
d_45_o VARCHAR,
d_41_√ VARCHAR
)
|
SELECT d_45_o FROM table_name_60 WHERE d_41_√ = "r 41 √"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the value of D 45 O, when the value of D 41 is r 41 ? ### Input: CREATE TABLE table_name_60 (
d_45_o VARCHAR,
d_41_√ VARCHAR
) ### Response: SELECT d_45_o FROM table_name_60 WHERE d_41_√ = "r 41 √"
|
which is the only device to have the flash memory array note ?
|
CREATE TABLE table_204_152 (
id number,
"device" text,
"type" text,
"iops" text,
"interface" text,
"notes" text
)
|
SELECT "device" FROM table_204_152 WHERE "notes" = 'flash memory array'
|
squall
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which is the only device to have the flash memory array note ? ### Input: CREATE TABLE table_204_152 (
id number,
"device" text,
"type" text,
"iops" text,
"interface" text,
"notes" text
) ### Response: SELECT "device" FROM table_204_152 WHERE "notes" = 'flash memory array'
|
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, give me the comparison about the sum of manager_id over the hire_date bin hire_date by time, and sort in descending by the total number.
|
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
|
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: 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, give me the comparison about the sum of manager_id over the hire_date bin hire_date by time, and sort in descending by the total number. ### Input: CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
) ### Response: SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
|
Bar graph to show meter_100 from different meter 700, and display x axis in desc order.
|
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
|
SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700 DESC
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar graph to show meter_100 from different meter 700, and display x axis in desc order. ### Input: CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
) ### Response: SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700 DESC
|
How many sets of marks does Tonioli get in week 3?
|
CREATE TABLE table_18595004_7 (
tonioli VARCHAR,
week__number VARCHAR
)
|
SELECT COUNT(tonioli) FROM table_18595004_7 WHERE week__number = 3
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many sets of marks does Tonioli get in week 3? ### Input: CREATE TABLE table_18595004_7 (
tonioli VARCHAR,
week__number VARCHAR
) ### Response: SELECT COUNT(tonioli) FROM table_18595004_7 WHERE week__number = 3
|
What Norwegian title has 218 pages and Translated Title of Breaking Dawn?
|
CREATE TABLE table_name_37 (
norwegian_title VARCHAR,
pages VARCHAR,
translated_title VARCHAR
)
|
SELECT norwegian_title FROM table_name_37 WHERE pages = 218 AND translated_title = "breaking dawn"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Norwegian title has 218 pages and Translated Title of Breaking Dawn? ### Input: CREATE TABLE table_name_37 (
norwegian_title VARCHAR,
pages VARCHAR,
translated_title VARCHAR
) ### Response: SELECT norwegian_title FROM table_name_37 WHERE pages = 218 AND translated_title = "breaking dawn"
|
What was the date of the game that had a result of Army 16, SMU 14?
|
CREATE TABLE table_28719193_19 (
date VARCHAR,
matchups_results VARCHAR
)
|
SELECT date FROM table_28719193_19 WHERE matchups_results = "Army 16, SMU 14"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date of the game that had a result of Army 16, SMU 14? ### Input: CREATE TABLE table_28719193_19 (
date VARCHAR,
matchups_results VARCHAR
) ### Response: SELECT date FROM table_28719193_19 WHERE matchups_results = "Army 16, SMU 14"
|
What was the latest number in series that was directed by Skip Sudduth?
|
CREATE TABLE table_3769 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
|
SELECT MAX("No. in series") FROM table_3769 WHERE "Directed by" = 'Skip Sudduth'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the latest number in series that was directed by Skip Sudduth? ### Input: CREATE TABLE table_3769 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) ### Response: SELECT MAX("No. in series") FROM table_3769 WHERE "Directed by" = 'Skip Sudduth'
|
What was the score of the home team in the match at Western Oval?
|
CREATE TABLE table_55576 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
|
SELECT "Home team score" FROM table_55576 WHERE "Venue" = 'western oval'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the home team in the match at Western Oval? ### Input: CREATE TABLE table_55576 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) ### Response: SELECT "Home team score" FROM table_55576 WHERE "Venue" = 'western oval'
|
What was the team's league in 2010?
|
CREATE TABLE table_16636344_1 (
league VARCHAR,
year VARCHAR
)
|
SELECT league FROM table_16636344_1 WHERE year = "2010"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the team's league in 2010? ### Input: CREATE TABLE table_16636344_1 (
league VARCHAR,
year VARCHAR
) ### Response: SELECT league FROM table_16636344_1 WHERE year = "2010"
|
How many games has number 61 played in?
|
CREATE TABLE table_37375 (
"Position" text,
"Number" real,
"Name" text,
"Height" text,
"Weight" real,
"Class" text,
"Hometown" text,
"Games\u2191" real
)
|
SELECT MIN("Games\u2191") FROM table_37375 WHERE "Number" = '61'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many games has number 61 played in? ### Input: CREATE TABLE table_37375 (
"Position" text,
"Number" real,
"Name" text,
"Height" text,
"Weight" real,
"Class" text,
"Hometown" text,
"Games\u2191" real
) ### Response: SELECT MIN("Games\u2191") FROM table_37375 WHERE "Number" = '61'
|
Name the number of date for 1-0 record
|
CREATE TABLE table_21091157_1 (
date VARCHAR,
record VARCHAR
)
|
SELECT COUNT(date) FROM table_21091157_1 WHERE record = "1-0"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the number of date for 1-0 record ### Input: CREATE TABLE table_21091157_1 (
date VARCHAR,
record VARCHAR
) ### Response: SELECT COUNT(date) FROM table_21091157_1 WHERE record = "1-0"
|
Where is channel 83 broadcasted?
|
CREATE TABLE table_name_86 (
territory VARCHAR,
channel VARCHAR
)
|
SELECT territory FROM table_name_86 WHERE channel = 83
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where is channel 83 broadcasted? ### Input: CREATE TABLE table_name_86 (
territory VARCHAR,
channel VARCHAR
) ### Response: SELECT territory FROM table_name_86 WHERE channel = 83
|
What was the Date of Week 16?
|
CREATE TABLE table_name_43 (
date VARCHAR,
week VARCHAR
)
|
SELECT date FROM table_name_43 WHERE week = 16
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Date of Week 16? ### Input: CREATE TABLE table_name_43 (
date VARCHAR,
week VARCHAR
) ### Response: SELECT date FROM table_name_43 WHERE week = 16
|
You can give me a bar chart, that groups and counts the country name, list in descending by the the number of country name.
|
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
|
SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME ORDER BY COUNT(COUNTRY_NAME) DESC
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: You can give me a bar chart, that groups and counts the country name, list in descending by the the number of country name. ### Input: 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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
) ### Response: SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME ORDER BY COUNT(COUNTRY_NAME) DESC
|
What is the End of term of the President with an Age at inauguration of 78years, 160days?
|
CREATE TABLE table_name_89 (
end_of_term VARCHAR,
age_at_inauguration VARCHAR
)
|
SELECT end_of_term FROM table_name_89 WHERE age_at_inauguration = "78years, 160days"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the End of term of the President with an Age at inauguration of 78years, 160days? ### Input: CREATE TABLE table_name_89 (
end_of_term VARCHAR,
age_at_inauguration VARCHAR
) ### Response: SELECT end_of_term FROM table_name_89 WHERE age_at_inauguration = "78years, 160days"
|
What is the average Attendance at a game with a Result of w 30-23?
|
CREATE TABLE table_39817 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Attendance" real
)
|
SELECT AVG("Attendance") FROM table_39817 WHERE "Result" = 'w 30-23'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average Attendance at a game with a Result of w 30-23? ### Input: CREATE TABLE table_39817 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Attendance" real
) ### Response: SELECT AVG("Attendance") FROM table_39817 WHERE "Result" = 'w 30-23'
|
how many times has patient 022-20829 been at the intensive care unit until 3 years ago?
|
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
|
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-20829') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-3 year')
|
eicu
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times has patient 022-20829 been at the intensive care unit until 3 years ago? ### Input: CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
) ### Response: SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-20829') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-3 year')
|
When Mark O'meara was the senior player champion in a year greater than 1998, who was the tradition?
|
CREATE TABLE table_name_14 (
the_tradition VARCHAR,
year VARCHAR,
senior_players_championship VARCHAR
)
|
SELECT the_tradition FROM table_name_14 WHERE year > 1998 AND senior_players_championship = "mark o'meara"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When Mark O'meara was the senior player champion in a year greater than 1998, who was the tradition? ### Input: CREATE TABLE table_name_14 (
the_tradition VARCHAR,
year VARCHAR,
senior_players_championship VARCHAR
) ### Response: SELECT the_tradition FROM table_name_14 WHERE year > 1998 AND senior_players_championship = "mark o'meara"
|
how many patients whose age is less than 74 and procedure short title is form cutan ileoureterost?
|
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,
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 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,
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
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "74" AND procedures.short_title = "Form cutan ileoureterost"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose age is less than 74 and procedure short title is form cutan ileoureterost? ### Input: 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,
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 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,
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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "74" AND procedures.short_title = "Form cutan ileoureterost"
|
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of email and department_id , and order from low to high by the y-axis please.
|
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
|
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of email and department_id , and order from low to high by the y-axis please. ### Input: CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
) ### Response: SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
|
Which competition in Budapest, Hungary gave a result of 8th?
|
CREATE TABLE table_36822 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
|
SELECT "Competition" FROM table_36822 WHERE "Position" = '8th' AND "Venue" = 'budapest, hungary'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which competition in Budapest, Hungary gave a result of 8th? ### Input: CREATE TABLE table_36822 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) ### Response: SELECT "Competition" FROM table_36822 WHERE "Position" = '8th' AND "Venue" = 'budapest, hungary'
|
Which Position in 2000 has a Capacity larger than 10,080, and a Venue of central, rechytsa?
|
CREATE TABLE table_36240 (
"Team" text,
"Location" text,
"Venue" text,
"Capacity" real,
"Position in 2000" text
)
|
SELECT "Position in 2000" FROM table_36240 WHERE "Capacity" > '10,080' AND "Venue" = 'central, rechytsa'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Position in 2000 has a Capacity larger than 10,080, and a Venue of central, rechytsa? ### Input: CREATE TABLE table_36240 (
"Team" text,
"Location" text,
"Venue" text,
"Capacity" real,
"Position in 2000" text
) ### Response: SELECT "Position in 2000" FROM table_36240 WHERE "Capacity" > '10,080' AND "Venue" = 'central, rechytsa'
|
What was the finishing time of the Stage that featured a distance of 24.00km and a start time of 21:27?
|
CREATE TABLE table_name_78 (
time VARCHAR,
distance VARCHAR,
start_time VARCHAR
)
|
SELECT time FROM table_name_78 WHERE distance = "24.00km" AND start_time = "21:27"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the finishing time of the Stage that featured a distance of 24.00km and a start time of 21:27? ### Input: CREATE TABLE table_name_78 (
time VARCHAR,
distance VARCHAR,
start_time VARCHAR
) ### Response: SELECT time FROM table_name_78 WHERE distance = "24.00km" AND start_time = "21:27"
|
What label released a record on December 19, 2001?
|
CREATE TABLE table_name_83 (
label VARCHAR,
date VARCHAR
)
|
SELECT label FROM table_name_83 WHERE date = "december 19, 2001"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What label released a record on December 19, 2001? ### Input: CREATE TABLE table_name_83 (
label VARCHAR,
date VARCHAR
) ### Response: SELECT label FROM table_name_83 WHERE date = "december 19, 2001"
|
What year was holly hunter a nominee?
|
CREATE TABLE table_name_30 (
year__ceremony_ VARCHAR,
result VARCHAR,
actor_actress VARCHAR
)
|
SELECT year__ceremony_ FROM table_name_30 WHERE result = "nominee" AND actor_actress = "holly hunter"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was holly hunter a nominee? ### Input: CREATE TABLE table_name_30 (
year__ceremony_ VARCHAR,
result VARCHAR,
actor_actress VARCHAR
) ### Response: SELECT year__ceremony_ FROM table_name_30 WHERE result = "nominee" AND actor_actress = "holly hunter"
|
list the number of patients under the age of 81 whose drug route is ivpca.
|
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 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 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
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.route = "IVPCA"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list the number of patients under the age of 81 whose drug route is ivpca. ### Input: 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 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 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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.route = "IVPCA"
|
at which location has the east west game been played the most ?
|
CREATE TABLE table_203_636 (
id number,
"#" number,
"date" text,
"winner" text,
"score" text,
"location" text,
"notes" text
)
|
SELECT "location" FROM table_203_636 GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1
|
squall
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: at which location has the east west game been played the most ? ### Input: CREATE TABLE table_203_636 (
id number,
"#" number,
"date" text,
"winner" text,
"score" text,
"location" text,
"notes" text
) ### Response: SELECT "location" FROM table_203_636 GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1
|
what's the result with candidates being billy tauzin (d) unopposed
|
CREATE TABLE table_1341586_19 (
result VARCHAR,
candidates VARCHAR
)
|
SELECT result FROM table_1341586_19 WHERE candidates = "Billy Tauzin (D) Unopposed"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the result with candidates being billy tauzin (d) unopposed ### Input: CREATE TABLE table_1341586_19 (
result VARCHAR,
candidates VARCHAR
) ### Response: SELECT result FROM table_1341586_19 WHERE candidates = "Billy Tauzin (D) Unopposed"
|
How many times has the Cornwall HC team, that has scored more than 18 goals, lost ?
|
CREATE TABLE table_67667 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
)
|
SELECT COUNT("Losses") FROM table_67667 WHERE "Team" = 'cornwall hc' AND "Goals For" > '18'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many times has the Cornwall HC team, that has scored more than 18 goals, lost ? ### Input: CREATE TABLE table_67667 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
) ### Response: SELECT COUNT("Losses") FROM table_67667 WHERE "Team" = 'cornwall hc' AND "Goals For" > '18'
|
In the Fall or Winter term are there 500 -level courses ?
|
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
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 course_prerequisite (
pre_course_id int,
course_id int
)
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 semester (
semester_id int,
semester varchar,
year int
)
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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction 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 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 program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
|
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'WN' AND semester.year = 2017)) AND course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester_id = course_offering.semester
|
advising
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the Fall or Winter term are there 500 -level courses ? ### Input: CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
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 course_prerequisite (
pre_course_id int,
course_id int
)
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 semester (
semester_id int,
semester varchar,
year int
)
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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction 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 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 program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
) ### Response: SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'WN' AND semester.year = 2017)) AND course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester_id = course_offering.semester
|
Number of questions and answers by year.
|
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId 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 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 ReviewTaskTypes (
Id number,
Name text,
Description 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 PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId 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 FlagTypes (
Id number,
Name text,
Description text
)
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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange 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 PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
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 ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
|
SELECT YEAR(p.CreationDate) AS Year, COUNT(CASE WHEN PostTypeId = 1 THEN p.Id ELSE NULL END) AS Questions, COUNT(CASE WHEN PostTypeId = 2 THEN p.Id ELSE NULL END) AS Answers FROM Posts AS p WHERE PostTypeId IN (1, 2) GROUP BY YEAR(p.CreationDate)
|
sede
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Number of questions and answers by year. ### Input: CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId 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 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 ReviewTaskTypes (
Id number,
Name text,
Description 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 PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId 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 FlagTypes (
Id number,
Name text,
Description text
)
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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange 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 PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
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 ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
) ### Response: SELECT YEAR(p.CreationDate) AS Year, COUNT(CASE WHEN PostTypeId = 1 THEN p.Id ELSE NULL END) AS Questions, COUNT(CASE WHEN PostTypeId = 2 THEN p.Id ELSE NULL END) AS Answers FROM Posts AS p WHERE PostTypeId IN (1, 2) GROUP BY YEAR(p.CreationDate)
|
Which district is jamie l. whitten from?
|
CREATE TABLE table_1342233_24 (
district VARCHAR,
incumbent VARCHAR
)
|
SELECT district FROM table_1342233_24 WHERE incumbent = "Jamie L. Whitten"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which district is jamie l. whitten from? ### Input: CREATE TABLE table_1342233_24 (
district VARCHAR,
incumbent VARCHAR
) ### Response: SELECT district FROM table_1342233_24 WHERE incumbent = "Jamie L. Whitten"
|
What is the total number of years that have divisions greater than 4?
|
CREATE TABLE table_37506 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text
)
|
SELECT COUNT("Year") FROM table_37506 WHERE "Division" > '4'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of years that have divisions greater than 4? ### Input: CREATE TABLE table_37506 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text
) ### Response: SELECT COUNT("Year") FROM table_37506 WHERE "Division" > '4'
|
Who has rank 5?
|
CREATE TABLE table_65596 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
|
SELECT "Name" FROM table_65596 WHERE "Rank" = '5'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who has rank 5? ### Input: CREATE TABLE table_65596 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) ### Response: SELECT "Name" FROM table_65596 WHERE "Rank" = '5'
|
Name the team that has a song writer named larry spokes.
|
CREATE TABLE table_28243323_1 (
club_name VARCHAR,
writer_composer VARCHAR
)
|
SELECT club_name FROM table_28243323_1 WHERE writer_composer = "Larry Spokes"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the team that has a song writer named larry spokes. ### Input: CREATE TABLE table_28243323_1 (
club_name VARCHAR,
writer_composer VARCHAR
) ### Response: SELECT club_name FROM table_28243323_1 WHERE writer_composer = "Larry Spokes"
|
What is the country that the player is from with +3 to par and score of 74-73=147?
|
CREATE TABLE table_46933 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
|
SELECT "Country" FROM table_46933 WHERE "To par" = '+3' AND "Score" = '74-73=147'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the country that the player is from with +3 to par and score of 74-73=147? ### Input: CREATE TABLE table_46933 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) ### Response: SELECT "Country" FROM table_46933 WHERE "To par" = '+3' AND "Score" = '74-73=147'
|
Tell me the declination for consellaion of ophiuchus and apparent magnitude less than 8.6 with right ascension of 16h47m14.5s
|
CREATE TABLE table_name_55 (
declination___j2000__ VARCHAR,
right_ascension___j2000__ VARCHAR,
constellation VARCHAR,
apparent_magnitude VARCHAR
)
|
SELECT declination___j2000__ FROM table_name_55 WHERE constellation = "ophiuchus" AND apparent_magnitude < 8.6 AND right_ascension___j2000__ = "16h47m14.5s"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the declination for consellaion of ophiuchus and apparent magnitude less than 8.6 with right ascension of 16h47m14.5s ### Input: CREATE TABLE table_name_55 (
declination___j2000__ VARCHAR,
right_ascension___j2000__ VARCHAR,
constellation VARCHAR,
apparent_magnitude VARCHAR
) ### Response: SELECT declination___j2000__ FROM table_name_55 WHERE constellation = "ophiuchus" AND apparent_magnitude < 8.6 AND right_ascension___j2000__ = "16h47m14.5s"
|
Name the runners for longchamp
|
CREATE TABLE table_80449 (
"Race" text,
"Dist (f)" real,
"Course" text,
"Class" text,
"Prize (\u00a3K)" real,
"Odds" text,
"Runners" real,
"Placing" real,
"Margin" text,
"Time" text,
"Jockey" text,
"Trainer" text
)
|
SELECT "Runners" FROM table_80449 WHERE "Course" = 'longchamp'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the runners for longchamp ### Input: CREATE TABLE table_80449 (
"Race" text,
"Dist (f)" real,
"Course" text,
"Class" text,
"Prize (\u00a3K)" real,
"Odds" text,
"Runners" real,
"Placing" real,
"Margin" text,
"Time" text,
"Jockey" text,
"Trainer" text
) ### Response: SELECT "Runners" FROM table_80449 WHERE "Course" = 'longchamp'
|
What was the score for 1911?
|
CREATE TABLE table_37713 (
"Score" text,
"Opposition" text,
"Venue" text,
"City" text,
"Year" real
)
|
SELECT "Score" FROM table_37713 WHERE "Year" = '1911'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score for 1911? ### Input: CREATE TABLE table_37713 (
"Score" text,
"Opposition" text,
"Venue" text,
"City" text,
"Year" real
) ### Response: SELECT "Score" FROM table_37713 WHERE "Year" = '1911'
|
Among patients admitted before 2148, how many of them had pressure ulcer, buttock?
|
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 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,
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2148" AND diagnoses.long_title = "Pressure ulcer, buttock"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Among patients admitted before 2148, how many of them had pressure ulcer, buttock? ### Input: 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 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,
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2148" AND diagnoses.long_title = "Pressure ulcer, buttock"
|
Which city has frequency under 106.5MHz and a callsign of w218ck?
|
CREATE TABLE table_70196 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
|
SELECT "City of license" FROM table_70196 WHERE "Frequency MHz" < '106.5' AND "Call sign" = 'w218ck'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which city has frequency under 106.5MHz and a callsign of w218ck? ### Input: CREATE TABLE table_70196 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) ### Response: SELECT "City of license" FROM table_70196 WHERE "Frequency MHz" < '106.5' AND "Call sign" = 'w218ck'
|
how many of the patients with icd9 code 9229 were discharged for long term care hospital?
|
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 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 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,
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.icd9_code = "9229"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many of the patients with icd9 code 9229 were discharged for long term care hospital? ### Input: 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 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 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,
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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.icd9_code = "9229"
|
What is the status of the county that has a 17.3% poverty rate?
|
CREATE TABLE table_73444 (
"County" text,
"Population" real,
"Unemployment Rate" text,
"Market Income Per Capita" text,
"Poverty Rate" text,
"Status" text
)
|
SELECT "Status" FROM table_73444 WHERE "Poverty Rate" = '17.3%'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the status of the county that has a 17.3% poverty rate? ### Input: CREATE TABLE table_73444 (
"County" text,
"Population" real,
"Unemployment Rate" text,
"Market Income Per Capita" text,
"Poverty Rate" text,
"Status" text
) ### Response: SELECT "Status" FROM table_73444 WHERE "Poverty Rate" = '17.3%'
|
what is the last flight from DALLAS to BOSTON
|
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
|
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time = (SELECT MAX(FLIGHTalias1.departure_time) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, flight AS FLIGHTalias1 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'DALLAS' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'BOSTON' AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code)
|
atis
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the last flight from DALLAS to BOSTON ### Input: CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
) ### Response: 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time = (SELECT MAX(FLIGHTalias1.departure_time) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, flight AS FLIGHTalias1 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'DALLAS' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'BOSTON' AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code)
|
For those employees who did not have any job in the past, find hire_date and the sum of employee_id bin hire_date by time, and visualize them by a bar chart, and rank in asc by the sum employee id please.
|
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
|
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID)
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, find hire_date and the sum of employee_id bin hire_date by time, and visualize them by a bar chart, and rank in asc by the sum employee id please. ### Input: CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
) ### Response: SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID)
|
What is the score of the hard court Ramat Hasharon tournament?
|
CREATE TABLE table_79660 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in final" text,
"Score" text,
"Prize Money" text
)
|
SELECT "Score" FROM table_79660 WHERE "Surface" = 'hard' AND "Tournament" = 'ramat hasharon'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score of the hard court Ramat Hasharon tournament? ### Input: CREATE TABLE table_79660 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in final" text,
"Score" text,
"Prize Money" text
) ### Response: SELECT "Score" FROM table_79660 WHERE "Surface" = 'hard' AND "Tournament" = 'ramat hasharon'
|
Where is the school whose students are nicknamed Panthers located?
|
CREATE TABLE table_23182 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real
)
|
SELECT "Location" FROM table_23182 WHERE "Nickname" = 'Panthers'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where is the school whose students are nicknamed Panthers located? ### Input: CREATE TABLE table_23182 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real
) ### Response: SELECT "Location" FROM table_23182 WHERE "Nickname" = 'Panthers'
|
Find those themes and years for all exhibitions with ticket prices lower than 15, group by themes, count year, and the x-axis is Year, show from low to high by the y-axis.
|
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
|
SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Theme ORDER BY COUNT(Year)
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find those themes and years for all exhibitions with ticket prices lower than 15, group by themes, count year, and the x-axis is Year, show from low to high by the y-axis. ### Input: CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
) ### Response: SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Theme ORDER BY COUNT(Year)
|
What lane is David Carry in heat 1?
|
CREATE TABLE table_name_80 (
lane VARCHAR,
heat VARCHAR,
name VARCHAR
)
|
SELECT COUNT(lane) FROM table_name_80 WHERE heat = 1 AND name = "david carry"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What lane is David Carry in heat 1? ### Input: CREATE TABLE table_name_80 (
lane VARCHAR,
heat VARCHAR,
name VARCHAR
) ### Response: SELECT COUNT(lane) FROM table_name_80 WHERE heat = 1 AND name = "david carry"
|
Recommend human computer interaction courses which are easier than HISTORY 195 .
|
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_prerequisite (
pre_course_id int,
course_id 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 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 ta (
campus_job_id int,
student_id int,
location 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 area (
course_id int,
area 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 offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
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 program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
|
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE area.area LIKE '%human computer interaction%' AND program_course.workload < (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1 INNER JOIN program_course AS PROGRAM_COURSEalias1 ON PROGRAM_COURSEalias1.course_id = COURSEalias1.course_id WHERE COURSEalias1.department = 'HISTORY' AND COURSEalias1.number = 195) ORDER BY program_course.workload
|
advising
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Recommend human computer interaction courses which are easier than HISTORY 195 . ### Input: 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_prerequisite (
pre_course_id int,
course_id 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 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 ta (
campus_job_id int,
student_id int,
location 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 area (
course_id int,
area 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 offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
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 program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
) ### Response: SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE area.area LIKE '%human computer interaction%' AND program_course.workload < (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1 INNER JOIN program_course AS PROGRAM_COURSEalias1 ON PROGRAM_COURSEalias1.course_id = COURSEalias1.course_id WHERE COURSEalias1.department = 'HISTORY' AND COURSEalias1.number = 195) ORDER BY program_course.workload
|
Visualize a bar chart about the distribution of name and ID .
|
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
|
SELECT name, ID FROM swimmer
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart about the distribution of name and ID . ### Input: CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
) ### Response: SELECT name, ID FROM swimmer
|
Which Manufacturer has a Laps of 21, a Grid larger than 16, and a Rider of akira ry ?
|
CREATE TABLE table_49829 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
|
SELECT "Manufacturer" FROM table_49829 WHERE "Laps" = '21' AND "Grid" > '16' AND "Rider" = 'akira ryō'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Manufacturer has a Laps of 21, a Grid larger than 16, and a Rider of akira ry ? ### Input: CREATE TABLE table_49829 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) ### Response: SELECT "Manufacturer" FROM table_49829 WHERE "Laps" = '21' AND "Grid" > '16' AND "Rider" = 'akira ryō'
|
Date of october 10, 1965 had what lowest attendance?
|
CREATE TABLE table_36261 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real
)
|
SELECT MIN("Attendance") FROM table_36261 WHERE "Date" = 'october 10, 1965'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Date of october 10, 1965 had what lowest attendance? ### Input: CREATE TABLE table_36261 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real
) ### Response: SELECT MIN("Attendance") FROM table_36261 WHERE "Date" = 'october 10, 1965'
|
for patients who received spinal struct repair nec until 3 years ago, what are the top four most frequent specimens tested afterwards within 2 months?
|
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
|
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'spinal struct repair nec') AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t2.charttime) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 4
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: for patients who received spinal struct repair nec until 3 years ago, what are the top four most frequent specimens tested afterwards within 2 months? ### Input: 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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
) ### Response: SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'spinal struct repair nec') AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t2.charttime) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 4
|
how many townships have no water area ?
|
CREATE TABLE table_203_459 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
)
|
SELECT COUNT("township") FROM table_203_459 WHERE "water area\nkm2 (sq mi)" = 0
|
squall
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many townships have no water area ? ### Input: CREATE TABLE table_203_459 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
) ### Response: SELECT COUNT("township") FROM table_203_459 WHERE "water area\nkm2 (sq mi)" = 0
|
what is the years when playoffs is 115?
|
CREATE TABLE table_76763 (
"Name" text,
"Years" text,
"Regular season" real,
"Playoffs" real,
"Total" real
)
|
SELECT "Years" FROM table_76763 WHERE "Playoffs" = '115'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the years when playoffs is 115? ### Input: CREATE TABLE table_76763 (
"Name" text,
"Years" text,
"Regular season" real,
"Playoffs" real,
"Total" real
) ### Response: SELECT "Years" FROM table_76763 WHERE "Playoffs" = '115'
|
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and salary in a bar chart, could you sort by the names in asc?
|
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
|
SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and salary in a bar chart, could you sort by the names in asc? ### Input: 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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
) ### Response: SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
|
What pick was roger holdinsky?
|
CREATE TABLE table_name_26 (
pick VARCHAR,
player VARCHAR
)
|
SELECT pick FROM table_name_26 WHERE player = "roger holdinsky"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What pick was roger holdinsky? ### Input: CREATE TABLE table_name_26 (
pick VARCHAR,
player VARCHAR
) ### Response: SELECT pick FROM table_name_26 WHERE player = "roger holdinsky"
|
When the result was l 13-7 ot, who was the opponent?
|
CREATE TABLE table_name_27 (
opponent VARCHAR,
result VARCHAR
)
|
SELECT opponent FROM table_name_27 WHERE result = "l 13-7 ot"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the result was l 13-7 ot, who was the opponent? ### Input: CREATE TABLE table_name_27 (
opponent VARCHAR,
result VARCHAR
) ### Response: SELECT opponent FROM table_name_27 WHERE result = "l 13-7 ot"
|
What country was the Pegasus, build by Royal Dockyard, from?
|
CREATE TABLE table_65524 (
"Country" text,
"Builder" text,
"Location" text,
"Ship" text,
"Class / type" text
)
|
SELECT "Country" FROM table_65524 WHERE "Builder" = 'royal dockyard' AND "Ship" = 'pegasus'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What country was the Pegasus, build by Royal Dockyard, from? ### Input: CREATE TABLE table_65524 (
"Country" text,
"Builder" text,
"Location" text,
"Ship" text,
"Class / type" text
) ### Response: SELECT "Country" FROM table_65524 WHERE "Builder" = 'royal dockyard' AND "Ship" = 'pegasus'
|
Can you draw a bar chart to show the number of positions of the pilots?
|
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot (
Pilot_ID int,
Pilot_name text,
Rank int,
Age int,
Nationality text,
Position text,
Join_Year int,
Team text
)
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
)
|
SELECT Position, COUNT(Position) FROM pilot GROUP BY Position
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you draw a bar chart to show the number of positions of the pilots? ### Input: CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot (
Pilot_ID int,
Pilot_name text,
Rank int,
Age int,
Nationality text,
Position text,
Join_Year int,
Team text
)
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
) ### Response: SELECT Position, COUNT(Position) FROM pilot GROUP BY Position
|
What are the names of the all-female dorms?
|
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
|
SELECT dorm_name FROM dorm WHERE gender = 'F'
|
spider
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names of the all-female dorms? ### Input: CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
) ### Response: SELECT dorm_name FROM dorm WHERE gender = 'F'
|
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by weekday, and display by the y-axis from high to low.
|
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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)
)
|
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID) DESC
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by weekday, and display by the y-axis from high to low. ### Input: CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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)
) ### Response: SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID) DESC
|
For each user, return the name and the average rating of reviews given by them. Plot them as pie chart.
|
CREATE TABLE review (
a_id integer,
u_id integer,
i_id integer,
rating integer,
rank integer
)
CREATE TABLE item (
i_id integer,
title varchar(20)
)
CREATE TABLE useracct (
u_id integer,
name varchar(128)
)
CREATE TABLE trust (
source_u_id integer,
target_u_id integer,
trust integer
)
|
SELECT name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For each user, return the name and the average rating of reviews given by them. Plot them as pie chart. ### Input: CREATE TABLE review (
a_id integer,
u_id integer,
i_id integer,
rating integer,
rank integer
)
CREATE TABLE item (
i_id integer,
title varchar(20)
)
CREATE TABLE useracct (
u_id integer,
name varchar(128)
)
CREATE TABLE trust (
source_u_id integer,
target_u_id integer,
trust integer
) ### Response: SELECT name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id
|
What college did john sullivan attend?
|
CREATE TABLE table_name_28 (
college VARCHAR,
player VARCHAR
)
|
SELECT college FROM table_name_28 WHERE player = "john sullivan"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What college did john sullivan attend? ### Input: CREATE TABLE table_name_28 (
college VARCHAR,
player VARCHAR
) ### Response: SELECT college FROM table_name_28 WHERE player = "john sullivan"
|
What NHL team picked richard borgo?
|
CREATE TABLE table_2897457_2 (
nhl_team VARCHAR,
player VARCHAR
)
|
SELECT nhl_team FROM table_2897457_2 WHERE player = "Richard Borgo"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What NHL team picked richard borgo? ### Input: CREATE TABLE table_2897457_2 (
nhl_team VARCHAR,
player VARCHAR
) ### Response: SELECT nhl_team FROM table_2897457_2 WHERE player = "Richard Borgo"
|
What is the lowest ERP W of w223bp?
|
CREATE TABLE table_name_6 (
erp_w INTEGER,
call_sign VARCHAR
)
|
SELECT MIN(erp_w) FROM table_name_6 WHERE call_sign = "w223bp"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest ERP W of w223bp? ### Input: CREATE TABLE table_name_6 (
erp_w INTEGER,
call_sign VARCHAR
) ### Response: SELECT MIN(erp_w) FROM table_name_6 WHERE call_sign = "w223bp"
|
Which position did David Nugent play with an overall small than 187?
|
CREATE TABLE table_name_79 (
position VARCHAR,
overall VARCHAR,
player VARCHAR
)
|
SELECT position FROM table_name_79 WHERE overall > 187 AND player = "david nugent"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which position did David Nugent play with an overall small than 187? ### Input: CREATE TABLE table_name_79 (
position VARCHAR,
overall VARCHAR,
player VARCHAR
) ### Response: SELECT position FROM table_name_79 WHERE overall > 187 AND player = "david nugent"
|
Name the year that Birds of a feather category for most popular actress was nominated
|
CREATE TABLE table_name_57 (
year INTEGER,
category VARCHAR,
nominated_for VARCHAR
)
|
SELECT AVG(year) FROM table_name_57 WHERE category = "most popular actress" AND nominated_for = "birds of a feather"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the year that Birds of a feather category for most popular actress was nominated ### Input: CREATE TABLE table_name_57 (
year INTEGER,
category VARCHAR,
nominated_for VARCHAR
) ### Response: SELECT AVG(year) FROM table_name_57 WHERE category = "most popular actress" AND nominated_for = "birds of a feather"
|
what is average age of patients whose admission type is emergency and primary disease is bladder cancer/sda?
|
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
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid 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
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
|
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BLADDER CANCER/SDA"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is average age of patients whose admission type is emergency and primary disease is bladder cancer/sda? ### Input: 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
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid 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
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BLADDER CANCER/SDA"
|
Which satellite was launched from Vandenberg?
|
CREATE TABLE table_name_5 (
satellite VARCHAR,
launch_site VARCHAR
)
|
SELECT satellite FROM table_name_5 WHERE launch_site = "vandenberg"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which satellite was launched from Vandenberg? ### Input: CREATE TABLE table_name_5 (
satellite VARCHAR,
launch_site VARCHAR
) ### Response: SELECT satellite FROM table_name_5 WHERE launch_site = "vandenberg"
|
Name the awardees for best special effects
|
CREATE TABLE table_3058 (
"Name of Award" text,
"Name of Film" text,
"Language" text,
"Awardee(s)" text,
"Cash Prize" text
)
|
SELECT "Awardee(s)" FROM table_3058 WHERE "Name of Award" = 'Best Special Effects'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the awardees for best special effects ### Input: CREATE TABLE table_3058 (
"Name of Award" text,
"Name of Film" text,
"Language" text,
"Awardee(s)" text,
"Cash Prize" text
) ### Response: SELECT "Awardee(s)" FROM table_3058 WHERE "Name of Award" = 'Best Special Effects'
|
Count questions not answered per tag count.
|
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 PostHistoryTypes (
Id number,
Name 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 VoteTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 FlagTypes (
Id number,
Name text,
Description 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 ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name 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 PostTags (
PostId number,
TagId number
)
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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
|
SELECT x.total, COUNT(x.Id), CAST(COUNT(x.Id) AS FLOAT) / (SELECT COUNT(Q.Id) FROM Posts AS Q WHERE Q.AnswerCount = 0 AND Q.PostTypeId = 1) FROM (SELECT Q.Id, COUNT(PT.TagId) AS total FROM Posts AS Q INNER JOIN PostTags AS PT ON Q.Id = PT.PostId WHERE Q.AnswerCount = 0 AND Q.PostTypeId = 1 GROUP BY Q.Id) AS x GROUP BY x.total
|
sede
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Count questions not answered per tag count. ### Input: 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 PostHistoryTypes (
Id number,
Name 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 VoteTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 FlagTypes (
Id number,
Name text,
Description 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 ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name 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 PostTags (
PostId number,
TagId number
)
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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
) ### Response: SELECT x.total, COUNT(x.Id), CAST(COUNT(x.Id) AS FLOAT) / (SELECT COUNT(Q.Id) FROM Posts AS Q WHERE Q.AnswerCount = 0 AND Q.PostTypeId = 1) FROM (SELECT Q.Id, COUNT(PT.TagId) AS total FROM Posts AS Q INNER JOIN PostTags AS PT ON Q.Id = PT.PostId WHERE Q.AnswerCount = 0 AND Q.PostTypeId = 1 GROUP BY Q.Id) AS x GROUP BY x.total
|
What is the most wins with 0 byes?
|
CREATE TABLE table_78975 (
"Lexton Plains" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
|
SELECT MAX("Wins") FROM table_78975 WHERE "Byes" > '0'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the most wins with 0 byes? ### Input: CREATE TABLE table_78975 (
"Lexton Plains" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) ### Response: SELECT MAX("Wins") FROM table_78975 WHERE "Byes" > '0'
|
What is Tom Kite with a Score of 68's To Par?
|
CREATE TABLE table_name_92 (
to_par VARCHAR,
score VARCHAR,
player VARCHAR
)
|
SELECT to_par FROM table_name_92 WHERE score = 68 AND player = "tom kite"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Tom Kite with a Score of 68's To Par? ### Input: CREATE TABLE table_name_92 (
to_par VARCHAR,
score VARCHAR,
player VARCHAR
) ### Response: SELECT to_par FROM table_name_92 WHERE score = 68 AND player = "tom kite"
|
What are the dates in which the mean sea level pressure was between 303 and 31, and count them by a bar chart, and order y axis in descending order please.
|
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pressure_inches NUMERIC,
mean_sea_level_pressure_inches NUMERIC,
min_sea_level_pressure_inches NUMERIC,
max_visibility_miles INTEGER,
mean_visibility_miles INTEGER,
min_visibility_miles INTEGER,
max_wind_Speed_mph INTEGER,
mean_wind_speed_mph INTEGER,
max_gust_speed_mph INTEGER,
precipitation_inches INTEGER,
cloud_cover INTEGER,
events TEXT,
wind_dir_degrees INTEGER,
zip_code INTEGER
)
|
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date) DESC
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the dates in which the mean sea level pressure was between 303 and 31, and count them by a bar chart, and order y axis in descending order please. ### Input: CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pressure_inches NUMERIC,
mean_sea_level_pressure_inches NUMERIC,
min_sea_level_pressure_inches NUMERIC,
max_visibility_miles INTEGER,
mean_visibility_miles INTEGER,
min_visibility_miles INTEGER,
max_wind_Speed_mph INTEGER,
mean_wind_speed_mph INTEGER,
max_gust_speed_mph INTEGER,
precipitation_inches INTEGER,
cloud_cover INTEGER,
events TEXT,
wind_dir_degrees INTEGER,
zip_code INTEGER
) ### Response: SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date) DESC
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.