CREATE TABLE Accounts (
    account_id NUMBER PRIMARY KEY,
    customer_id NUMBER,
    account_name TEXT,
    other_account_details TEXT
);
CREATE TABLE Customers (
    customer_id NUMBER PRIMARY KEY,
    customer_first_name TEXT,
    customer_last_name TEXT,
    customer_address TEXT,
    customer_phone TEXT,
    customer_email TEXT,
    other_customer_details TEXT
);
CREATE TABLE Customers_Cards (
    card_id NUMBER PRIMARY KEY,
    customer_id NUMBER,
    card_type_code TEXT,
    card_number TEXT,
    date_valid_from TIME,
    date_valid_to TIME,
    other_card_details TEXT
);
CREATE TABLE Financial_Transactions (
    transaction_id NUMBER,
    previous_transaction_id NUMBER,
    account_id NUMBER,
    card_id NUMBER,
    transaction_type TEXT,
    transaction_date TIME,
    transaction_amount NUMBER,
    transaction_comment TEXT,
    other_transaction_details TEXT,
    FOREIGN KEY ("account_id") REFERENCES Accounts("account_id"),
    FOREIGN KEY ("card_id") REFERENCES Customers_Cards("card_id")
);

Question: How many accounts do we have?
SQL: SELECT count(*) FROM Accounts

Question: Count the number of accounts.
SQL: SELECT count(*) FROM Accounts

Question: Show ids, customer ids, names for all accounts.
SQL: SELECT account_id ,  customer_id ,  account_name FROM Accounts

Question: What are the account ids, customer ids, and account names for all the accounts?
SQL: SELECT account_id ,  customer_id ,  account_name FROM Accounts

Question: Show other account details for account with name 338.
SQL: SELECT other_account_details FROM Accounts WHERE account_name  =  "338"

Question: What are the other account details for the account with the name 338?
SQL: SELECT other_account_details FROM Accounts WHERE account_name  =  "338"

Question: What is the first name, last name, and phone of the customer with account name 162?
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.account_name  =  "162"

Question: Give the full name and phone of the customer who has the account name 162.
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.account_name  =  "162"

Question: How many accounts does the customer with first name Art and last name Turcotte have?
SQL: SELECT count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Art" AND T2.customer_last_name  =  "Turcotte"

Question: Return the number of accounts that the customer with the first name Art and last name Turcotte has.
SQL: SELECT count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Art" AND T2.customer_last_name  =  "Turcotte"

Question: Show all customer ids and the number of accounts for each customer.
SQL: SELECT customer_id ,  count(*) FROM Accounts GROUP BY customer_id

Question: How many accounts are there for each customer id?
SQL: SELECT customer_id ,  count(*) FROM Accounts GROUP BY customer_id

Question: Show the customer id and number of accounts with most accounts.
SQL: SELECT customer_id ,  count(*) FROM Accounts GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1

Question: What is the customer id of the customer with the most accounts, and how many accounts does this person have?
SQL: SELECT customer_id ,  count(*) FROM Accounts GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1

Question: What is the customer first, last name and id with least number of accounts.
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1

Question: Give the full name and customer id of the customer with the fewest accounts.
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1

Question: Show the number of all customers without an account.
SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)

Question: How many customers do not have an account?
SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)

Question: Show the first names and last names of customers without any account.
SQL: SELECT customer_first_name ,  customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id

Question: What are the full names of customers who do not have any accounts?
SQL: SELECT customer_first_name ,  customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id

Question: Show distinct first and last names for all customers with an account.
SQL: SELECT DISTINCT T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id

Question: What are the full names of customers who have accounts?
SQL: SELECT DISTINCT T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id

Question: How many customers have an account?
SQL: SELECT count(DISTINCT customer_id) FROM Accounts

Question: Count the number of customers who hold an account.
SQL: SELECT count(DISTINCT customer_id) FROM Accounts

Question: How many customers do we have?
SQL: SELECT count(*) FROM Customers

Question: Count the number of customers.
SQL: SELECT count(*) FROM Customers

Question: Show ids, first names, last names, and phones for all customers.
SQL: SELECT customer_id ,  customer_first_name ,  customer_last_name ,  customer_phone FROM Customers

Question: What are the ids, full names, and phones of each customer?
SQL: SELECT customer_id ,  customer_first_name ,  customer_last_name ,  customer_phone FROM Customers

Question: What is the phone and email for customer with first name Aniyah and last name Feest?
SQL: SELECT customer_phone ,  customer_email FROM Customers WHERE customer_first_name  =  "Aniyah" AND customer_last_name  =  "Feest"

Question: Return the phone and email of the customer with the first name Aniyah and last name Feest.
SQL: SELECT customer_phone ,  customer_email FROM Customers WHERE customer_first_name  =  "Aniyah" AND customer_last_name  =  "Feest"

Question: Show the number of customer cards.
SQL: SELECT count(*) FROM Customers_cards

Question: How many customer cards are there?
SQL: SELECT count(*) FROM Customers_cards

Question: Show ids, customer ids, card type codes, card numbers for all cards.
SQL: SELECT card_id ,  customer_id ,  card_type_code ,  card_number FROM Customers_cards

Question: What are card ids, customer ids, card types, and card numbers for each customer card?
SQL: SELECT card_id ,  customer_id ,  card_type_code ,  card_number FROM Customers_cards

Question: Show the date valid from and the date valid to for the card with card number '4560596484842'.
SQL: SELECT date_valid_from ,  date_valid_to FROM Customers_cards WHERE card_number  =  "4560596484842"

Question: What are the valid from and valid to dates for the card with the number 4560596484842?
SQL: SELECT date_valid_from ,  date_valid_to FROM Customers_cards WHERE card_number  =  "4560596484842"

Question: What is the first name, last name, and phone of the customer with card 4560596484842.
SQL: SELECT T2.customer_first_name ,  T2.customer_last_name ,  T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.card_number  =  "4560596484842"