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

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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 is the denomination of the school the most players belong to?
Answer: SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1
##Instruction:
Database: school_player
Total Tables: 4
Total Columns: 26

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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 locations and nicknames of schools.
Answer: SELECT T1.Location ,  T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID  =  T2.School_ID
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Location ,  T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID  =  T2.School_ID
##Instruction:
Database: school_player
Total Tables: 4
Total Columns: 26

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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 location and nickname of each school?
Answer: SELECT T1.Location ,  T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID  =  T2.School_ID
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Location ,  T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID  =  T2.School_ID
##Instruction:
Database: school_player
Total Tables: 4
Total Columns: 26

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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: Please show different denominations and the corresponding number of schools.
Answer: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination
##Instruction:
Database: school_player
Total Tables: 4
Total Columns: 26

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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: For each denomination, return the denomination and the count of schools with that denomination.
Answer: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination
##Instruction:
Database: school_player
Total Tables: 4
Total Columns: 26

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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: Please show different denominations and the corresponding number of schools in descending order.
Answer: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC
##Instruction:
Database: school_player
Total Tables: 4
Total Columns: 26

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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: Order denominations in descending order of the count of schools with the denomination. Return each denomination with the count of schools.
Answer: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC
##Instruction:
Database: school_player
Total Tables: 4
Total Columns: 26

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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: List the school color of the school that has the largest enrollment.
Answer: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
##Instruction:
Database: school_player
Total Tables: 4
Total Columns: 26

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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 is the school color of the school with the largest enrollment?
Answer: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
##Instruction:
Database: school_player
Total Tables: 4
Total Columns: 26

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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: List the locations of schools that do not have any player.
Answer: SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player)
##Instruction:
Database: school_player
Total Tables: 4
Total Columns: 26

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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 schools do not have any player? Give me the school locations.
Answer: SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player)
##Instruction:
Database: school_player
Total Tables: 4
Total Columns: 26

Table Schemas:

school_player contains tables such as school, school_details, school_performance, player.
Table school has columns such as School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors.
School_ID is the primary key.
Table school_details has columns such as School_ID, Nickname, Colors, League, Class, Division.
School_ID is the primary key.
Table school_performance has columns such as School_Id, School_Year, Class_A, Class_AA.
School_Id is the primary key.
Table player has columns such as Player_ID, Player, Team, Age, Position, School_ID.
Player_ID is the primary key.
The School_ID of school_details is the foreign key of School_ID of school.
The School_Id of school_performance is the foreign key of School_ID of school.
The School_ID of player is the foreign key of School_ID of school.

##Role Access Policy (Column-Level):
Role: PublicRelations
Accessible Columns: school: School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors; school_details: School_ID, Nickname, Colors, League, Class, Division; school_performance: School_Id, School_Year, Class_A, Class_AA; player: Player_ID, Player, Team, Position, School_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 denomination shared by schools founded before 1890 and schools founded after 1900
Answer: SELECT Denomination FROM school WHERE Founded  <  1890 INTERSECT SELECT Denomination FROM school WHERE Founded  >  1900
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Denomination FROM school WHERE Founded  <  1890 INTERSECT SELECT Denomination FROM school WHERE Founded  >  1900