db_id
stringlengths
4
31
text
stringlengths
370
4.84k
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are card ids, customer ids, card types, and card numbers for each customer card? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select card_id , customer_id , card_type_code , card_number from customers_cards
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the date valid from and the date valid to for the card with card number '4560596484842'. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select date_valid_from , date_valid_to from customers_cards where card_number = '4560596484842'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the valid from and valid to dates for the card with the number 4560596484842? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select date_valid_from , date_valid_to from customers_cards where card_number = '4560596484842'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the first name, last name, and phone of the customer with card 4560596484842. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customers.customer_first_name , customers.customer_last_name , customers.customer_phone from customers_cards join customers on customers_cards.customer_id = customers.customer_id where customers_cards.card_number = '4560596484842'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the full name and phone of the customer who has card number 4560596484842. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customers.customer_first_name , customers.customer_last_name , customers.customer_phone from customers_cards join customers on customers_cards.customer_id = customers.customer_id where customers_cards.card_number = '4560596484842'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many cards does customer Art Turcotte have? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select count ( * ) from customers_cards join customers on customers_cards.customer_id = customers.customer_id where customers.customer_first_name = 'Art' and customers.customer_last_name = 'Turcotte'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Count the number of cards the customer with the first name Art and last name Turcotte has. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select count ( * ) from customers_cards join customers on customers_cards.customer_id = customers.customer_id where customers.customer_first_name = 'Art' and customers.customer_last_name = 'Turcotte'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many debit cards do we have? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select count ( * ) from customers_cards where card_type_code = 'Debit'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Count the number of customer cards of the type Debit. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select count ( * ) from customers_cards where card_type_code = 'Debit'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many credit cards does customer Blanche Huels have? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select count ( * ) from customers_cards join customers on customers_cards.customer_id = customers.customer_id where customers.customer_first_name = 'Blanche' and customers.customer_last_name = 'Huels' and customers_cards.card_type_code = 'Credit'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Count the number of credit cards that the customer with first name Blanche and last name Huels has. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select count ( * ) from customers_cards join customers on customers_cards.customer_id = customers.customer_id where customers.customer_first_name = 'Blanche' and customers.customer_last_name = 'Huels' and customers_cards.card_type_code = 'Credit'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show all customer ids and the number of cards owned by each customer. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customer_id , count ( * ) from customers_cards group by customer_id
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the different customer ids, and how many cards does each one hold? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customer_id , count ( * ) from customers_cards group by customer_id
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the customer id with most number of cards, and how many does he have? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customer_id , count ( * ) from customers_cards group by customer_id order by count ( * ) desc limit 1
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the id of the customer who has the most cards, as well as the number of cards. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customer_id , count ( * ) from customers_cards group by customer_id order by count ( * ) desc limit 1
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show id, first and last names for all customers with at least two cards. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customers_cards.customer_id , customers.customer_first_name , customers.customer_last_name from customers_cards join customers on customers_cards.customer_id = customers.customer_id group by customers_cards.customer_id having count ( * ) >= 2
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the ids and full names of customers who hold two or more cards? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customers_cards.customer_id , customers.customer_first_name , customers.customer_last_name from customers_cards join customers on customers_cards.customer_id = customers.customer_id group by customers_cards.customer_id having count ( * ) >= 2
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the customer id, first and last name with least number of accounts. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customers_cards.customer_id , customers.customer_first_name , customers.customer_last_name from customers_cards join customers on customers_cards.customer_id = customers.customer_id group by customers_cards.customer_id order by count ( * ) asc limit 1
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the id and full name of the customer who has the fewest accounts. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customers_cards.customer_id , customers.customer_first_name , customers.customer_last_name from customers_cards join customers on customers_cards.customer_id = customers.customer_id group by customers_cards.customer_id order by count ( * ) asc limit 1
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show all card type codes and the number of cards in each type. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select card_type_code , count ( * ) from customers_cards group by card_type_code
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the different card types, and how many cards are there of each? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select card_type_code , count ( * ) from customers_cards group by card_type_code
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the card type code with most number of cards? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select card_type_code from customers_cards group by card_type_code order by count ( * ) desc limit 1
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the code of the card type that is most common. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select card_type_code from customers_cards group by card_type_code order by count ( * ) desc limit 1
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show card type codes with at least 5 cards. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select card_type_code from customers_cards group by card_type_code having count ( * ) >= 5
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the codes of card types that have 5 or more cards? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select card_type_code from customers_cards group by card_type_code having count ( * ) >= 5
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show all card type codes and the number of customers holding cards in each type. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select card_type_code , count ( distinct customer_id ) from customers_cards group by card_type_code
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the different card type codes, and how many different customers hold each type? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select card_type_code , count ( distinct customer_id ) from customers_cards group by card_type_code
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the customer ids and firstname without a credit card. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customer_id , customer_first_name from customers except select customers_cards.customer_id , customers.customer_first_name from customers_cards join customers on customers_cards.customer_id = customers.customer_id where card_type_code = 'Credit'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the ids and first names of customers who do not hold a credit card? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customer_id , customer_first_name from customers except select customers_cards.customer_id , customers.customer_first_name from customers_cards join customers on customers_cards.customer_id = customers.customer_id where card_type_code = 'Credit'
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show all card type codes. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select distinct card_type_code from customers_cards
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the different card type codes? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select distinct card_type_code from customers_cards
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the number of card types. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select count ( distinct card_type_code ) from customers_cards
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many different card types are there? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select count ( distinct card_type_code ) from customers_cards
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show all transaction types. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select distinct transaction_type from financial_transactions
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the different types of transactions? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select distinct transaction_type from financial_transactions
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the number of transaction types. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select count ( distinct transaction_type ) from financial_transactions
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many different types of transactions are there? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select count ( distinct transaction_type ) from financial_transactions
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the average and total transaction amount? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select avg ( transaction_amount ) , sum ( transaction_amount ) from financial_transactions
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the average transaction amount, as well as the total amount of all transactions. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select avg ( transaction_amount ) , sum ( transaction_amount ) from financial_transactions
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the card type codes and the number of transactions. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customers_cards.card_type_code , count ( * ) from financial_transactions join customers_cards on financial_transactions.card_id = customers_cards.card_id group by customers_cards.card_type_code
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the different card types, and how many transactions have been made with each? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select customers_cards.card_type_code , count ( * ) from financial_transactions join customers_cards on financial_transactions.card_id = customers_cards.card_id group by customers_cards.card_type_code
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the transaction type and the number of transactions. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select transaction_type , count ( * ) from financial_transactions group by transaction_type
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the different transaction types, and how many transactions of each have taken place? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select transaction_type , count ( * ) from financial_transactions group by transaction_type
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the transaction type that has processed the greatest total amount in transactions? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select transaction_type from financial_transactions group by transaction_type order by sum ( transaction_amount ) desc limit 1
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the type of transaction with the highest total amount. | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select transaction_type from financial_transactions group by transaction_type order by sum ( transaction_amount ) desc limit 1
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the account id and the number of transactions for each account | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select account_id , count ( * ) from financial_transactions group by account_id
customers_card_transactions
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the different account ids that have made financial transactions, as well as how many transactions correspond to each? | accounts : account_id , customer_id , account_name , other_account_details | customers : customer_id , customer_first_name , customer_last_name , customer_address , customer_phone , customer_email , other_customer_details | customers_cards : card_id , customer_id , card_type_code , card_number , date_valid_from , date_valid_to , other_card_details | financial_transactions : transaction_id , previous_transaction_id , account_id , card_id , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | financial_transactions.account_id = accounts.account_id | financial_transactions.card_id = customers_cards.card_id | ### Response: select account_id , count ( * ) from financial_transactions group by account_id
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many tracks do we have? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select count ( * ) from track
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Count the number of tracks. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select count ( * ) from track
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the name and location for all tracks. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name , location from track
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names and locations of all tracks? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name , location from track
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show names and seatings, ordered by seating for all tracks opened after 2000. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name , seating from track where year_opened > 2000 order by seating asc
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names and seatings for all tracks opened after 2000, ordered by seating? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name , seating from track where year_opened > 2000 order by seating asc
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the name, location and seating for the most recently opened track? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name , location , seating from track order by year_opened desc limit 1
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the name, location, and seating of the track that was opened in the most recent year. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name , location , seating from track order by year_opened desc limit 1
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the minimum, maximum, and average seating for all tracks. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select min ( seating ) , max ( seating ) , avg ( seating ) from track
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the minimum, maximum, and average seating across all tracks. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select min ( seating ) , max ( seating ) , avg ( seating ) from track
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the name, location, open year for all tracks with a seating higher than the average. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name , location , year_opened from track where seating > ( select avg ( seating ) from track )
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names, locations, and years of opening for tracks with seating higher than average? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name , location , year_opened from track where seating > ( select avg ( seating ) from track )
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are distinct locations where tracks are located? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select distinct location from track
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Give the different locations of tracks. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select distinct location from track
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many races are there? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select count ( * ) from race
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Count the number of races. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select count ( * ) from race
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the distinct classes that races can have? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select distinct class from race
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the different classes of races. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select distinct class from race
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show name, class, and date for all races. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name , class , date from race
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names, classes, and dates for all races? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name , class , date from race
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the race class and number of races in each class. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select class , count ( * ) from race group by class
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the different classes of races, and how many races correspond to each? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select class , count ( * ) from race group by class
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the race class with most number of races. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select class from race group by class order by count ( * ) desc limit 1
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Give the class of races that is most common. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select class from race group by class order by count ( * ) desc limit 1
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: List the race class with at least two races. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select class from race group by class having count ( * ) >= 2
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the classes of races that have two or more corresponding races? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select class from race group by class having count ( * ) >= 2
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names for tracks without a race in class 'GT'. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name from track except select track.name from race join track on race.track_id = track.track_id where race.class = 'GT'
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Give the names of tracks that do not have a race in the class 'GT'. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name from track except select track.name from race join track on race.track_id = track.track_id where race.class = 'GT'
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show all track names that have had no races. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name from track where track_id not in ( select track_id from race )
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the names of tracks that have no had any races. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select name from track where track_id not in ( select track_id from race )
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show year where a track with a seating at least 5000 opened and a track with seating no more than 4000 opened. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select year_opened from track where seating between 4000 and 5000
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the years of opening for tracks with seating between 4000 and 5000? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select year_opened from track where seating between 4000 and 5000
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the name of track and the number of races in each track. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select track.name , count ( * ) from race join track on race.track_id = track.track_id group by race.track_id
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names of different tracks, and how many races has each had? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select track.name , count ( * ) from race join track on race.track_id = track.track_id group by race.track_id
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the name of track with most number of races. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select track.name from race join track on race.track_id = track.track_id group by race.track_id order by count ( * ) desc limit 1
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the name of the track that has had the greatest number of races? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select track.name from race join track on race.track_id = track.track_id group by race.track_id order by count ( * ) desc limit 1
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the name and date for each race and its track name. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select race.name , race.date , track.name from race join track on race.track_id = track.track_id
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names and dates of races, and the names of the tracks where they are held? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select race.name , race.date , track.name from race join track on race.track_id = track.track_id
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the name and location of track with 1 race. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select track.name , track.location from race join track on race.track_id = track.track_id group by race.track_id having count ( * ) = 1
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names and locations of tracks that have had exactly 1 race? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select track.name , track.location from race join track on race.track_id = track.track_id group by race.track_id having count ( * ) = 1
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the locations where have both tracks with more than 90000 seats and tracks with less than 70000 seats. | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select location from track where seating > 90000 intersect select location from track where seating < 70000
race_track
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the locations that have both tracks with more than 90000 seats, and tracks with fewer than 70000 seats? | race : race_id , name , class , date , track_id | track : track_id , name , location , seating , year_opened | race.track_id = track.track_id | ### Response: select location from track where seating > 90000 intersect select location from track where seating < 70000
coffee_shop
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many members have the black membership card? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | ### Response: select count ( * ) from member where membership_card = 'Black'
coffee_shop
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the number of members living in each address. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | ### Response: select count ( * ) , address from member group by address
coffee_shop
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Give me the names of members whose address is in Harford or Waterbury. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | ### Response: select name from member where address = 'Harford' or address = 'Waterbury'
coffee_shop
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the ids and names of members who are under age 30 or with black membership card. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | ### Response: select name , member_id from member where membership_card = 'Black' or age < 30
coffee_shop
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the purchase time, age and address of each member, and show the results in the order of purchase time. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | ### Response: select time_of_purchase , age , address from member order by time_of_purchase asc
coffee_shop
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which membership card has more than 5 members? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | ### Response: select membership_card from member group by membership_card having count ( * ) > 5
coffee_shop
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which address has both members younger than 30 and members older than 40? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | ### Response: select address from member where age < 30 intersect select address from member where age > 40
coffee_shop
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the membership card held by both members living in Hartford and ones living in Waterbury address? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | ### Response: select membership_card from member where address = 'Hartford' intersect select membership_card from member where address = 'Waterbury'
coffee_shop
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many members are not living in Hartford? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | ### Response: select count ( * ) from member where address != 'Hartford'
coffee_shop
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which address do not have any member with the black membership card? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | ### Response: select address from member except select address from member where membership_card = 'Black'
coffee_shop
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the shop addresses ordered by their opening year. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | ### Response: select address from shop order by open_year asc