sharkiefff/RBAC-Text2SQL-Benchmark huggingface dataset:
##Instruction:
Database: customers_card_transactions
Total Tables: 4
Total Columns: 27

Table Schemas:

customers_card_transactions contains tables such as Accounts, Customers, Customers_Cards, Financial_Transactions.
Table Accounts has columns such as account_id, customer_id, account_name, other_account_details.
account_id is the primary key.
Table Customers has columns such as customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details.
customer_id is the primary key.
Table Customers_Cards has columns such as card_id, customer_id, card_type_code, card_number, date_valid_from, date_valid_to, other_card_details.
card_id is the primary key.
Table Financial_Transactions has columns such as transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, transaction_comment, other_transaction_details.
The account_id of Financial_Transactions is the foreign key of account_id of Accounts.
The card_id of Financial_Transactions is the foreign key of card_id of Customers_Cards.

##Role Access Policy (Column-Level):
Role: FinancialController
Accessible Columns: Accounts: account_id, customer_id, account_name; Customers: customer_id, customer_first_name, customer_last_name; Customers_Cards: card_id, customer_id, card_type_code; Financial_Transactions: transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, other_transaction_details

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What are the ids and first names of customers who do not hold a credit card?
Answer: SELECT customer_id ,  customer_first_name FROM Customers EXCEPT SELECT T1.customer_id ,  T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE card_type_code  =  "Credit"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT customer_id ,  customer_first_name FROM Customers EXCEPT SELECT T1.customer_id ,  T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE card_type_code  =  "Credit"
##Instruction:
Database: customers_card_transactions
Total Tables: 4
Total Columns: 27

Table Schemas:

customers_card_transactions contains tables such as Accounts, Customers, Customers_Cards, Financial_Transactions.
Table Accounts has columns such as account_id, customer_id, account_name, other_account_details.
account_id is the primary key.
Table Customers has columns such as customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details.
customer_id is the primary key.
Table Customers_Cards has columns such as card_id, customer_id, card_type_code, card_number, date_valid_from, date_valid_to, other_card_details.
card_id is the primary key.
Table Financial_Transactions has columns such as transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, transaction_comment, other_transaction_details.
The account_id of Financial_Transactions is the foreign key of account_id of Accounts.
The card_id of Financial_Transactions is the foreign key of card_id of Customers_Cards.

##Role Access Policy (Column-Level):
Role: FinancialController
Accessible Columns: Accounts: account_id, customer_id, account_name; Customers: customer_id, customer_first_name, customer_last_name; Customers_Cards: card_id, customer_id, card_type_code; Financial_Transactions: transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, other_transaction_details

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Show all card type codes.
Answer: SELECT DISTINCT card_type_code FROM Customers_Cards
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT DISTINCT card_type_code FROM Customers_Cards
##Instruction:
Database: customers_card_transactions
Total Tables: 4
Total Columns: 27

Table Schemas:

customers_card_transactions contains tables such as Accounts, Customers, Customers_Cards, Financial_Transactions.
Table Accounts has columns such as account_id, customer_id, account_name, other_account_details.
account_id is the primary key.
Table Customers has columns such as customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details.
customer_id is the primary key.
Table Customers_Cards has columns such as card_id, customer_id, card_type_code, card_number, date_valid_from, date_valid_to, other_card_details.
card_id is the primary key.
Table Financial_Transactions has columns such as transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, transaction_comment, other_transaction_details.
The account_id of Financial_Transactions is the foreign key of account_id of Accounts.
The card_id of Financial_Transactions is the foreign key of card_id of Customers_Cards.

##Role Access Policy (Column-Level):
Role: FinancialController
Accessible Columns: Accounts: account_id, customer_id, account_name; Customers: customer_id, customer_first_name, customer_last_name; Customers_Cards: card_id, customer_id, card_type_code; Financial_Transactions: transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, other_transaction_details

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What are the different card type codes?
Answer: SELECT DISTINCT card_type_code FROM Customers_Cards
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT DISTINCT card_type_code FROM Customers_Cards
##Instruction:
Database: customers_card_transactions
Total Tables: 4
Total Columns: 27

Table Schemas:

customers_card_transactions contains tables such as Accounts, Customers, Customers_Cards, Financial_Transactions.
Table Accounts has columns such as account_id, customer_id, account_name, other_account_details.
account_id is the primary key.
Table Customers has columns such as customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details.
customer_id is the primary key.
Table Customers_Cards has columns such as card_id, customer_id, card_type_code, card_number, date_valid_from, date_valid_to, other_card_details.
card_id is the primary key.
Table Financial_Transactions has columns such as transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, transaction_comment, other_transaction_details.
The account_id of Financial_Transactions is the foreign key of account_id of Accounts.
The card_id of Financial_Transactions is the foreign key of card_id of Customers_Cards.

##Role Access Policy (Column-Level):
Role: FinancialController
Accessible Columns: Accounts: account_id, customer_id, account_name; Customers: customer_id, customer_first_name, customer_last_name; Customers_Cards: card_id, customer_id, card_type_code; Financial_Transactions: transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, other_transaction_details

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Show the number of card types.
Answer: SELECT count(DISTINCT card_type_code) FROM Customers_Cards
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT card_type_code) FROM Customers_Cards
##Instruction:
Database: customers_card_transactions
Total Tables: 4
Total Columns: 27

Table Schemas:

customers_card_transactions contains tables such as Accounts, Customers, Customers_Cards, Financial_Transactions.
Table Accounts has columns such as account_id, customer_id, account_name, other_account_details.
account_id is the primary key.
Table Customers has columns such as customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details.
customer_id is the primary key.
Table Customers_Cards has columns such as card_id, customer_id, card_type_code, card_number, date_valid_from, date_valid_to, other_card_details.
card_id is the primary key.
Table Financial_Transactions has columns such as transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, transaction_comment, other_transaction_details.
The account_id of Financial_Transactions is the foreign key of account_id of Accounts.
The card_id of Financial_Transactions is the foreign key of card_id of Customers_Cards.

##Role Access Policy (Column-Level):
Role: FinancialController
Accessible Columns: Accounts: account_id, customer_id, account_name; Customers: customer_id, customer_first_name, customer_last_name; Customers_Cards: card_id, customer_id, card_type_code; Financial_Transactions: transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, other_transaction_details

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: How many different card types are there?
Answer: SELECT count(DISTINCT card_type_code) FROM Customers_Cards
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT card_type_code) FROM Customers_Cards
##Instruction:
Database: customers_card_transactions
Total Tables: 4
Total Columns: 27

Table Schemas:

customers_card_transactions contains tables such as Accounts, Customers, Customers_Cards, Financial_Transactions.
Table Accounts has columns such as account_id, customer_id, account_name, other_account_details.
account_id is the primary key.
Table Customers has columns such as customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details.
customer_id is the primary key.
Table Customers_Cards has columns such as card_id, customer_id, card_type_code, card_number, date_valid_from, date_valid_to, other_card_details.
card_id is the primary key.
Table Financial_Transactions has columns such as transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, transaction_comment, other_transaction_details.
The account_id of Financial_Transactions is the foreign key of account_id of Accounts.
The card_id of Financial_Transactions is the foreign key of card_id of Customers_Cards.

##Role Access Policy (Column-Level):
Role: FinancialController
Accessible Columns: Accounts: account_id, customer_id, account_name; Customers: customer_id, customer_first_name, customer_last_name; Customers_Cards: card_id, customer_id, card_type_code; Financial_Transactions: transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, other_transaction_details

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Show all transaction types.
Answer: SELECT DISTINCT transaction_type FROM Financial_Transactions
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT DISTINCT transaction_type FROM Financial_Transactions
##Instruction:
Database: customers_card_transactions
Total Tables: 4
Total Columns: 27

Table Schemas:

customers_card_transactions contains tables such as Accounts, Customers, Customers_Cards, Financial_Transactions.
Table Accounts has columns such as account_id, customer_id, account_name, other_account_details.
account_id is the primary key.
Table Customers has columns such as customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details.
customer_id is the primary key.
Table Customers_Cards has columns such as card_id, customer_id, card_type_code, card_number, date_valid_from, date_valid_to, other_card_details.
card_id is the primary key.
Table Financial_Transactions has columns such as transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, transaction_comment, other_transaction_details.
The account_id of Financial_Transactions is the foreign key of account_id of Accounts.
The card_id of Financial_Transactions is the foreign key of card_id of Customers_Cards.

##Role Access Policy (Column-Level):
Role: FinancialController
Accessible Columns: Accounts: account_id, customer_id, account_name; Customers: customer_id, customer_first_name, customer_last_name; Customers_Cards: card_id, customer_id, card_type_code; Financial_Transactions: transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, other_transaction_details

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What are the different types of transactions?
Answer: SELECT DISTINCT transaction_type FROM Financial_Transactions
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT DISTINCT transaction_type FROM Financial_Transactions
##Instruction:
Database: customers_card_transactions
Total Tables: 4
Total Columns: 27

Table Schemas:

customers_card_transactions contains tables such as Accounts, Customers, Customers_Cards, Financial_Transactions.
Table Accounts has columns such as account_id, customer_id, account_name, other_account_details.
account_id is the primary key.
Table Customers has columns such as customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details.
customer_id is the primary key.
Table Customers_Cards has columns such as card_id, customer_id, card_type_code, card_number, date_valid_from, date_valid_to, other_card_details.
card_id is the primary key.
Table Financial_Transactions has columns such as transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, transaction_comment, other_transaction_details.
The account_id of Financial_Transactions is the foreign key of account_id of Accounts.
The card_id of Financial_Transactions is the foreign key of card_id of Customers_Cards.

##Role Access Policy (Column-Level):
Role: FinancialController
Accessible Columns: Accounts: account_id, customer_id, account_name; Customers: customer_id, customer_first_name, customer_last_name; Customers_Cards: card_id, customer_id, card_type_code; Financial_Transactions: transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, other_transaction_details

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Show the number of transaction types.
Answer: SELECT count(DISTINCT transaction_type) FROM Financial_Transactions
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT transaction_type) FROM Financial_Transactions
##Instruction:
Database: customers_card_transactions
Total Tables: 4
Total Columns: 27

Table Schemas:

customers_card_transactions contains tables such as Accounts, Customers, Customers_Cards, Financial_Transactions.
Table Accounts has columns such as account_id, customer_id, account_name, other_account_details.
account_id is the primary key.
Table Customers has columns such as customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details.
customer_id is the primary key.
Table Customers_Cards has columns such as card_id, customer_id, card_type_code, card_number, date_valid_from, date_valid_to, other_card_details.
card_id is the primary key.
Table Financial_Transactions has columns such as transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, transaction_comment, other_transaction_details.
The account_id of Financial_Transactions is the foreign key of account_id of Accounts.
The card_id of Financial_Transactions is the foreign key of card_id of Customers_Cards.

##Role Access Policy (Column-Level):
Role: FinancialController
Accessible Columns: Accounts: account_id, customer_id, account_name; Customers: customer_id, customer_first_name, customer_last_name; Customers_Cards: card_id, customer_id, card_type_code; Financial_Transactions: transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, other_transaction_details

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: How many different types of transactions are there?
Answer: SELECT count(DISTINCT transaction_type) FROM Financial_Transactions
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT transaction_type) FROM Financial_Transactions
##Instruction:
Database: customers_card_transactions
Total Tables: 4
Total Columns: 27

Table Schemas:

customers_card_transactions contains tables such as Accounts, Customers, Customers_Cards, Financial_Transactions.
Table Accounts has columns such as account_id, customer_id, account_name, other_account_details.
account_id is the primary key.
Table Customers has columns such as customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details.
customer_id is the primary key.
Table Customers_Cards has columns such as card_id, customer_id, card_type_code, card_number, date_valid_from, date_valid_to, other_card_details.
card_id is the primary key.
Table Financial_Transactions has columns such as transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, transaction_comment, other_transaction_details.
The account_id of Financial_Transactions is the foreign key of account_id of Accounts.
The card_id of Financial_Transactions is the foreign key of card_id of Customers_Cards.

##Role Access Policy (Column-Level):
Role: FinancialController
Accessible Columns: Accounts: account_id, customer_id, account_name; Customers: customer_id, customer_first_name, customer_last_name; Customers_Cards: card_id, customer_id, card_type_code; Financial_Transactions: transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, other_transaction_details

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What is the average and total transaction amount?
Answer: SELECT avg(transaction_amount) ,  sum(transaction_amount) FROM Financial_transactions
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(transaction_amount) ,  sum(transaction_amount) FROM Financial_transactions
##Instruction:
Database: customers_card_transactions
Total Tables: 4
Total Columns: 27

Table Schemas:

customers_card_transactions contains tables such as Accounts, Customers, Customers_Cards, Financial_Transactions.
Table Accounts has columns such as account_id, customer_id, account_name, other_account_details.
account_id is the primary key.
Table Customers has columns such as customer_id, customer_first_name, customer_last_name, customer_address, customer_phone, customer_email, other_customer_details.
customer_id is the primary key.
Table Customers_Cards has columns such as card_id, customer_id, card_type_code, card_number, date_valid_from, date_valid_to, other_card_details.
card_id is the primary key.
Table Financial_Transactions has columns such as transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, transaction_comment, other_transaction_details.
The account_id of Financial_Transactions is the foreign key of account_id of Accounts.
The card_id of Financial_Transactions is the foreign key of card_id of Customers_Cards.

##Role Access Policy (Column-Level):
Role: FinancialController
Accessible Columns: Accounts: account_id, customer_id, account_name; Customers: customer_id, customer_first_name, customer_last_name; Customers_Cards: card_id, customer_id, card_type_code; Financial_Transactions: transaction_id, previous_transaction_id, account_id, card_id, transaction_type, transaction_date, transaction_amount, other_transaction_details

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Return the average transaction amount, as well as the total amount of all transactions.
Answer: SELECT avg(transaction_amount) ,  sum(transaction_amount) FROM Financial_transactions
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(transaction_amount) ,  sum(transaction_amount) FROM Financial_transactions