Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: List all the possible ways to get to attractions, together with the number of attractions accessible by these methods. [/INST]

Output: SELECT How_to_Get_There ,  COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There;


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: Show different tourist attractions' names, ids, and the corresponding number of visits. [/INST]

Output: SELECT T1.Name ,  T2.Tourist_Attraction_ID ,   COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID;


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: What are the name, id and the corresponding number of visits for each  tourist attraction? [/INST]

Output: SELECT T1.Name ,  T2.Tourist_Attraction_ID ,   COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID;


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: Show the names and ids of tourist attractions that are visited at least two times. [/INST]

Output: SELECT T1.Name ,  T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  >=  2;


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: Which tourist attractions are visited at least twice? Give me their names and ids. [/INST]

Output: SELECT T1.Name ,  T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  >=  2;


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: Show the names and ids of tourist attractions that are visited at most once. [/INST]

Output: SELECT T1.Name ,  T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  <=  1;


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: What are the names and ids of the tourist attractions that are visited at most once? [/INST]

Output: SELECT T1.Name ,  T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  <=  1;


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: What are the names of tourist attractions that can be reached by walk or is at address 660 Shea Crescent? [/INST]

Output: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "660 Shea Crescent" OR T2.How_to_Get_There  =  "walk";


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: Find the names of the tourist attractions that is either accessible by walk or at address 660 Shea Crescent. [/INST]

Output: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "660 Shea Crescent" OR T2.How_to_Get_There  =  "walk";


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: What are the names of the tourist attractions that have parking or shopping as their feature details? [/INST]

Output: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'shopping';


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: Find the tourist attractions that have parking or shopping as their feature details. What are the names of the attractions? [/INST]

Output: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'shopping';


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction? [/INST]

Output: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "254 Ottilie Junction" OR T2.How_to_Get_There  =  "bus";


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: Find the names of the tourist attractions that is either accessible by bus or at address 254 Ottilie Junction. [/INST]

Output: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "254 Ottilie Junction" OR T2.How_to_Get_There  =  "bus";


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: What are the names of the tourist attractions Vincent and Marcelle visit? [/INST]

Output: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Vincent" INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Marcelle";


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: Which tourist attractions do the tourists Vincent and Marcelle visit? Tell me the names of the attractions. [/INST]

Output: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Vincent" INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Marcelle";


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: What are the names of tourist attraction that Alison visited but Rosalind did not visit? [/INST]

Output: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Alison" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Rosalind";


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: Find the the names of the tourist attractions that the tourist named Alison visited but Rosalind did not visit. [/INST]

Output: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Alison" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Rosalind";


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: How many tourists did not make any visit? [/INST]

Output: SELECT count(*) FROM Visitors WHERE Tourist_ID NOT IN ( SELECT Tourist_ID FROM Visits );


Input:
[INST] Here is a database schema:
Ref_Hotel_Star_Ratings :
star_rating_code [ TEXT ] primary_key
star_rating_description [ TEXT ]

Locations :
Location_ID [ INT ] primary_key
Location_Name [ TEXT ]
Address [ TEXT ]
Other_Details [ TEXT ]

Ref_Attraction_Types :
Attraction_Type_Code [ TEXT ] primary_key
Attraction_Type_Description [ TEXT ]

Visitors :
Tourist_ID [ INT ] primary_key
Tourist_Details [ TEXT ]

Features :
Feature_ID [ INT ] primary_key
Feature_Details [ TEXT ]

Hotels :
hotel_id [ INT ] primary_key
star_rating_code [ TEXT ] Hotels.star_rating_code = Ref_Hotel_Star_Ratings.star_rating_code
pets_allowed_yn [ TEXT ]
price_range [ INT ]
other_hotel_details [ TEXT ]

Tourist_Attractions :
Tourist_Attraction_ID [ INT ] primary_key
Attraction_Type_Code [ TEXT ] Tourist_Attractions.Attraction_Type_Code = Ref_Attraction_Types.Attraction_Type_Code
Location_ID [ INT ] Tourist_Attractions.Location_ID = Locations.Location_ID
How_to_Get_There [ TEXT ]
Name [ TEXT ]
Description [ TEXT ]
Opening_Hours [ TEXT ]
Other_Details [ TEXT ]

Street_Markets :
Market_ID [ INT ] primary_key Street_Markets.Market_ID = Tourist_Attractions.Tourist_Attraction_ID
Market_Details [ TEXT ]

Shops :
Shop_ID [ INT ] primary_key Shops.Shop_ID = Tourist_Attractions.Tourist_Attraction_ID
Shop_Details [ TEXT ]

Museums :
Museum_ID [ INT ] primary_key Museums.Museum_ID = Tourist_Attractions.Tourist_Attraction_ID
Museum_Details [ TEXT ]

Royal_Family :
Royal_Family_ID [ INT ] primary_key Royal_Family.Royal_Family_ID = Tourist_Attractions.Tourist_Attraction_ID
Royal_Family_Details [ TEXT ]

Theme_Parks :
Theme_Park_ID [ INT ] primary_key Theme_Parks.Theme_Park_ID = Tourist_Attractions.Tourist_Attraction_ID
Theme_Park_Details [ TEXT ]

Visits :
Visit_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Visits.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Tourist_ID [ INT ] Visits.Tourist_ID = Visitors.Tourist_ID
Visit_Date [ TEXT ]
Visit_Details [ TEXT ]

Photos :
Photo_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Photos.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Description [ TEXT ]
Filename [ TEXT ]
Other_Details [ TEXT ]

Staff :
Staff_ID [ INT ] primary_key
Tourist_Attraction_ID [ INT ] Staff.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Name [ TEXT ]
Other_Details [ TEXT ]

Tourist_Attraction_Features :
Tourist_Attraction_ID [ INT ] primary_key Tourist_Attraction_Features.Tourist_Attraction_ID = Tourist_Attractions.Tourist_Attraction_ID
Feature_ID [ INT ] Tourist_Attraction_Features.Feature_ID = Features.Feature_ID

Please write me a SQL statement that answers the following question: Count the number of tourists who did not visit any place. [/INST]

Output: SELECT count(*) FROM Visitors WHERE Tourist_ID NOT IN ( SELECT Tourist_ID FROM Visits );


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: How many video games exist? [/INST]

Output: SELECT count(*) FROM Video_games;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: How many video games do you have? [/INST]

Output: SELECT count(*) FROM Video_games;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: How many video game types exist? [/INST]

Output: SELECT count(DISTINCT gtype) FROM Video_games;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What is the count of different game types? [/INST]

Output: SELECT count(DISTINCT gtype) FROM Video_games;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show all video game types. [/INST]

Output: SELECT DISTINCT gtype FROM Video_games;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the different types of video games? [/INST]

Output: SELECT DISTINCT gtype FROM Video_games;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show all video games and their types in the order of their names. [/INST]

Output: SELECT gname ,  gtype FROM Video_games ORDER BY gname;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of all the video games and their types in alphabetical order? [/INST]

Output: SELECT gname ,  gtype FROM Video_games ORDER BY gname;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show all video games with type Collectible card game. [/INST]

Output: SELECT gname FROM Video_games WHERE gtype  =  "Collectible card game";


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of all video games that are collectible cards? [/INST]

Output: SELECT gname FROM Video_games WHERE gtype  =  "Collectible card game";


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What is the type of video game Call of Destiny. [/INST]

Output: SELECT gtype FROM Video_games WHERE gname  =  "Call of Destiny";


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What type of game is Call of Destiny? [/INST]

Output: SELECT gtype FROM Video_games WHERE gname  =  "Call of Destiny";


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: How many video games have type Massively multiplayer online game? [/INST]

Output: SELECT count(*) FROM Video_games WHERE gtype  =  "Massively multiplayer online game";


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Count the number of video games with Massively multiplayer online game type . [/INST]

Output: SELECT count(*) FROM Video_games WHERE gtype  =  "Massively multiplayer online game";


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show all video game types and the number of video games in each type. [/INST]

Output: SELECT gtype ,  count(*) FROM Video_games GROUP BY gtype;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the types of video games and how many are in each type? [/INST]

Output: SELECT gtype ,  count(*) FROM Video_games GROUP BY gtype;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Which game type has most number of games? [/INST]

Output: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What type has the most games? [/INST]

Output: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Which game type has least number of games? [/INST]

Output: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What is the type with the fewest games? [/INST]

Output: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show ids for all students who live in CHI. [/INST]

Output: SELECT StuID FROM Student WHERE city_code  =  "CHI";


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the ids of all students who live in CHI? [/INST]

Output: SELECT StuID FROM Student WHERE city_code  =  "CHI";


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show ids for all students who have advisor 1121. [/INST]

Output: SELECT StuID FROM Student WHERE Advisor  =  1121;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the ids of all students who have advisor number 1121? [/INST]

Output: SELECT StuID FROM Student WHERE Advisor  =  1121;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show first name for all students with major 600. [/INST]

Output: SELECT Fname FROM Student WHERE Major  =  600;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the first names for all students who are from the major numbered 600? [/INST]

Output: SELECT Fname FROM Student WHERE Major  =  600;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show the average, minimum, and maximum age for different majors. [/INST]

Output: SELECT major ,  avg(age) ,  min(age) ,  max(age) FROM Student GROUP BY major;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the average, minimum, and max ages for each of the different majors? [/INST]

Output: SELECT major ,  avg(age) ,  min(age) ,  max(age) FROM Student GROUP BY major;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show all advisors who have at least two students. [/INST]

Output: SELECT advisor FROM Student GROUP BY advisor HAVING count(*)  >=  2;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the advisors [/INST]

Output: SELECT advisor FROM Student GROUP BY advisor HAVING count(*)  >=  2;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: How many sports do we have? [/INST]

Output: SELECT count(DISTINCT sportname) FROM Sportsinfo;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: How many different types of sports do we offer? [/INST]

Output: SELECT count(DISTINCT sportname) FROM Sportsinfo;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: How many students play sports? [/INST]

Output: SELECT count(DISTINCT StuID) FROM Sportsinfo;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: How many different students are involved in sports? [/INST]

Output: SELECT count(DISTINCT StuID) FROM Sportsinfo;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: List ids for all student who are on scholarship. [/INST]

Output: SELECT StuID FROM Sportsinfo WHERE onscholarship  =  'Y';


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the ids for all sporty students who are on scholarship? [/INST]

Output: SELECT StuID FROM Sportsinfo WHERE onscholarship  =  'Y';


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show last names for all student who are on scholarship. [/INST]

Output: SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.onscholarship  =  'Y';


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the last names for all scholarship students? [/INST]

Output: SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.onscholarship  =  'Y';


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: How many games are played for all students? [/INST]

Output: SELECT sum(gamesplayed) FROM Sportsinfo;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What is the total number of games played? [/INST]

Output: SELECT sum(gamesplayed) FROM Sportsinfo;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: How many games are played for all football games by students on scholarship? [/INST]

Output: SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname  =  "Football" AND onscholarship  =  'Y';


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What is the total number of all football games played by scholarship students? [/INST]

Output: SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname  =  "Football" AND onscholarship  =  'Y';


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show all sport name and the number of students. [/INST]

Output: SELECT sportname ,  count(*) FROM Sportsinfo GROUP BY sportname;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: How many students play each sport? [/INST]

Output: SELECT sportname ,  count(*) FROM Sportsinfo GROUP BY sportname;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show all student IDs with the number of sports and total number of games played [/INST]

Output: SELECT StuID ,  count(*) ,  sum(gamesplayed) FROM Sportsinfo GROUP BY StuID;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the ids of all students along with how many sports and games did they play? [/INST]

Output: SELECT StuID ,  count(*) ,  sum(gamesplayed) FROM Sportsinfo GROUP BY StuID;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show all student IDs with more than total 10 hours per week on all sports played. [/INST]

Output: SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek)  >  10;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the student IDs for everybody who worked for more than 10 hours per week on all sports? [/INST]

Output: SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek)  >  10;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What is the first name and last name of the student who have most number of sports? [/INST]

Output: SELECT T2.Fname ,  T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What is the first and last name of the student who played the most sports? [/INST]

Output: SELECT T2.Fname ,  T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Which sport has most number of students on scholarship? [/INST]

Output: SELECT sportname FROM Sportsinfo WHERE onscholarship  =  'Y' GROUP BY sportname ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What is the sport with the most scholarship students? [/INST]

Output: SELECT sportname FROM Sportsinfo WHERE onscholarship  =  'Y' GROUP BY sportname ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show student ids who don't have any sports. [/INST]

Output: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: What are the ids of all students who don't play sports? [/INST]

Output: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo;


Input:
[INST] Here is a database schema:
Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Video_Games :
GameID [ INT ] primary_key
GName [ TEXT ]
GType [ TEXT ]

Plays_Games :
StuID [ INT ] Plays_Games.StuID = Student.StuID
GameID [ INT ] Plays_Games.GameID = Video_Games.GameID
Hours_Played [ INT ]

SportsInfo :
StuID [ INT ] SportsInfo.StuID = Student.StuID
SportName [ TEXT ]
HoursPerWeek [ INT ]
GamesPlayed [ INT ]
OnScholarship [ TEXT ]

Please write me a SQL statement that answers the following question: Show student ids who are on scholarship and have major 600. [/INST]

Output: SELECT StuID FROM Student WHERE major  =  600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship  =  'Y';