instruction
stringlengths
0
1.06k
input
stringlengths
33
7.14k
response
stringlengths
2
4.44k
source
stringclasses
25 values
text
stringlengths
302
8.5k
what's the frequency mhz with city of license being chattanooga, tennessee
CREATE TABLE table_19053 ( "Call sign" text, "Frequency MHz" text, "City of license" text, "ERP W" real, "Height m ( ft )" text, "FCC info" text, "Notes" text )
SELECT "Frequency MHz" FROM table_19053 WHERE "City of license" = 'Chattanooga, Tennessee'
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's the frequency mhz with city of license being chattanooga, tennessee ### Input: CREATE TABLE table_19053 ( "Call sign" text, "Frequency MHz" text, "City of license" text, "ERP W" real, "Height m ( ft )" text, "FCC info" text, "Notes" text ) ### Response: SELECT "Frequency MHz" FROM table_19053 WHERE "City of license" = 'Chattanooga, Tennessee'
What country won in 2004?
CREATE TABLE table_name_74 ( country VARCHAR, year_s__won VARCHAR )
SELECT country FROM table_name_74 WHERE year_s__won = "2004"
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 country won in 2004? ### Input: CREATE TABLE table_name_74 ( country VARCHAR, year_s__won VARCHAR ) ### Response: SELECT country FROM table_name_74 WHERE year_s__won = "2004"
Return a bar chart on how many wines are there for each grape?, and I want to list the total number in desc order.
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT )
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY COUNT(*) 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: Return a bar chart on how many wines are there for each grape?, and I want to list the total number in desc order. ### Input: CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) ### Response: SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY COUNT(*) DESC
How many draws did Mortlake have when the losses were more than 5?
CREATE TABLE table_79351 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real )
SELECT COUNT("Draws") FROM table_79351 WHERE "Losses" > '5' AND "Club" = 'mortlake'
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 draws did Mortlake have when the losses were more than 5? ### Input: CREATE TABLE table_79351 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real ) ### Response: SELECT COUNT("Draws") FROM table_79351 WHERE "Losses" > '5' AND "Club" = 'mortlake'
Show me a bar chart with the product name and their frequency, and show by the y axis in desc please.
CREATE TABLE Contacts ( contact_id INTEGER, customer_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(50), contact_phone VARCHAR(80) ) CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_date DATETIME, order_status_code VARCHAR(15) ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(15), customer_number VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(15), product_name VARCHAR(80), product_price DOUBLE ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, order_quantity VARCHAR(80) )
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name ORDER BY COUNT(product_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: Show me a bar chart with the product name and their frequency, and show by the y axis in desc please. ### Input: CREATE TABLE Contacts ( contact_id INTEGER, customer_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(50), contact_phone VARCHAR(80) ) CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_date DATETIME, order_status_code VARCHAR(15) ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(15), customer_number VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(15), product_name VARCHAR(80), product_price DOUBLE ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, order_quantity VARCHAR(80) ) ### Response: SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name ORDER BY COUNT(product_name) DESC
how many clubs entered competition after 1945 ?
CREATE TABLE table_204_959 ( id number, "club" text, "founded" number, "nickname" text, "location" text, "home ground" text, "entered competition" number, "most recent promotion" number )
SELECT COUNT("club") FROM table_204_959 WHERE "entered competition" > 1945
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 clubs entered competition after 1945 ? ### Input: CREATE TABLE table_204_959 ( id number, "club" text, "founded" number, "nickname" text, "location" text, "home ground" text, "entered competition" number, "most recent promotion" number ) ### Response: SELECT COUNT("club") FROM table_204_959 WHERE "entered competition" > 1945
Where has a Name of zhongornis?
CREATE TABLE table_41410 ( "Name" text, "Status" text, "Authors" text, "Location" text, "Notes" text )
SELECT "Location" FROM table_41410 WHERE "Name" = 'zhongornis'
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 has a Name of zhongornis? ### Input: CREATE TABLE table_41410 ( "Name" text, "Status" text, "Authors" text, "Location" text, "Notes" text ) ### Response: SELECT "Location" FROM table_41410 WHERE "Name" = 'zhongornis'
What is the To par of the Player with a Score of 73-70-71-72=286?
CREATE TABLE table_76987 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
SELECT "To par" FROM table_76987 WHERE "Score" = '73-70-71-72=286'
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 To par of the Player with a Score of 73-70-71-72=286? ### Input: CREATE TABLE table_76987 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) ### Response: SELECT "To par" FROM table_76987 WHERE "Score" = '73-70-71-72=286'
Date of first question with Bounty.
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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) 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 PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) 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 ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( 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 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 PostTags ( PostId number, TagId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
SELECT PostId, MIN(CreationDate) AS DaDate FROM (SELECT PostId, CreationDate FROM Votes WHERE NOT BountyAmount IS NULL AND VoteTypeId = 8) AS B GROUP BY PostId ORDER BY DaDate LIMIT 10
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: Date of first question with Bounty. ### Input: 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) 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 PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) 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 ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( 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 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 PostTags ( PostId number, TagId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) ### Response: SELECT PostId, MIN(CreationDate) AS DaDate FROM (SELECT PostId, CreationDate FROM Votes WHERE NOT BountyAmount IS NULL AND VoteTypeId = 8) AS B GROUP BY PostId ORDER BY DaDate LIMIT 10
what is admission type of subject id 42963?
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT demographic.admission_type FROM demographic WHERE demographic.subject_id = "42963"
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 admission type of subject id 42963? ### 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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Response: SELECT demographic.admission_type FROM demographic WHERE demographic.subject_id = "42963"
What date has a game smaller than 4, and a score of 116-114?
CREATE TABLE table_name_73 ( date VARCHAR, game VARCHAR, score VARCHAR )
SELECT date FROM table_name_73 WHERE game < 4 AND score = "116-114"
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 date has a game smaller than 4, and a score of 116-114? ### Input: CREATE TABLE table_name_73 ( date VARCHAR, game VARCHAR, score VARCHAR ) ### Response: SELECT date FROM table_name_73 WHERE game < 4 AND score = "116-114"
Which champion has a Group Stage LLWS in Russellville?
CREATE TABLE table_name_16 ( champion VARCHAR, llws VARCHAR, city VARCHAR )
SELECT champion FROM table_name_16 WHERE llws = "group stage" AND city = "russellville"
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 champion has a Group Stage LLWS in Russellville? ### Input: CREATE TABLE table_name_16 ( champion VARCHAR, llws VARCHAR, city VARCHAR ) ### Response: SELECT champion FROM table_name_16 WHERE llws = "group stage" AND city = "russellville"
How many ships for the nation with grand total of 20?
CREATE TABLE table_53263 ( "NATO member" text, "Aircraft carriers" text, "Battleships" text, "Cruisers" text, "Escorts" text, "Submarines" text, "Torpedo boat squadrons" text, "s Motor ship / s Naval trawler" text, "Grand Total" real )
SELECT "s Motor ship / s Naval trawler" FROM table_53263 WHERE "Grand Total" = '20'
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 ships for the nation with grand total of 20? ### Input: CREATE TABLE table_53263 ( "NATO member" text, "Aircraft carriers" text, "Battleships" text, "Cruisers" text, "Escorts" text, "Submarines" text, "Torpedo boat squadrons" text, "s Motor ship / s Naval trawler" text, "Grand Total" real ) ### Response: SELECT "s Motor ship / s Naval trawler" FROM table_53263 WHERE "Grand Total" = '20'
can you tell me the cheapest one way fare from BOSTON to SAN FRANCISCO
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description 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 ) 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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) 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 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 code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) 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 fare.fare_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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' 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 = 'BOSTON' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'SAN FRANCISCO' AND FAREalias1.round_trip_required = 'NO' 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 fare.round_trip_required = 'NO' AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.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: can you tell me the cheapest one way fare from BOSTON to SAN FRANCISCO ### Input: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description 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 ) 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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) 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 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 code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) 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 fare.fare_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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' 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 = 'BOSTON' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'SAN FRANCISCO' AND FAREalias1.round_trip_required = 'NO' 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 fare.round_trip_required = 'NO' AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
How many silver medals were won in 1938?
CREATE TABLE table_name_42 ( silver VARCHAR, year VARCHAR )
SELECT silver FROM table_name_42 WHERE year = "1938"
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 silver medals were won in 1938? ### Input: CREATE TABLE table_name_42 ( silver VARCHAR, year VARCHAR ) ### Response: SELECT silver FROM table_name_42 WHERE year = "1938"
Which policy type has the most records in the database?
CREATE TABLE available_policies ( policy_type_code VARCHAR )
SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1
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 policy type has the most records in the database? ### Input: CREATE TABLE available_policies ( policy_type_code VARCHAR ) ### Response: SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1
what is the maximum hospital cost for a patient suffering from acute respiratory failure - due to atelectasis this year?
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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) 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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute respiratory failure - due to atelectasis')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY cost.patienthealthsystemstayid) AS t1
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: what is the maximum hospital cost for a patient suffering from acute respiratory failure - due to atelectasis this year? ### Input: 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) 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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) ### Response: SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute respiratory failure - due to atelectasis')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY cost.patienthealthsystemstayid) AS t1
What Opponent in the final had a Partner of Gast n Etlis?
CREATE TABLE table_name_76 ( opponent_in_the_final VARCHAR, partner VARCHAR )
SELECT opponent_in_the_final FROM table_name_76 WHERE partner = "gastón etlis"
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 Opponent in the final had a Partner of Gast n Etlis? ### Input: CREATE TABLE table_name_76 ( opponent_in_the_final VARCHAR, partner VARCHAR ) ### Response: SELECT opponent_in_the_final FROM table_name_76 WHERE partner = "gastón etlis"
What Time has a Year of 1984?
CREATE TABLE table_name_77 ( time VARCHAR, year VARCHAR )
SELECT time FROM table_name_77 WHERE year = 1984
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 Time has a Year of 1984? ### Input: CREATE TABLE table_name_77 ( time VARCHAR, year VARCHAR ) ### Response: SELECT time FROM table_name_77 WHERE year = 1984
What is the acronym used for Beirut Arab University?
CREATE TABLE table_259 ( "University Name" text, "Acronym" text, "Date founded" real, "Website" text, "Official registration notes" text )
SELECT "Acronym" FROM table_259 WHERE "University Name" = 'Beirut Arab University'
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 acronym used for Beirut Arab University? ### Input: CREATE TABLE table_259 ( "University Name" text, "Acronym" text, "Date founded" real, "Website" text, "Official registration notes" text ) ### Response: SELECT "Acronym" FROM table_259 WHERE "University Name" = 'Beirut Arab University'
How many total laps were ridden when the grid was 7 and the rider rode the Honda CBR600RR?
CREATE TABLE table_name_96 ( laps INTEGER, bike VARCHAR, grid VARCHAR )
SELECT SUM(laps) FROM table_name_96 WHERE bike = "honda cbr600rr" AND grid = 7
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 total laps were ridden when the grid was 7 and the rider rode the Honda CBR600RR? ### Input: CREATE TABLE table_name_96 ( laps INTEGER, bike VARCHAR, grid VARCHAR ) ### Response: SELECT SUM(laps) FROM table_name_96 WHERE bike = "honda cbr600rr" AND grid = 7
How many Established groups have a multicultural sub category?
CREATE TABLE table_58398 ( "Event Name" text, "Established" real, "Category" text, "Sub Category" text, "Main Venue" text )
SELECT COUNT("Established") FROM table_58398 WHERE "Sub Category" = 'multicultural'
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 Established groups have a multicultural sub category? ### Input: CREATE TABLE table_58398 ( "Event Name" text, "Established" real, "Category" text, "Sub Category" text, "Main Venue" text ) ### Response: SELECT COUNT("Established") FROM table_58398 WHERE "Sub Category" = 'multicultural'
until 4 years ago, did patient 027-53836 go to an er?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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(*) > 0 FROM patient WHERE patient.uniquepid = '027-53836' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-4 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: until 4 years ago, did patient 027-53836 go to an er? ### Input: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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(*) > 0 FROM patient WHERE patient.uniquepid = '027-53836' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-4 year')
How many incumbents are in district la-1?
CREATE TABLE table_28188239_1 ( incumbent VARCHAR, district VARCHAR )
SELECT COUNT(incumbent) FROM table_28188239_1 WHERE district = "LA-1"
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 incumbents are in district la-1? ### Input: CREATE TABLE table_28188239_1 ( incumbent VARCHAR, district VARCHAR ) ### Response: SELECT COUNT(incumbent) FROM table_28188239_1 WHERE district = "LA-1"
Name the term in office for liberal and state of sa for ian mclachlan
CREATE TABLE table_70616 ( "Member" text, "Party" text, "Electorate" text, "State" text, "Term in office" text )
SELECT "Term in office" FROM table_70616 WHERE "Party" = 'liberal' AND "State" = 'sa' AND "Member" = 'ian mclachlan'
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 term in office for liberal and state of sa for ian mclachlan ### Input: CREATE TABLE table_70616 ( "Member" text, "Party" text, "Electorate" text, "State" text, "Term in office" text ) ### Response: SELECT "Term in office" FROM table_70616 WHERE "Party" = 'liberal' AND "State" = 'sa' AND "Member" = 'ian mclachlan'
When the Winning score was 9 (69-72-68-70=279), what was the Margin of victory?
CREATE TABLE table_name_66 ( margin_of_victory VARCHAR, winning_score VARCHAR )
SELECT margin_of_victory FROM table_name_66 WHERE winning_score = –9(69 - 72 - 68 - 70 = 279)
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 Winning score was 9 (69-72-68-70=279), what was the Margin of victory? ### Input: CREATE TABLE table_name_66 ( margin_of_victory VARCHAR, winning_score VARCHAR ) ### Response: SELECT margin_of_victory FROM table_name_66 WHERE winning_score = –9(69 - 72 - 68 - 70 = 279)
What wheel arrangement was made in 1910?
CREATE TABLE table_name_1 ( wheel_arrangement VARCHAR, year_made VARCHAR )
SELECT wheel_arrangement FROM table_name_1 WHERE year_made = "1910"
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 wheel arrangement was made in 1910? ### Input: CREATE TABLE table_name_1 ( wheel_arrangement VARCHAR, year_made VARCHAR ) ### Response: SELECT wheel_arrangement FROM table_name_1 WHERE year_made = "1910"
until 08/2105, how many times was prescribed potassium phosphate 3 mmol/ml15 ml inj to patient 022-151182?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-151182')) AND medication.drugname = 'potassium phosphate 3 mmol/ml15 ml inj' AND STRFTIME('%y-%m', medication.drugstarttime) <= '2105-08'
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: until 08/2105, how many times was prescribed potassium phosphate 3 mmol/ml15 ml inj to patient 022-151182? ### Input: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) ### Response: SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-151182')) AND medication.drugname = 'potassium phosphate 3 mmol/ml15 ml inj' AND STRFTIME('%y-%m', medication.drugstarttime) <= '2105-08'
What is the location for the an-12b aircraft?
CREATE TABLE table_42150 ( "Location" text, "Aircraft" text, "Tail number" text, "Aircraft damage" text, "Fatalities" text )
SELECT "Location" FROM table_42150 WHERE "Aircraft" = 'an-12b'
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 location for the an-12b aircraft? ### Input: CREATE TABLE table_42150 ( "Location" text, "Aircraft" text, "Tail number" text, "Aircraft damage" text, "Fatalities" text ) ### Response: SELECT "Location" FROM table_42150 WHERE "Aircraft" = 'an-12b'
List the names and the locations that the enzymes can make an effect.
CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text )
SELECT name, location FROM enzyme
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: List the names and the locations that the enzymes can make an effect. ### Input: CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) ### Response: SELECT name, location FROM enzyme
Tags that shouldn't be used.
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 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 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 PostHistoryTypes ( Id number, Name text ) 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name 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 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTypes ( Id number, Name text ) 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
SELECT t.TagName, p.Body AS Excerpt, DATEDIFF(d, p.LastEditDate, GETDATE()) AS DaysNotEdited FROM Tags AS t INNER JOIN Posts AS p ON t.ExcerptPostId = p.Id WHERE p.Body LIKE 'DO NOT USE%' COLLATE Latin1_General_CI_AI ORDER BY p.LastEditDate
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: Tags that shouldn't be used. ### Input: CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 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 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 PostHistoryTypes ( Id number, Name text ) 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name 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 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTypes ( Id number, Name text ) 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) ### Response: SELECT t.TagName, p.Body AS Excerpt, DATEDIFF(d, p.LastEditDate, GETDATE()) AS DaysNotEdited FROM Tags AS t INNER JOIN Posts AS p ON t.ExcerptPostId = p.Id WHERE p.Body LIKE 'DO NOT USE%' COLLATE Latin1_General_CI_AI ORDER BY p.LastEditDate
what is the highest round for anthony gonzalez?
CREATE TABLE table_name_53 ( round INTEGER, name VARCHAR )
SELECT MAX(round) FROM table_name_53 WHERE name = "anthony gonzalez"
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 highest round for anthony gonzalez? ### Input: CREATE TABLE table_name_53 ( round INTEGER, name VARCHAR ) ### Response: SELECT MAX(round) FROM table_name_53 WHERE name = "anthony gonzalez"
WHAT IS THE RESULT WITH THE BOSTON ROAD TEAM, ON APRIL 23?
CREATE TABLE table_name_68 ( result VARCHAR, road_team VARCHAR, date VARCHAR )
SELECT result FROM table_name_68 WHERE road_team = "boston" AND date = "april 23"
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 RESULT WITH THE BOSTON ROAD TEAM, ON APRIL 23? ### Input: CREATE TABLE table_name_68 ( result VARCHAR, road_team VARCHAR, date VARCHAR ) ### Response: SELECT result FROM table_name_68 WHERE road_team = "boston" AND date = "april 23"
Is there a paper on multiuser receiver and decision feedback ?
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE field ( fieldid int )
SELECT DISTINCT paperkeyphrase.paperid FROM keyphrase, paperkeyphrase WHERE keyphrase.keyphrasename IN ('multiuser receiver', 'decision feedback') GROUP BY paperkeyphrase.paperid HAVING COUNT(DISTINCT keyphrase.keyphraseid) = 1
scholar
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: Is there a paper on multiuser receiver and decision feedback ? ### Input: CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE field ( fieldid int ) ### Response: SELECT DISTINCT paperkeyphrase.paperid FROM keyphrase, paperkeyphrase WHERE keyphrase.keyphrasename IN ('multiuser receiver', 'decision feedback') GROUP BY paperkeyphrase.paperid HAVING COUNT(DISTINCT keyphrase.keyphraseid) = 1
What is the name of the machine that ranked 4th and has 2 wins?
CREATE TABLE table_62713 ( "Year" real, "Class" text, "Team" text, "Machine" text, "Points" real, "Rank" text, "Wins" real )
SELECT "Machine" FROM table_62713 WHERE "Rank" = '4th' AND "Wins" = '2'
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 name of the machine that ranked 4th and has 2 wins? ### Input: CREATE TABLE table_62713 ( "Year" real, "Class" text, "Team" text, "Machine" text, "Points" real, "Rank" text, "Wins" real ) ### Response: SELECT "Machine" FROM table_62713 WHERE "Rank" = '4th' AND "Wins" = '2'
whom is listed first on the chart ?
CREATE TABLE table_204_978 ( id number, "position" number, "nation" number, "number" number, "name" text, "soproni liga" number, "uefa cup" number, "hungarian cup" number, "league cup" number, "total" number )
SELECT "name" FROM table_204_978 WHERE id = 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: whom is listed first on the chart ? ### Input: CREATE TABLE table_204_978 ( id number, "position" number, "nation" number, "number" number, "name" text, "soproni liga" number, "uefa cup" number, "hungarian cup" number, "league cup" number, "total" number ) ### Response: SELECT "name" FROM table_204_978 WHERE id = 1
What are the last names that are used by customers and staff?
CREATE TABLE customer_payments ( customer_id number, datetime_payment time, payment_method_code text, amount_payment number ) CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_phone_number text ) CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, lesson_date time, lesson_time text, price number ) CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text )
SELECT last_name FROM customers INTERSECT SELECT last_name FROM staff
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 last names that are used by customers and staff? ### Input: CREATE TABLE customer_payments ( customer_id number, datetime_payment time, payment_method_code text, amount_payment number ) CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_phone_number text ) CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, lesson_date time, lesson_time text, price number ) CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) ### Response: SELECT last_name FROM customers INTERSECT SELECT last_name FROM staff
What is the average Frequency MHz that is on farwell, texas?
CREATE TABLE table_36370 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" text, "Class" text, "FCC info" text )
SELECT AVG("Frequency MHz") FROM table_36370 WHERE "City of license" = 'farwell, texas'
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 Frequency MHz that is on farwell, texas? ### Input: CREATE TABLE table_36370 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" text, "Class" text, "FCC info" text ) ### Response: SELECT AVG("Frequency MHz") FROM table_36370 WHERE "City of license" = 'farwell, texas'
What are the different reviewer names, movie titles, and stars for every rating where the reviewer had the same name as the director?
CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time )
SELECT DISTINCT T3.name, T2.title, T1.stars FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid JOIN reviewer AS T3 ON T1.rid = T3.rid WHERE T2.director = T3.name
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 different reviewer names, movie titles, and stars for every rating where the reviewer had the same name as the director? ### Input: CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) ### Response: SELECT DISTINCT T3.name, T2.title, T1.stars FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid JOIN reviewer AS T3 ON T1.rid = T3.rid WHERE T2.director = T3.name
what are some good restaurants in the yosemite and mono lake area for french food ?
CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal )
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'yosemite and mono lake area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
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 some good restaurants in the yosemite and mono lake area for french food ? ### Input: CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) ### Response: SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'yosemite and mono lake area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
Who was the driver of the vehicle having class of CM22 and navigator of Macneall?
CREATE TABLE table_name_86 ( driver VARCHAR, class VARCHAR, navigator VARCHAR )
SELECT driver FROM table_name_86 WHERE class = "cm22" AND navigator = "macneall"
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: Who was the driver of the vehicle having class of CM22 and navigator of Macneall? ### Input: CREATE TABLE table_name_86 ( driver VARCHAR, class VARCHAR, navigator VARCHAR ) ### Response: SELECT driver FROM table_name_86 WHERE class = "cm22" AND navigator = "macneall"
Name the general classification for steven kruijswijk
CREATE TABLE table_30922 ( "Stage" real, "Winner" text, "General classification" text, "Mountains Classification" text, "Points classification" text, "Sprints Classification" text, "Team Classification" text )
SELECT "General classification" FROM table_30922 WHERE "Winner" = 'Steven Kruijswijk'
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 general classification for steven kruijswijk ### Input: CREATE TABLE table_30922 ( "Stage" real, "Winner" text, "General classification" text, "Mountains Classification" text, "Points classification" text, "Sprints Classification" text, "Team Classification" text ) ### Response: SELECT "General classification" FROM table_30922 WHERE "Winner" = 'Steven Kruijswijk'
What is the total when the set 1 is 21 25?
CREATE TABLE table_name_95 ( total VARCHAR, set_1 VARCHAR )
SELECT total FROM table_name_95 WHERE set_1 = "21–25"
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 total when the set 1 is 21 25? ### Input: CREATE TABLE table_name_95 ( total VARCHAR, set_1 VARCHAR ) ### Response: SELECT total FROM table_name_95 WHERE set_1 = "21–25"
What was the total fertility rate that had a death rate larger than 7.8?
CREATE TABLE table_name_60 ( total_fertility_rate VARCHAR, deaths INTEGER )
SELECT total_fertility_rate FROM table_name_60 WHERE deaths > 7.8
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 total fertility rate that had a death rate larger than 7.8? ### Input: CREATE TABLE table_name_60 ( total_fertility_rate VARCHAR, deaths INTEGER ) ### Response: SELECT total_fertility_rate FROM table_name_60 WHERE deaths > 7.8
How many patients who stayed in the hospital for more than 7 days have a bilirubin lab test done?
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 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "7" AND lab.label = "Bilirubin"
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 who stayed in the hospital for more than 7 days have a bilirubin lab test done? ### Input: 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 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "7" AND lab.label = "Bilirubin"
Name the least flaps
CREATE TABLE table_24466191_1 ( flaps INTEGER )
SELECT MIN(flaps) FROM table_24466191_1
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 least flaps ### Input: CREATE TABLE table_24466191_1 ( flaps INTEGER ) ### Response: SELECT MIN(flaps) FROM table_24466191_1
Find the name of the club that has the most female students.
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text )
SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1
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: Find the name of the club that has the most female students. ### Input: CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) ### Response: SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1
What is the average Year for the Finish of lost 2001 alcs and the Percentage is over 0.716?
CREATE TABLE table_51640 ( "Year" real, "Franchise" text, "League" text, "Percentage" real, "Finish" text )
SELECT AVG("Year") FROM table_51640 WHERE "Finish" = 'lost 2001 alcs' AND "Percentage" > '0.716'
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 Year for the Finish of lost 2001 alcs and the Percentage is over 0.716? ### Input: CREATE TABLE table_51640 ( "Year" real, "Franchise" text, "League" text, "Percentage" real, "Finish" text ) ### Response: SELECT AVG("Year") FROM table_51640 WHERE "Finish" = 'lost 2001 alcs' AND "Percentage" > '0.716'
Who was the 2007 actor from Moscow for the shipwreck of Leonty Ibayev?
CREATE TABLE table_77486 ( "Actor in London, 2002" text, "Actor in New York, 2006" text, "Actor in Moscow, 2007" text, "Voyage" text, "Shipwreck" text )
SELECT "Actor in Moscow, 2007" FROM table_77486 WHERE "Shipwreck" = 'leonty ibayev'
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 2007 actor from Moscow for the shipwreck of Leonty Ibayev? ### Input: CREATE TABLE table_77486 ( "Actor in London, 2002" text, "Actor in New York, 2006" text, "Actor in Moscow, 2007" text, "Voyage" text, "Shipwreck" text ) ### Response: SELECT "Actor in Moscow, 2007" FROM table_77486 WHERE "Shipwreck" = 'leonty ibayev'
For those records from the products and each product's manufacturer, show me about the distribution of name and price , and group by attribute founder in a bar chart, I want to rank by the y axis from low to high please.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Price
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 records from the products and each product's manufacturer, show me about the distribution of name and price , and group by attribute founder in a bar chart, I want to rank by the y axis from low to high please. ### Input: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) ### Response: SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Price
What country had an opponent of Sampdoria?
CREATE TABLE table_name_44 ( country VARCHAR, opponent VARCHAR )
SELECT country FROM table_name_44 WHERE opponent = "sampdoria"
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 country had an opponent of Sampdoria? ### Input: CREATE TABLE table_name_44 ( country VARCHAR, opponent VARCHAR ) ### Response: SELECT country FROM table_name_44 WHERE opponent = "sampdoria"
What race did the team Mi-Jack Conquest racing win with a pole position of andreas wirth?
CREATE TABLE table_name_16 ( race_name VARCHAR, winning_team VARCHAR, pole_position VARCHAR )
SELECT race_name FROM table_name_16 WHERE winning_team = "mi-jack conquest racing" AND pole_position = "andreas wirth"
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 race did the team Mi-Jack Conquest racing win with a pole position of andreas wirth? ### Input: CREATE TABLE table_name_16 ( race_name VARCHAR, winning_team VARCHAR, pole_position VARCHAR ) ### Response: SELECT race_name FROM table_name_16 WHERE winning_team = "mi-jack conquest racing" AND pole_position = "andreas wirth"
what is the round when the position is (c)?
CREATE TABLE table_62228 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
SELECT MAX("Round") FROM table_62228 WHERE "Position" = '(c)'
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 round when the position is (c)? ### Input: CREATE TABLE table_62228 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) ### Response: SELECT MAX("Round") FROM table_62228 WHERE "Position" = '(c)'
What is the Set 5 with a Set 3 that is 25-23 and a Set 4 that is 23-25?
CREATE TABLE table_41195 ( "Game" real, "Date" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Result (sets)" text, "Result (Pts)" text )
SELECT "Set 5" FROM table_41195 WHERE "Set 3" = '25-23' AND "Set 4" = '23-25'
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 Set 5 with a Set 3 that is 25-23 and a Set 4 that is 23-25? ### Input: CREATE TABLE table_41195 ( "Game" real, "Date" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Result (sets)" text, "Result (Pts)" text ) ### Response: SELECT "Set 5" FROM table_41195 WHERE "Set 3" = '25-23' AND "Set 4" = '23-25'
What is the name of the track that lasts 5:30?
CREATE TABLE table_16103 ( "Date" text, "Album name" text, "Track" text, "Track title" text, "Lyricist" text, "Music genre/style" text, "Major instrument(s)" text, "Lyrics theme/style" text, "Duration" text )
SELECT "Track title" FROM table_16103 WHERE "Duration" = '5:30'
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 name of the track that lasts 5:30? ### Input: CREATE TABLE table_16103 ( "Date" text, "Album name" text, "Track" text, "Track title" text, "Lyricist" text, "Music genre/style" text, "Major instrument(s)" text, "Lyrics theme/style" text, "Duration" text ) ### Response: SELECT "Track title" FROM table_16103 WHERE "Duration" = '5:30'
among the patients diagnosed with hypercalcemia - moderate, calculate the two year survival probability.
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) 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 )
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypercalcemia - moderate' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.diagnosistime) > 2 * 365) AS t2 JOIN patient ON t2.uniquepid = patient.uniquepid
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: among the patients diagnosed with hypercalcemia - moderate, calculate the two year survival probability. ### Input: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) 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 ) ### Response: SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypercalcemia - moderate' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.diagnosistime) > 2 * 365) AS t2 JOIN patient ON t2.uniquepid = patient.uniquepid
Where Award is best actress and Work is first kiss, what is the average Year?
CREATE TABLE table_11359 ( "Year" real, "Organization" text, "Award" text, "Work" text, "Result" text )
SELECT AVG("Year") FROM table_11359 WHERE "Award" = 'best actress' AND "Work" = 'first kiss'
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 Award is best actress and Work is first kiss, what is the average Year? ### Input: CREATE TABLE table_11359 ( "Year" real, "Organization" text, "Award" text, "Work" text, "Result" text ) ### Response: SELECT AVG("Year") FROM table_11359 WHERE "Award" = 'best actress' AND "Work" = 'first kiss'
What was the internet explorer % when firefox was 24.98%?
CREATE TABLE table_name_47 ( internet_explorer VARCHAR, firefox VARCHAR )
SELECT internet_explorer FROM table_name_47 WHERE firefox = "24.98%"
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 internet explorer % when firefox was 24.98%? ### Input: CREATE TABLE table_name_47 ( internet_explorer VARCHAR, firefox VARCHAR ) ### Response: SELECT internet_explorer FROM table_name_47 WHERE firefox = "24.98%"
what are the three most frequent drugs prescribed to the female patients 30s after they have been diagnosed with hypertension nos until 1 year ago in the same hospital visit?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) 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 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_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypertension nos') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id IN (SELECT patients.subject_id FROM patients WHERE patients.gender = 'f') AND admissions.age BETWEEN 30 AND 39 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3
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 are the three most frequent drugs prescribed to the female patients 30s after they have been diagnosed with hypertension nos until 1 year ago in the same hospital visit? ### Input: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) 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 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_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) ### Response: SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypertension nos') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id IN (SELECT patients.subject_id FROM patients WHERE patients.gender = 'f') AND admissions.age BETWEEN 30 AND 39 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3
what is the difference in pick numbers between greg schaum and ed bauer ?
CREATE TABLE table_204_70 ( id number, "pick #" number, "nfl team" text, "player" text, "position" text, "college" text )
SELECT ABS((SELECT "pick #" FROM table_204_70 WHERE "player" = 'greg schaum') - (SELECT "pick #" FROM table_204_70 WHERE "player" = 'ed bauer'))
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: what is the difference in pick numbers between greg schaum and ed bauer ? ### Input: CREATE TABLE table_204_70 ( id number, "pick #" number, "nfl team" text, "player" text, "position" text, "college" text ) ### Response: SELECT ABS((SELECT "pick #" FROM table_204_70 WHERE "player" = 'greg schaum') - (SELECT "pick #" FROM table_204_70 WHERE "player" = 'ed bauer'))
Visualize the relationship between Team_ID and ACC_Percent , and group by attribute ACC_Home.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text )
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Home
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 the relationship between Team_ID and ACC_Percent , and group by attribute ACC_Home. ### Input: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) ### Response: SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Home
Which races did Paul Greifzu win?
CREATE TABLE table_220 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
SELECT "Race Name" FROM table_220 WHERE "Winning driver" = 'Paul Greifzu'
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 races did Paul Greifzu win? ### Input: CREATE TABLE table_220 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text ) ### Response: SELECT "Race Name" FROM table_220 WHERE "Winning driver" = 'Paul Greifzu'
What is the lowest regular GP Larry Courville, who has a PI GP smaller than 0, has?
CREATE TABLE table_56171 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
SELECT MIN("Reg GP") FROM table_56171 WHERE "Player" = 'larry courville' AND "Pl GP" < '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 lowest regular GP Larry Courville, who has a PI GP smaller than 0, has? ### Input: CREATE TABLE table_56171 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real ) ### Response: SELECT MIN("Reg GP") FROM table_56171 WHERE "Player" = 'larry courville' AND "Pl GP" < '0'
give me the number of patients whose marital status is widowed and drug route is oral?
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 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "ORAL"
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: give me the number of patients whose marital status is widowed and drug route is oral? ### Input: 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 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "ORAL"
What is the 1981 value of the Macedonian population with a 1971 number greater than 192 and a 1991 of 1748?
CREATE TABLE table_45667 ( "Macedonian population in Vojvodina" text, "1961" real, "Number 1971" real, "1981" real, "1991" real, "2002" real )
SELECT "1981" FROM table_45667 WHERE "Number 1971" > '192' AND "1991" = '1748'
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 1981 value of the Macedonian population with a 1971 number greater than 192 and a 1991 of 1748? ### Input: CREATE TABLE table_45667 ( "Macedonian population in Vojvodina" text, "1961" real, "Number 1971" real, "1981" real, "1991" real, "2002" real ) ### Response: SELECT "1981" FROM table_45667 WHERE "Number 1971" > '192' AND "1991" = '1748'
When was ron-robert zieler loaned out until ?
CREATE TABLE table_62207 ( "Date From" text, "Date To" text, "Pos." text, "Name" text, "Moving To" text )
SELECT "Date To" FROM table_62207 WHERE "Name" = 'ron-robert zieler'
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: When was ron-robert zieler loaned out until ? ### Input: CREATE TABLE table_62207 ( "Date From" text, "Date To" text, "Pos." text, "Name" text, "Moving To" text ) ### Response: SELECT "Date To" FROM table_62207 WHERE "Name" = 'ron-robert zieler'
What is the appliance at the station in St Neots?
CREATE TABLE table_52855 ( "Station Number" text, "District" text, "Location" text, "Type" text, "Appliances" text, "Registrations" text )
SELECT "Appliances" FROM table_52855 WHERE "Location" = 'st neots'
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 appliance at the station in St Neots? ### Input: CREATE TABLE table_52855 ( "Station Number" text, "District" text, "Location" text, "Type" text, "Appliances" text, "Registrations" text ) ### Response: SELECT "Appliances" FROM table_52855 WHERE "Location" = 'st neots'
How many yardage figures for the player with 72.3 QB rating?
CREATE TABLE table_22989 ( "Name" text, "Completions" real, "Attempts" real, "Completion %" text, "Yards" real, "Touchdowns" real, "Interceptions" real, "QB Rating" text )
SELECT COUNT("Yards") FROM table_22989 WHERE "QB Rating" = '72.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: How many yardage figures for the player with 72.3 QB rating? ### Input: CREATE TABLE table_22989 ( "Name" text, "Completions" real, "Attempts" real, "Completion %" text, "Yards" real, "Touchdowns" real, "Interceptions" real, "QB Rating" text ) ### Response: SELECT COUNT("Yards") FROM table_22989 WHERE "QB Rating" = '72.3'
My top comments (eligible for Pundit badge). Show comments with 10 or more upvotes
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE ReviewTaskTypes ( 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
SELECT ROW_NUMBER() OVER (ORDER BY Score) AS rownum, PostId AS "post_link", Score, Text FROM Comments WHERE UserId = '##userid##' ORDER BY Score DESC
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: My top comments (eligible for Pundit badge). Show comments with 10 or more upvotes ### Input: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE ReviewTaskTypes ( 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) ### Response: SELECT ROW_NUMBER() OVER (ORDER BY Score) AS rownum, PostId AS "post_link", Score, Text FROM Comments WHERE UserId = '##userid##' ORDER BY Score DESC
show me the flights from TORONTO to CINCINNATI
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant 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 time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id 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 code_description ( code varchar, description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) 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 month ( month_number int, month_name text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) 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_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCINNATI' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.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: show me the flights from TORONTO to CINCINNATI ### Input: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant 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 time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id 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 code_description ( code varchar, description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) 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 month ( month_number int, month_name text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) 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_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCINNATI' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
What is Beohari's highest number of electorates?
CREATE TABLE table_name_81 ( number_of_electorates__2009_ INTEGER, name VARCHAR )
SELECT MAX(number_of_electorates__2009_) FROM table_name_81 WHERE name = "beohari"
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 Beohari's highest number of electorates? ### Input: CREATE TABLE table_name_81 ( number_of_electorates__2009_ INTEGER, name VARCHAR ) ### Response: SELECT MAX(number_of_electorates__2009_) FROM table_name_81 WHERE name = "beohari"
name all the nations that did not win any gold medals .
CREATE TABLE table_204_922 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT "nation" FROM table_204_922 WHERE "gold" = 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: name all the nations that did not win any gold medals . ### Input: CREATE TABLE table_204_922 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) ### Response: SELECT "nation" FROM table_204_922 WHERE "gold" = 0
How big (in km2) is the voivodenship also known by the abbreviation KN?
CREATE TABLE table_11656578_2 ( area_km²__1998_ VARCHAR, abbreviation VARCHAR )
SELECT area_km²__1998_ FROM table_11656578_2 WHERE abbreviation = "kn"
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 big (in km2) is the voivodenship also known by the abbreviation KN? ### Input: CREATE TABLE table_11656578_2 ( area_km²__1998_ VARCHAR, abbreviation VARCHAR ) ### Response: SELECT area_km²__1998_ FROM table_11656578_2 WHERE abbreviation = "kn"
cdr score > or equal to 0.5 and < or equal to1
CREATE TABLE table_train_80 ( "id" int, "mini_mental_state_examination_mmse" int, "uncontrolled_diabetes" bool, "glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int, "cornell_scale_for_depression_in_dementia_csdd" int, "clinical_dementia_rating_cdr" float, "age" float, "NOUSE" float )
SELECT * FROM table_train_80 WHERE clinical_dementia_rating_cdr >= 0.5 AND clinical_dementia_rating_cdr <= 1
criteria2sql
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: cdr score > or equal to 0.5 and < or equal to1 ### Input: CREATE TABLE table_train_80 ( "id" int, "mini_mental_state_examination_mmse" int, "uncontrolled_diabetes" bool, "glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int, "cornell_scale_for_depression_in_dementia_csdd" int, "clinical_dementia_rating_cdr" float, "age" float, "NOUSE" float ) ### Response: SELECT * FROM table_train_80 WHERE clinical_dementia_rating_cdr >= 0.5 AND clinical_dementia_rating_cdr <= 1
Which programs were originally broadcast on CITV?
CREATE TABLE table_29566606_11 ( programme VARCHAR, original_channel_s_ VARCHAR )
SELECT programme FROM table_29566606_11 WHERE original_channel_s_ = "CITV"
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 programs were originally broadcast on CITV? ### Input: CREATE TABLE table_29566606_11 ( programme VARCHAR, original_channel_s_ VARCHAR ) ### Response: SELECT programme FROM table_29566606_11 WHERE original_channel_s_ = "CITV"
What station is affiliated with kmgh-tv?
CREATE TABLE table_22338 ( "City of license /Market" text, "Station" text, "Channel ( TV / RF )" text, "Owned Since" real, "Affiliation" text )
SELECT "Affiliation" FROM table_22338 WHERE "Station" = 'KMGH-TV'
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 station is affiliated with kmgh-tv? ### Input: CREATE TABLE table_22338 ( "City of license /Market" text, "Station" text, "Channel ( TV / RF )" text, "Owned Since" real, "Affiliation" text ) ### Response: SELECT "Affiliation" FROM table_22338 WHERE "Station" = 'KMGH-TV'
What was the first series in this list that Jack Orman wrote?
CREATE TABLE table_533 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
SELECT MIN("Series #") FROM table_533 WHERE "Written by" = 'Jack Orman'
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 first series in this list that Jack Orman wrote? ### Input: CREATE TABLE table_533 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) ### Response: SELECT MIN("Series #") FROM table_533 WHERE "Written by" = 'Jack Orman'
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and revenue , and group by attribute founder, and could you list in descending by the y axis?
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T2.Revenue 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 records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and revenue , and group by attribute founder, and could you list in descending by the y axis? ### Input: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) ### Response: SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T2.Revenue DESC
What was the lowest wins in a season less than 1915 with a 7th finish and 0.429 win %?
CREATE TABLE table_name_74 ( wins INTEGER, reds_season VARCHAR, finish VARCHAR, win_percentage VARCHAR )
SELECT MIN(wins) FROM table_name_74 WHERE finish = "7th" AND win_percentage > 0.429 AND reds_season < 1915
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 lowest wins in a season less than 1915 with a 7th finish and 0.429 win %? ### Input: CREATE TABLE table_name_74 ( wins INTEGER, reds_season VARCHAR, finish VARCHAR, win_percentage VARCHAR ) ### Response: SELECT MIN(wins) FROM table_name_74 WHERE finish = "7th" AND win_percentage > 0.429 AND reds_season < 1915
Which country is the safest in terms of the pesticide concentration found in imported foods?
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst text, distst text ) CREATE TABLE resultsdata15 ( sample_pk number, commod text, commtype text, lab text, pestcode text, testclass text, concen number, lod number, conunit text, confmethod text, confmethod2 text, annotate text, quantitate text, mean text, extract text, determin text )
SELECT T1.country FROM sampledata15 AS T1 JOIN resultsdata15 AS T2 ON T1.sample_pk = T2.sample_pk GROUP BY T1.country ORDER BY SUM(T2.concen) LIMIT 1
pesticide
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 country is the safest in terms of the pesticide concentration found in imported foods? ### Input: CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst text, distst text ) CREATE TABLE resultsdata15 ( sample_pk number, commod text, commtype text, lab text, pestcode text, testclass text, concen number, lod number, conunit text, confmethod text, confmethod2 text, annotate text, quantitate text, mean text, extract text, determin text ) ### Response: SELECT T1.country FROM sampledata15 AS T1 JOIN resultsdata15 AS T2 ON T1.sample_pk = T2.sample_pk GROUP BY T1.country ORDER BY SUM(T2.concen) LIMIT 1
i'd like a flight leaving ATLANTA 8 7 and arriving in DENVER colorado 8 7 leaving in the afternoon
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) 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 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 state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE month ( month_number int, month_name 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 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 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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_fare ( flight_id int, fare_id 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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name 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, date_day, days, flight WHERE (((date_day.day_number = 7 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND NOT (flight.arrival_time < flight.departure_time)) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 1200 AND 1800
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'd like a flight leaving ATLANTA 8 7 and arriving in DENVER colorado 8 7 leaving in the afternoon ### Input: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) 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 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 state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE month ( month_number int, month_name 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 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 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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_fare ( flight_id int, fare_id 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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name 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, date_day, days, flight WHERE (((date_day.day_number = 7 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND NOT (flight.arrival_time < flight.departure_time)) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 1200 AND 1800
From whom I got downvotes.
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE 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 ReviewTaskTypes ( Id number, Name text, Description 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 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 ) 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 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
SELECT u.UpVotes + u.DownVotes FROM Users AS u WHERE u.Id = '566193'
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: From whom I got downvotes. ### Input: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE 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 ReviewTaskTypes ( Id number, Name text, Description 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 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 ) 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 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) ### Response: SELECT u.UpVotes + u.DownVotes FROM Users AS u WHERE u.Id = '566193'
Which round has an opponent of Freiburg?
CREATE TABLE table_name_39 ( round VARCHAR, opponent VARCHAR )
SELECT round FROM table_name_39 WHERE opponent = "freiburg"
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 round has an opponent of Freiburg? ### Input: CREATE TABLE table_name_39 ( round VARCHAR, opponent VARCHAR ) ### Response: SELECT round FROM table_name_39 WHERE opponent = "freiburg"
Which payment method is used by most customers?
CREATE TABLE customers ( payment_method VARCHAR )
SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1
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 payment method is used by most customers? ### Input: CREATE TABLE customers ( payment_method VARCHAR ) ### Response: SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1
What was the final score for the game on May 4?
CREATE TABLE table_69876 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
SELECT "Score" FROM table_69876 WHERE "Date" = 'may 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 was the final score for the game on May 4? ### Input: CREATE TABLE table_69876 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) ### Response: SELECT "Score" FROM table_69876 WHERE "Date" = 'may 4'
what is the price for orthopedics consultation?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'orthopedics consultation')
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: what is the price for orthopedics consultation? ### Input: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) ### Response: SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'orthopedics consultation')
Visualize a bar chart for simply displaying the email address of the employee and the corresponding salary.
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) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) 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 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) )
SELECT EMAIL, SALARY FROM employees
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 for simply displaying the email address of the employee and the corresponding salary. ### Input: 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) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) 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 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) ) ### Response: SELECT EMAIL, SALARY FROM employees
what was the only award in 1994 ?
CREATE TABLE table_203_191 ( id number, "year" number, "group" text, "award" text, "result" text, "notes" text )
SELECT "award" FROM table_203_191 WHERE "year" = 1994
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: what was the only award in 1994 ? ### Input: CREATE TABLE table_203_191 ( id number, "year" number, "group" text, "award" text, "result" text, "notes" text ) ### Response: SELECT "award" FROM table_203_191 WHERE "year" = 1994
Which Year(s) of Manufacture has a Quantity larger than 60, and a Number(s) of 7001 7165?
CREATE TABLE table_78837 ( "Class" text, "Number(s)" text, "Quantity" real, "Year(s) of Manufacture" text, "Type" text )
SELECT "Year(s) of Manufacture" FROM table_78837 WHERE "Quantity" > '60' AND "Number(s)" = '7001–7165'
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 Year(s) of Manufacture has a Quantity larger than 60, and a Number(s) of 7001 7165? ### Input: CREATE TABLE table_78837 ( "Class" text, "Number(s)" text, "Quantity" real, "Year(s) of Manufacture" text, "Type" text ) ### Response: SELECT "Year(s) of Manufacture" FROM table_78837 WHERE "Quantity" > '60' AND "Number(s)" = '7001–7165'
Display all comments of a given user.
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( 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 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 PostTypes ( Id number, Name text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) 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 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 PostTags ( PostId number, TagId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) 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 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 )
SELECT Comments.Text FROM Comments WHERE Comments.UserId = @UserId
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: Display all comments of a given user. ### Input: CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( 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 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 PostTypes ( Id number, Name text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) 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 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 PostTags ( PostId number, TagId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) 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 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 ) ### Response: SELECT Comments.Text FROM Comments WHERE Comments.UserId = @UserId
Return a bar chart on how many students participated in tryouts for each college by descennding count?
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) )
SELECT cName, COUNT(*) FROM Tryout GROUP BY cName ORDER BY COUNT(*) 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: Return a bar chart on how many students participated in tryouts for each college by descennding count? ### Input: CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) ### Response: SELECT cName, COUNT(*) FROM Tryout GROUP BY cName ORDER BY COUNT(*) DESC
Show the name, location, open year for all tracks with a seating higher than the average.
CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number ) CREATE TABLE race ( race_id number, name text, class text, date text, track_id text )
SELECT name, location, year_opened FROM track WHERE seating > (SELECT AVG(seating) FROM track)
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: Show the name, location, open year for all tracks with a seating higher than the average. ### Input: CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number ) CREATE TABLE race ( race_id number, name text, class text, date text, track_id text ) ### Response: SELECT name, location, year_opened FROM track WHERE seating > (SELECT AVG(seating) FROM track)
what is gender and admission time of subject id 84129?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, 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 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 demographic.gender, demographic.admittime FROM demographic WHERE demographic.subject_id = "84129"
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 gender and admission time of subject id 84129? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, 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 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 demographic.gender, demographic.admittime FROM demographic WHERE demographic.subject_id = "84129"
If the just cents is 701.96, what is the interval name?
CREATE TABLE table_22720 ( "interval name" text, "size (steps)" real, "size (cents)" real, "just ratio" text, "just (cents)" text, "error" text, "audio" text )
SELECT "interval name" FROM table_22720 WHERE "just (cents)" = '701.96'
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: If the just cents is 701.96, what is the interval name? ### Input: CREATE TABLE table_22720 ( "interval name" text, "size (steps)" real, "size (cents)" real, "just ratio" text, "just (cents)" text, "error" text, "audio" text ) ### Response: SELECT "interval name" FROM table_22720 WHERE "just (cents)" = '701.96'
SELECT TOP 100 DisplayName FROM Users WHERE Location='Russia' and Reputation=(select max(Reputation.
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE VoteTypes ( Id number, Name 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 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 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) 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 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 )
SELECT DisplayName, LastAccessDate, WebsiteUrl, AboutMe FROM Users WHERE Location = 'Russia' ORDER BY Reputation 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: SELECT TOP 100 DisplayName FROM Users WHERE Location='Russia' and Reputation=(select max(Reputation. ### Input: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE VoteTypes ( Id number, Name 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 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 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) 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 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 ) ### Response: SELECT DisplayName, LastAccessDate, WebsiteUrl, AboutMe FROM Users WHERE Location = 'Russia' ORDER BY Reputation LIMIT 100
What score was on July 25?
CREATE TABLE table_36513 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Score" FROM table_36513 WHERE "Date" = 'july 25'
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 score was on July 25? ### Input: CREATE TABLE table_36513 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) ### Response: SELECT "Score" FROM table_36513 WHERE "Date" = 'july 25'
Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.
CREATE TABLE Flight ( departure_date VARCHAR, arrival_date VARCHAR, origin VARCHAR, destination VARCHAR )
SELECT departure_date, arrival_date FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
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: Show me the departure date and arrival date for all flights from Los Angeles to Honolulu. ### Input: CREATE TABLE Flight ( departure_date VARCHAR, arrival_date VARCHAR, origin VARCHAR, destination VARCHAR ) ### Response: SELECT departure_date, arrival_date FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, order in desc by the y axis.
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 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 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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) )
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_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, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, order in desc by the y axis. ### Input: 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 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 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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) ### Response: SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC
What are the distinct names of nurses on call?
CREATE TABLE medication ( code number, name text, brand text, description text ) CREATE TABLE on_call ( nurse number, blockfloor number, blockcode number, oncallstart time, oncallend time ) CREATE TABLE affiliated_with ( physician number, department number, primaryaffiliation boolean ) CREATE TABLE nurse ( employeeid number, name text, position text, registered boolean, ssn number ) CREATE TABLE department ( departmentid number, name text, head number ) CREATE TABLE undergoes ( patient number, procedures number, stay number, dateundergoes time, physician number, assistingnurse number ) CREATE TABLE patient ( ssn number, name text, address text, phone text, insuranceid number, pcp number ) CREATE TABLE trained_in ( physician number, treatment number, certificationdate time, certificationexpires time ) CREATE TABLE prescribes ( physician number, patient number, medication number, date time, appointment number, dose text ) CREATE TABLE stay ( stayid number, patient number, room number, staystart time, stayend time ) CREATE TABLE room ( roomnumber number, roomtype text, blockfloor number, blockcode number, unavailable boolean ) CREATE TABLE block ( blockfloor number, blockcode number ) CREATE TABLE appointment ( appointmentid number, patient number, prepnurse number, physician number, start time, end time, examinationroom text ) CREATE TABLE procedures ( code number, name text, cost number ) CREATE TABLE physician ( employeeid number, name text, position text, ssn number )
SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.employeeid = T2.nurse
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 distinct names of nurses on call? ### Input: CREATE TABLE medication ( code number, name text, brand text, description text ) CREATE TABLE on_call ( nurse number, blockfloor number, blockcode number, oncallstart time, oncallend time ) CREATE TABLE affiliated_with ( physician number, department number, primaryaffiliation boolean ) CREATE TABLE nurse ( employeeid number, name text, position text, registered boolean, ssn number ) CREATE TABLE department ( departmentid number, name text, head number ) CREATE TABLE undergoes ( patient number, procedures number, stay number, dateundergoes time, physician number, assistingnurse number ) CREATE TABLE patient ( ssn number, name text, address text, phone text, insuranceid number, pcp number ) CREATE TABLE trained_in ( physician number, treatment number, certificationdate time, certificationexpires time ) CREATE TABLE prescribes ( physician number, patient number, medication number, date time, appointment number, dose text ) CREATE TABLE stay ( stayid number, patient number, room number, staystart time, stayend time ) CREATE TABLE room ( roomnumber number, roomtype text, blockfloor number, blockcode number, unavailable boolean ) CREATE TABLE block ( blockfloor number, blockcode number ) CREATE TABLE appointment ( appointmentid number, patient number, prepnurse number, physician number, start time, end time, examinationroom text ) CREATE TABLE procedures ( code number, name text, cost number ) CREATE TABLE physician ( employeeid number, name text, position text, ssn number ) ### Response: SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.employeeid = T2.nurse
Which vehicle has a Diagram of 516 or smaller, and a driving motor brake second (dmbs) type.
CREATE TABLE table_11781 ( "Number" text, "Type" text, "Seating" text, "Diagram no" real, "Lot no." real, "Weight" text )
SELECT "Seating" FROM table_11781 WHERE "Diagram no" > '516' AND "Type" = 'driving motor brake second (dmbs)'
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 vehicle has a Diagram of 516 or smaller, and a driving motor brake second (dmbs) type. ### Input: CREATE TABLE table_11781 ( "Number" text, "Type" text, "Seating" text, "Diagram no" real, "Lot no." real, "Weight" text ) ### Response: SELECT "Seating" FROM table_11781 WHERE "Diagram no" > '516' AND "Type" = 'driving motor brake second (dmbs)'