sharkiefff/RBAC-Text2SQL-Benchmark huggingface dataset:
##Instruction:
Database: insurance_policies
Total Tables: 5
Total Columns: 25

Table Schemas:

insurance_policies contains tables such as Customers, Customer_Policies, Claims, Settlements, Payments.
Table Customers has columns such as Customer_ID, Customer_Details.
Customer_ID is the primary key.
Table Customer_Policies has columns such as Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date.
Policy_ID is the primary key.
Table Claims has columns such as Claim_ID, Policy_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled.
Claim_ID is the primary key.
Table Settlements has columns such as Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled, Customer_Policy_ID.
Settlement_ID is the primary key.
Table Payments has columns such as Payment_ID, Settlement_ID, Payment_Method_Code, Date_Payment_Made, Amount_Payment.
Payment_ID is the primary key.
The Customer_ID of Customer_Policies is the foreign key of Customer_ID of Customers.
The Policy_ID of Claims is the foreign key of Policy_ID of Customer_Policies.
The Claim_ID of Settlements is the foreign key of Claim_ID of Claims.
The Settlement_ID of Payments is the foreign key of Settlement_ID of Settlements.

##Role Access Policy (Column-Level):
Role: ClaimsAdjuster
Accessible Columns: Customers: Customer_ID, Customer_Details; Customer_Policies: Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date; Claims: ALL COLUMNS; Settlements: Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled; Payments: Payment_ID, Settlement_ID, Date_Payment_Made

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: Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount.
Answer: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1
##Instruction:
Database: insurance_policies
Total Tables: 5
Total Columns: 25

Table Schemas:

insurance_policies contains tables such as Customers, Customer_Policies, Claims, Settlements, Payments.
Table Customers has columns such as Customer_ID, Customer_Details.
Customer_ID is the primary key.
Table Customer_Policies has columns such as Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date.
Policy_ID is the primary key.
Table Claims has columns such as Claim_ID, Policy_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled.
Claim_ID is the primary key.
Table Settlements has columns such as Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled, Customer_Policy_ID.
Settlement_ID is the primary key.
Table Payments has columns such as Payment_ID, Settlement_ID, Payment_Method_Code, Date_Payment_Made, Amount_Payment.
Payment_ID is the primary key.
The Customer_ID of Customer_Policies is the foreign key of Customer_ID of Customers.
The Policy_ID of Claims is the foreign key of Policy_ID of Customer_Policies.
The Claim_ID of Settlements is the foreign key of Claim_ID of Claims.
The Settlement_ID of Payments is the foreign key of Settlement_ID of Settlements.

##Role Access Policy (Column-Level):
Role: ClaimsAdjuster
Accessible Columns: Customers: Customer_ID, Customer_Details; Customer_Policies: Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date; Claims: ALL COLUMNS; Settlements: Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled; Payments: Payment_ID, Settlement_ID, Date_Payment_Made

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: Find the settlement amount of the claim with the largest claim amount. Show both the settlement amount and claim amount.
Answer: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1
##Instruction:
Database: insurance_policies
Total Tables: 5
Total Columns: 25

Table Schemas:

insurance_policies contains tables such as Customers, Customer_Policies, Claims, Settlements, Payments.
Table Customers has columns such as Customer_ID, Customer_Details.
Customer_ID is the primary key.
Table Customer_Policies has columns such as Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date.
Policy_ID is the primary key.
Table Claims has columns such as Claim_ID, Policy_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled.
Claim_ID is the primary key.
Table Settlements has columns such as Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled, Customer_Policy_ID.
Settlement_ID is the primary key.
Table Payments has columns such as Payment_ID, Settlement_ID, Payment_Method_Code, Date_Payment_Made, Amount_Payment.
Payment_ID is the primary key.
The Customer_ID of Customer_Policies is the foreign key of Customer_ID of Customers.
The Policy_ID of Claims is the foreign key of Policy_ID of Customer_Policies.
The Claim_ID of Settlements is the foreign key of Claim_ID of Claims.
The Settlement_ID of Payments is the foreign key of Settlement_ID of Settlements.

##Role Access Policy (Column-Level):
Role: ClaimsAdjuster
Accessible Columns: Customers: Customer_ID, Customer_Details; Customer_Policies: Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date; Claims: ALL COLUMNS; Settlements: Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled; Payments: Payment_ID, Settlement_ID, Date_Payment_Made

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: Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim amount.
Answer: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1
##Instruction:
Database: insurance_policies
Total Tables: 5
Total Columns: 25

Table Schemas:

insurance_policies contains tables such as Customers, Customer_Policies, Claims, Settlements, Payments.
Table Customers has columns such as Customer_ID, Customer_Details.
Customer_ID is the primary key.
Table Customer_Policies has columns such as Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date.
Policy_ID is the primary key.
Table Claims has columns such as Claim_ID, Policy_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled.
Claim_ID is the primary key.
Table Settlements has columns such as Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled, Customer_Policy_ID.
Settlement_ID is the primary key.
Table Payments has columns such as Payment_ID, Settlement_ID, Payment_Method_Code, Date_Payment_Made, Amount_Payment.
Payment_ID is the primary key.
The Customer_ID of Customer_Policies is the foreign key of Customer_ID of Customers.
The Policy_ID of Claims is the foreign key of Policy_ID of Customer_Policies.
The Claim_ID of Settlements is the foreign key of Claim_ID of Claims.
The Settlement_ID of Payments is the foreign key of Settlement_ID of Settlements.

##Role Access Policy (Column-Level):
Role: ClaimsAdjuster
Accessible Columns: Customers: Customer_ID, Customer_Details; Customer_Policies: Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date; Claims: ALL COLUMNS; Settlements: Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled; Payments: Payment_ID, Settlement_ID, Date_Payment_Made

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: Find the claimed amount in the claim with the least amount settled. Show both the settlement amount and claim amount.
Answer: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1
##Instruction:
Database: insurance_policies
Total Tables: 5
Total Columns: 25

Table Schemas:

insurance_policies contains tables such as Customers, Customer_Policies, Claims, Settlements, Payments.
Table Customers has columns such as Customer_ID, Customer_Details.
Customer_ID is the primary key.
Table Customer_Policies has columns such as Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date.
Policy_ID is the primary key.
Table Claims has columns such as Claim_ID, Policy_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled.
Claim_ID is the primary key.
Table Settlements has columns such as Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled, Customer_Policy_ID.
Settlement_ID is the primary key.
Table Payments has columns such as Payment_ID, Settlement_ID, Payment_Method_Code, Date_Payment_Made, Amount_Payment.
Payment_ID is the primary key.
The Customer_ID of Customer_Policies is the foreign key of Customer_ID of Customers.
The Policy_ID of Claims is the foreign key of Policy_ID of Customer_Policies.
The Claim_ID of Settlements is the foreign key of Claim_ID of Claims.
The Settlement_ID of Payments is the foreign key of Settlement_ID of Settlements.

##Role Access Policy (Column-Level):
Role: ClaimsAdjuster
Accessible Columns: Customers: Customer_ID, Customer_Details; Customer_Policies: Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date; Claims: ALL COLUMNS; Settlements: Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled; Payments: Payment_ID, Settlement_ID, Date_Payment_Made

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: Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled.
Answer: SELECT Date_Claim_Made ,  Date_Claim_Settled FROM Claims WHERE Amount_Claimed  >  ( SELECT avg(Amount_Claimed) FROM Claims )
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Date_Claim_Made ,  Date_Claim_Settled FROM Claims WHERE Amount_Claimed  >  ( SELECT avg(Amount_Claimed) FROM Claims )
##Instruction:
Database: insurance_policies
Total Tables: 5
Total Columns: 25

Table Schemas:

insurance_policies contains tables such as Customers, Customer_Policies, Claims, Settlements, Payments.
Table Customers has columns such as Customer_ID, Customer_Details.
Customer_ID is the primary key.
Table Customer_Policies has columns such as Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date.
Policy_ID is the primary key.
Table Claims has columns such as Claim_ID, Policy_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled.
Claim_ID is the primary key.
Table Settlements has columns such as Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled, Customer_Policy_ID.
Settlement_ID is the primary key.
Table Payments has columns such as Payment_ID, Settlement_ID, Payment_Method_Code, Date_Payment_Made, Amount_Payment.
Payment_ID is the primary key.
The Customer_ID of Customer_Policies is the foreign key of Customer_ID of Customers.
The Policy_ID of Claims is the foreign key of Policy_ID of Customer_Policies.
The Claim_ID of Settlements is the foreign key of Claim_ID of Claims.
The Settlement_ID of Payments is the foreign key of Settlement_ID of Settlements.

##Role Access Policy (Column-Level):
Role: ClaimsAdjuster
Accessible Columns: Customers: Customer_ID, Customer_Details; Customer_Policies: Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date; Claims: ALL COLUMNS; Settlements: Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled; Payments: Payment_ID, Settlement_ID, Date_Payment_Made

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: Give me the claim date, settlement date for all the claims whose claimed amount is larger than the average.
Answer: SELECT Date_Claim_Made ,  Date_Claim_Settled FROM Claims WHERE Amount_Claimed  >  ( SELECT avg(Amount_Claimed) FROM Claims )
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Date_Claim_Made ,  Date_Claim_Settled FROM Claims WHERE Amount_Claimed  >  ( SELECT avg(Amount_Claimed) FROM Claims )
##Instruction:
Database: insurance_policies
Total Tables: 5
Total Columns: 25

Table Schemas:

insurance_policies contains tables such as Customers, Customer_Policies, Claims, Settlements, Payments.
Table Customers has columns such as Customer_ID, Customer_Details.
Customer_ID is the primary key.
Table Customer_Policies has columns such as Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date.
Policy_ID is the primary key.
Table Claims has columns such as Claim_ID, Policy_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled.
Claim_ID is the primary key.
Table Settlements has columns such as Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled, Customer_Policy_ID.
Settlement_ID is the primary key.
Table Payments has columns such as Payment_ID, Settlement_ID, Payment_Method_Code, Date_Payment_Made, Amount_Payment.
Payment_ID is the primary key.
The Customer_ID of Customer_Policies is the foreign key of Customer_ID of Customers.
The Policy_ID of Claims is the foreign key of Policy_ID of Customer_Policies.
The Claim_ID of Settlements is the foreign key of Claim_ID of Claims.
The Settlement_ID of Payments is the foreign key of Settlement_ID of Settlements.

##Role Access Policy (Column-Level):
Role: ClaimsAdjuster
Accessible Columns: Customers: Customer_ID, Customer_Details; Customer_Policies: Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date; Claims: ALL COLUMNS; Settlements: Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled; Payments: Payment_ID, Settlement_ID, Date_Payment_Made

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: Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date.
Answer: SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled  <=  ( SELECT avg(Amount_Settled) FROM Claims )
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled  <=  ( SELECT avg(Amount_Settled) FROM Claims )
##Instruction:
Database: insurance_policies
Total Tables: 5
Total Columns: 25

Table Schemas:

insurance_policies contains tables such as Customers, Customer_Policies, Claims, Settlements, Payments.
Table Customers has columns such as Customer_ID, Customer_Details.
Customer_ID is the primary key.
Table Customer_Policies has columns such as Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date.
Policy_ID is the primary key.
Table Claims has columns such as Claim_ID, Policy_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled.
Claim_ID is the primary key.
Table Settlements has columns such as Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled, Customer_Policy_ID.
Settlement_ID is the primary key.
Table Payments has columns such as Payment_ID, Settlement_ID, Payment_Method_Code, Date_Payment_Made, Amount_Payment.
Payment_ID is the primary key.
The Customer_ID of Customer_Policies is the foreign key of Customer_ID of Customers.
The Policy_ID of Claims is the foreign key of Policy_ID of Customer_Policies.
The Claim_ID of Settlements is the foreign key of Claim_ID of Claims.
The Settlement_ID of Payments is the foreign key of Settlement_ID of Settlements.

##Role Access Policy (Column-Level):
Role: ClaimsAdjuster
Accessible Columns: Customers: Customer_ID, Customer_Details; Customer_Policies: Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date; Claims: ALL COLUMNS; Settlements: Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled; Payments: Payment_ID, Settlement_ID, Date_Payment_Made

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 claim start date for the claims whose claimed amount is no more than the average
Answer: SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled  <=  ( SELECT avg(Amount_Settled) FROM Claims )
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled  <=  ( SELECT avg(Amount_Settled) FROM Claims )
##Instruction:
Database: insurance_policies
Total Tables: 5
Total Columns: 25

Table Schemas:

insurance_policies contains tables such as Customers, Customer_Policies, Claims, Settlements, Payments.
Table Customers has columns such as Customer_ID, Customer_Details.
Customer_ID is the primary key.
Table Customer_Policies has columns such as Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date.
Policy_ID is the primary key.
Table Claims has columns such as Claim_ID, Policy_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled.
Claim_ID is the primary key.
Table Settlements has columns such as Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled, Customer_Policy_ID.
Settlement_ID is the primary key.
Table Payments has columns such as Payment_ID, Settlement_ID, Payment_Method_Code, Date_Payment_Made, Amount_Payment.
Payment_ID is the primary key.
The Customer_ID of Customer_Policies is the foreign key of Customer_ID of Customers.
The Policy_ID of Claims is the foreign key of Policy_ID of Customer_Policies.
The Claim_ID of Settlements is the foreign key of Claim_ID of Claims.
The Settlement_ID of Payments is the foreign key of Settlement_ID of Settlements.

##Role Access Policy (Column-Level):
Role: ClaimsAdjuster
Accessible Columns: Customers: Customer_ID, Customer_Details; Customer_Policies: Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date; Claims: ALL COLUMNS; Settlements: Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled; Payments: Payment_ID, Settlement_ID, Date_Payment_Made

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 settlements does each claim correspond to? List the claim id and the number of settlements.
Answer: SELECT T1.Claim_id ,  count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id  =  T2.claim_id GROUP BY T1.claim_id
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Claim_id ,  count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id  =  T2.claim_id GROUP BY T1.claim_id
##Instruction:
Database: insurance_policies
Total Tables: 5
Total Columns: 25

Table Schemas:

insurance_policies contains tables such as Customers, Customer_Policies, Claims, Settlements, Payments.
Table Customers has columns such as Customer_ID, Customer_Details.
Customer_ID is the primary key.
Table Customer_Policies has columns such as Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date.
Policy_ID is the primary key.
Table Claims has columns such as Claim_ID, Policy_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled.
Claim_ID is the primary key.
Table Settlements has columns such as Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled, Customer_Policy_ID.
Settlement_ID is the primary key.
Table Payments has columns such as Payment_ID, Settlement_ID, Payment_Method_Code, Date_Payment_Made, Amount_Payment.
Payment_ID is the primary key.
The Customer_ID of Customer_Policies is the foreign key of Customer_ID of Customers.
The Policy_ID of Claims is the foreign key of Policy_ID of Customer_Policies.
The Claim_ID of Settlements is the foreign key of Claim_ID of Claims.
The Settlement_ID of Payments is the foreign key of Settlement_ID of Settlements.

##Role Access Policy (Column-Level):
Role: ClaimsAdjuster
Accessible Columns: Customers: Customer_ID, Customer_Details; Customer_Policies: Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date; Claims: ALL COLUMNS; Settlements: Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled; Payments: Payment_ID, Settlement_ID, Date_Payment_Made

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: Find the number of settlements each claim corresponds to. Show the number together with the claim id.
Answer: SELECT T1.Claim_id ,  count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id  =  T2.claim_id GROUP BY T1.claim_id
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Claim_id ,  count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id  =  T2.claim_id GROUP BY T1.claim_id