richardr1126/spider-context-instruct huggingface dataset:
### 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

### 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

### 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
### 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

### 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

### 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
### 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

### 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

### 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
### 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

### 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

### 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
### 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

### 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

### 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
### 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'

### 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'

### 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
### 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

### 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

### 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
### 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

### 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

### 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