richardr1126/spider-context-instruct huggingface dataset:
### Instruction:

Convert text to sql: Show the average share count of transactions for different investors. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select investor_id , avg ( share_count ) from transactions group by investor_id

### Instruction:

Convert text to sql: Show the average share count of transactions each each investor, ordered by average share count. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select investor_id , avg ( share_count ) from transactions group by investor_id order by avg ( share_count ) asc
### Instruction:

Convert text to sql: Show the average amount of transactions for different investors. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select investor_id , avg ( amount_of_transaction ) from transactions group by investor_id

### Instruction:

Convert text to sql: Show the average amount of transactions for different lots. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select transactions_lots.lot_id , avg ( amount_of_transaction ) from transactions join transactions_lots on transactions.transaction_id = transactions_lots.transaction_id group by transactions_lots.lot_id
### Instruction:

Convert text to sql: Show the average amount of transactions for different lots, ordered by average amount of transactions. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select transactions_lots.lot_id , avg ( amount_of_transaction ) from transactions join transactions_lots on transactions.transaction_id = transactions_lots.transaction_id group by transactions_lots.lot_id order by avg ( amount_of_transaction ) asc

### Instruction:

Convert text to sql: Show the number of transactions with transaction type code "SALE" for different investors if it is larger than 0. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select investor_id , count ( * ) from transactions where transaction_type_code = 'SALE' group by investor_id
### Instruction:

Convert text to sql: Show the number of transactions for different investors. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select investor_id , count ( * ) from transactions group by investor_id

### Instruction:

Convert text to sql: Show the transaction type code that occurs the fewest times. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select transaction_type_code from transactions group by transaction_type_code order by count ( * ) asc limit 1
### Instruction:

Convert text to sql: Show the transaction type code that occurs the most frequently. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select transaction_type_code from transactions group by transaction_type_code order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Show the description of the transaction type that occurs most frequently. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select ref_transaction_types.transaction_type_description from ref_transaction_types join transactions on ref_transaction_types.transaction_type_code = transactions.transaction_type_code group by ref_transaction_types.transaction_type_code order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Show the id and details of the investor that has the largest number of transactions. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select transactions.investor_id , investors.investor_details from investors join transactions on investors.investor_id = transactions.investor_id group by transactions.investor_id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Show the id and details for the investors who have the top 3 number of transactions. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select transactions.investor_id , investors.investor_details from investors join transactions on investors.investor_id = transactions.investor_id group by transactions.investor_id order by count ( * ) desc limit 3
### Instruction:

Convert text to sql: Show the ids of the investors who have at least two transactions. | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select transactions.investor_id from investors join transactions on investors.investor_id = transactions.investor_id group by transactions.investor_id having count ( * ) >= 2

### Instruction:

Convert text to sql: Show the ids and details of the investors who have at least two transactions with type code "SALE". | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select transactions.investor_id , investors.investor_details from investors join transactions on investors.investor_id = transactions.investor_id where transactions.transaction_type_code = 'SALE' group by transactions.investor_id having count ( * ) >= 2
### Instruction:

Convert text to sql: What are the dates of transactions with at least 100 share count or amount bigger than 100? | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select date_of_transaction from transactions where share_count >= 100 or amount_of_transaction >= 100

### Instruction:

Convert text to sql: What are the details of all sales and purchases? | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select sales_details from sales union select purchase_details from purchases
### Instruction:

Convert text to sql: What are the details of the lots which are not used in any transactions? | investors : investor_id , investor_details | lots : lot_id , investor_id , lot_details | ref_transaction_types : transaction_type_code , transaction_type_description | transactions : transaction_id , investor_id , transaction_type_code , date_of_transaction , amount_of_transaction , share_count , other_details | sales : sales_transaction_id , sales_details | purchases : purchase_transaction_id , purchase_details | transactions_lots : transaction_id , lot_id | lots.investor_id = investors.investor_id | transactions.transaction_type_code = ref_transaction_types.transaction_type_code | transactions.investor_id = investors.investor_id | sales.sales_transaction_id = transactions.transaction_id | purchases.purchase_transaction_id = transactions.transaction_id | transactions_lots.transaction_id = transactions.transaction_id | transactions_lots.lot_id = lots.lot_id | 

### Response:

select lot_details from lots except select lots.lot_details from lots join transactions_lots on lots.lot_id = transactions_lots.lot_id
### Instruction:

Convert text to sql: How many available hotels are there in total? | ref_hotel_star_ratings : star_rating_code , star_rating_description | locations : location_id , location_name , address , other_details | ref_attraction_types : attraction_type_code , attraction_type_description | visitors : tourist_id , tourist_details | features : feature_id , feature_details | hotels : hotel_id , star_rating_code , pets_allowed_yn , price_range , other_hotel_details | tourist_attractions : tourist_attraction_id , attraction_type_code , location_id , how_to_get_there , name , description , opening_hours , other_details | street_markets : market_id , market_details | shops : shop_id , shop_details | museums : museum_id , museum_details | royal_family : royal_family_id , royal_family_details | theme_parks : theme_park_id , theme_park_details | visits : visit_id , tourist_attraction_id , tourist_id , visit_date , visit_details | photos : photo_id , tourist_attraction_id , name , description , filename , other_details | staff : staff_id , tourist_attraction_id , name , other_details | tourist_attraction_features : tourist_attraction_id , feature_id | hotels.star_rating_code = ref_hotel_star_ratings.star_rating_code | tourist_attractions.attraction_type_code = ref_attraction_types.attraction_type_code | tourist_attractions.location_id = locations.location_id | street_markets.market_id = tourist_attractions.tourist_attraction_id | shops.shop_id = tourist_attractions.tourist_attraction_id | museums.museum_id = tourist_attractions.tourist_attraction_id | royal_family.royal_family_id = tourist_attractions.tourist_attraction_id | theme_parks.theme_park_id = tourist_attractions.tourist_attraction_id | visits.tourist_id = visitors.tourist_id | visits.tourist_attraction_id = tourist_attractions.tourist_attraction_id | photos.tourist_attraction_id = tourist_attractions.tourist_attraction_id | staff.tourist_attraction_id = tourist_attractions.tourist_attraction_id | tourist_attraction_features.feature_id = features.feature_id | tourist_attraction_features.tourist_attraction_id = tourist_attractions.tourist_attraction_id | 

### Response:

select count ( * ) from hotels
### Instruction:

Convert text to sql: Find the total number of available hotels. | ref_hotel_star_ratings : star_rating_code , star_rating_description | locations : location_id , location_name , address , other_details | ref_attraction_types : attraction_type_code , attraction_type_description | visitors : tourist_id , tourist_details | features : feature_id , feature_details | hotels : hotel_id , star_rating_code , pets_allowed_yn , price_range , other_hotel_details | tourist_attractions : tourist_attraction_id , attraction_type_code , location_id , how_to_get_there , name , description , opening_hours , other_details | street_markets : market_id , market_details | shops : shop_id , shop_details | museums : museum_id , museum_details | royal_family : royal_family_id , royal_family_details | theme_parks : theme_park_id , theme_park_details | visits : visit_id , tourist_attraction_id , tourist_id , visit_date , visit_details | photos : photo_id , tourist_attraction_id , name , description , filename , other_details | staff : staff_id , tourist_attraction_id , name , other_details | tourist_attraction_features : tourist_attraction_id , feature_id | hotels.star_rating_code = ref_hotel_star_ratings.star_rating_code | tourist_attractions.attraction_type_code = ref_attraction_types.attraction_type_code | tourist_attractions.location_id = locations.location_id | street_markets.market_id = tourist_attractions.tourist_attraction_id | shops.shop_id = tourist_attractions.tourist_attraction_id | museums.museum_id = tourist_attractions.tourist_attraction_id | royal_family.royal_family_id = tourist_attractions.tourist_attraction_id | theme_parks.theme_park_id = tourist_attractions.tourist_attraction_id | visits.tourist_id = visitors.tourist_id | visits.tourist_attraction_id = tourist_attractions.tourist_attraction_id | photos.tourist_attraction_id = tourist_attractions.tourist_attraction_id | staff.tourist_attraction_id = tourist_attractions.tourist_attraction_id | tourist_attraction_features.feature_id = features.feature_id | tourist_attraction_features.tourist_attraction_id = tourist_attractions.tourist_attraction_id | 

### Response:

select count ( * ) from hotels