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

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: What is the total number of clubs that have less than 10 medals in total?
Answer: Sorry, I cannot answer.
Permission: denied (All required columns are permitted)
Gold SQL: SELECT count(*) FROM club_rank WHERE Total  <  10
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: List all club names in ascending order of start year.
Answer: SELECT name FROM club ORDER BY Start_year ASC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM club ORDER BY Start_year ASC
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: What are the names of all the clubs starting with the oldest?
Answer: SELECT name FROM club ORDER BY Start_year ASC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM club ORDER BY Start_year ASC
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: List all club names in descending alphabetical order.
Answer: SELECT name FROM club ORDER BY name DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM club ORDER BY name DESC
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: What are the names of all the clubs ordered in descending alphabetical order?
Answer: SELECT name FROM club ORDER BY name DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM club ORDER BY name DESC
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: Please show the names and the players of clubs.
Answer: SELECT T1.name ,  T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.name ,  T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: What are the names and players of all the clubs?
Answer: SELECT T1.name ,  T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.name ,  T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: Show the names of clubs that have players with position "Right Wing".
Answer: SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T2.Position  =  "Right Wing"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T2.Position  =  "Right Wing"
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: What are the names of the clubs that have players in the position of "Right Wing"?
Answer: SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T2.Position  =  "Right Wing"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T2.Position  =  "Right Wing"
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: What is the average points of players from club with name "AIB".
Answer: SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T1.name  =  "AIB"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T1.name  =  "AIB"
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: What is the average number of points for players from the "AIB" club?
Answer: SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T1.name  =  "AIB"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T1.name  =  "AIB"
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: List the position of players and the average number of points of players of each position.
Answer: SELECT POSITION ,  avg(Points) FROM player GROUP BY POSITION
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT POSITION ,  avg(Points) FROM player GROUP BY POSITION
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: For each position, what is the average number of points for players in that position?
Answer: SELECT POSITION ,  avg(Points) FROM player GROUP BY POSITION
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT POSITION ,  avg(Points) FROM player GROUP BY POSITION
##Instruction:
Database: sports_competition
Total Tables: 5
Total Columns: 26

Table Schemas:

sports_competition contains tables such as club, club_rank, player, competition, competition_result.
Table club has columns such as Club_ID, name, Region, Start_year.
Club_ID is the primary key.
Table club_rank has columns such as Rank, Club_ID, Gold, Silver, Bronze, Total.
Rank is the primary key.
Table player has columns such as Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points.
Player_ID is the primary key.
Table competition has columns such as Competition_ID, Year, Competition_type, Country.
Competition_ID is the primary key.
Table competition_result has columns such as Competition_ID, Club_ID_1, Club_ID_2, Score.
Competition_ID is the primary key.
The Club_ID of club_rank is the foreign key of Club_ID of club.
The Club_ID of player is the foreign key of Club_ID of club.
The Competition_ID of competition_result is the foreign key of Competition_ID of competition.
The Club_ID_2 of competition_result is the foreign key of Club_ID of club.
The Club_ID_1 of competition_result is the foreign key of Club_ID of club.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - club: * (all columns)
  - club_rank: Bronze, Gold, Rank, Silver
  - competition: * (all columns)
  - competition_result: Club_ID_2, Competition_ID, Score
  - player: * (all columns)

Question: List the position of players with average number of points scored by players of that position bigger than 20.
Answer: SELECT POSITION FROM player GROUP BY name HAVING avg(Points)  >=  20
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT POSITION FROM player GROUP BY name HAVING avg(Points)  >=  20