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

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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 party names and their region names.
Answer: SELECT T1.party_name ,  T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.party_name ,  T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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 names of parties and their respective regions?
Answer: SELECT T1.party_name ,  T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.party_name ,  T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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 names of parties that does not have any members.
Answer: SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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 names of parties that have no members?
Answer: SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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 member names which are in both the party with id 3 and the party with id 1.
Answer: SELECT member_name FROM member WHERE party_id  =  3 INTERSECT SELECT member_name FROM member WHERE party_id  =  1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT member_name FROM member WHERE party_id  =  3 INTERSECT SELECT member_name FROM member WHERE party_id  =  1
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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: Which member names are shared among members in the party with the id 3 and the party with the id 1?
Answer: SELECT member_name FROM member WHERE party_id  =  3 INTERSECT SELECT member_name FROM member WHERE party_id  =  1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT member_name FROM member WHERE party_id  =  3 INTERSECT SELECT member_name FROM member WHERE party_id  =  1
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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 member names that are not in the Progress Party.
Answer: SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id WHERE T2.Party_name != "Progress Party"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id WHERE T2.Party_name != "Progress Party"
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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: Which member names corresponding to members who are not in the Progress Party?
Answer: SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id WHERE T2.Party_name != "Progress Party"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id WHERE T2.Party_name != "Progress Party"
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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 party events do we have?
Answer: SELECT count(*) FROM party_events
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM party_events
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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: Count the number of party events.
Answer: SELECT count(*) FROM party_events
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM party_events
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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 party names and the number of events for each party.
Answer: SELECT T2.party_name ,  count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id GROUP BY T1.party_id
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.party_name ,  count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id GROUP BY T1.party_id
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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 events are there for each party?
Answer: SELECT T2.party_name ,  count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id GROUP BY T1.party_id
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.party_name ,  count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id GROUP BY T1.party_id
##Instruction:
Database: party_people
Total Tables: 4
Total Columns: 20

Table Schemas:

party_people contains tables such as region, party, member, party_events.
Table region has columns such as Region_ID, Region_name, Date, Label, Format, Catalogue.
Region_ID is the primary key.
Table party has columns such as Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name.
Party_ID is the primary key.
Table member has columns such as Member_ID, Member_Name, Party_ID, In_office.
Member_ID is the primary key.
Table party_events has columns such as Event_ID, Event_Name, Party_ID, Member_in_charge_ID.
Event_ID is the primary key.
The Region_ID of party is the foreign key of Region_ID of region.
The Party_ID of member is the foreign key of Party_ID of party.
The Member_in_charge_ID of party_events is the foreign key of Member_ID of member.
The Party_ID of party_events is the foreign key of Party_ID of party.

##Role Access Policy (Column-Level):
Role: RegionalCoordinator
Accessible Columns: region: Region_ID, Region_name, Date, Label, Format; party: Party_ID, Party_name, Region_ID; member: Member_ID, Member_Name, Party_ID; party_events: Event_ID, Event_Name, Party_ID, Member_in_charge_ID

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 member names who are not in charge of any event.
Answer: SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id  =  T2.member_in_charge_id
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id  =  T2.member_in_charge_id