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: How many different position for players are listed?
Answer: SELECT count(DISTINCT POSITION) FROM player
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT POSITION) FROM player
##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 name of players who get more than the average points.
Answer: SELECT name FROM player WHERE points  >  (SELECT avg(points) FROM player)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM player WHERE points  >  (SELECT avg(points) FROM player)
##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 players that got more than the average number of points?
Answer: SELECT name FROM player WHERE points  >  (SELECT avg(points) FROM player)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM player WHERE points  >  (SELECT avg(points) FROM player)
##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: find the number of players whose points are lower than 30 in each position.
Answer: SELECT count(*) ,  POSITION FROM player WHERE points  <  30 GROUP BY POSITION
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) ,  POSITION FROM player WHERE points  <  30 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: What is the number of players who have points less than 30 for each position?
Answer: SELECT count(*) ,  POSITION FROM player WHERE points  <  30 GROUP BY POSITION
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) ,  POSITION FROM player WHERE points  <  30 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: which country did participated in the most number of Tournament competitions?
Answer: SELECT country FROM competition WHERE competition_type  =  'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT country FROM competition WHERE competition_type  =  'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1
##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 name of the country that participated in the most tournament competitions?
Answer: SELECT country FROM competition WHERE competition_type  =  'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT country FROM competition WHERE competition_type  =  'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1
##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: which countries did participated in both Friendly and Tournament type competitions.
Answer: SELECT country FROM competition WHERE competition_type  =  'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type  =  'Tournament'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT country FROM competition WHERE competition_type  =  'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type  =  'Tournament'
##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 countries that participated in both friendly and tournament type competitions?
Answer: SELECT country FROM competition WHERE competition_type  =  'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type  =  'Tournament'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT country FROM competition WHERE competition_type  =  'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type  =  'Tournament'
##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: Find the countries that have never participated in any competition with Friendly type.
Answer: SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type  =  'Friendly'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type  =  'Friendly'
##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 countries that have never participated in any friendly-type competitions?
Answer: SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type  =  'Friendly'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type  =  'Friendly'
##Instruction:
Database: wedding
Total Tables: 3
Total Columns: 14

Table Schemas:

wedding contains tables such as people, church, wedding.
Table people has columns such as People_ID, Name, Country, Is_Male, Age.
People_ID is the primary key.
Table church has columns such as Church_ID, Name, Organized_by, Open_Date, Continuation_of.
Church_ID is the primary key.
Table wedding has columns such as Church_ID, Male_ID, Female_ID, Year.
Church_ID is the primary key.
The Female_ID of wedding is the foreign key of People_ID of people.
The Male_ID of wedding is the foreign key of People_ID of people.
The Church_ID of wedding is the foreign key of Church_ID of church.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - church: Continuation_of, Name, Open_Date, Organized_by
  - people: * (all columns)
  - wedding: Male_ID, Year

Question: How many churches opened before 1850 are there?
Answer: SELECT count(*) FROM Church WHERE Open_Date  <  1850
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM Church WHERE Open_Date  <  1850
##Instruction:
Database: wedding
Total Tables: 3
Total Columns: 14

Table Schemas:

wedding contains tables such as people, church, wedding.
Table people has columns such as People_ID, Name, Country, Is_Male, Age.
People_ID is the primary key.
Table church has columns such as Church_ID, Name, Organized_by, Open_Date, Continuation_of.
Church_ID is the primary key.
Table wedding has columns such as Church_ID, Male_ID, Female_ID, Year.
Church_ID is the primary key.
The Female_ID of wedding is the foreign key of People_ID of people.
The Male_ID of wedding is the foreign key of People_ID of people.
The Church_ID of wedding is the foreign key of Church_ID of church.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - church: Continuation_of, Name, Open_Date, Organized_by
  - people: * (all columns)
  - wedding: Male_ID, Year

Question: Show the name, open date, and organizer for all churches.
Answer: SELECT name ,  open_date ,  organized_by FROM Church
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name ,  open_date ,  organized_by FROM Church
##Instruction:
Database: wedding
Total Tables: 3
Total Columns: 14

Table Schemas:

wedding contains tables such as people, church, wedding.
Table people has columns such as People_ID, Name, Country, Is_Male, Age.
People_ID is the primary key.
Table church has columns such as Church_ID, Name, Organized_by, Open_Date, Continuation_of.
Church_ID is the primary key.
Table wedding has columns such as Church_ID, Male_ID, Female_ID, Year.
Church_ID is the primary key.
The Female_ID of wedding is the foreign key of People_ID of people.
The Male_ID of wedding is the foreign key of People_ID of people.
The Church_ID of wedding is the foreign key of Church_ID of church.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - church: Continuation_of, Name, Open_Date, Organized_by
  - people: * (all columns)
  - wedding: Male_ID, Year

Question: List all church names in descending order of opening date.
Answer: SELECT name FROM church ORDER BY open_date DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM church ORDER BY open_date DESC
##Instruction:
Database: wedding
Total Tables: 3
Total Columns: 14

Table Schemas:

wedding contains tables such as people, church, wedding.
Table people has columns such as People_ID, Name, Country, Is_Male, Age.
People_ID is the primary key.
Table church has columns such as Church_ID, Name, Organized_by, Open_Date, Continuation_of.
Church_ID is the primary key.
Table wedding has columns such as Church_ID, Male_ID, Female_ID, Year.
Church_ID is the primary key.
The Female_ID of wedding is the foreign key of People_ID of people.
The Male_ID of wedding is the foreign key of People_ID of people.
The Church_ID of wedding is the foreign key of Church_ID of church.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - church: Continuation_of, Name, Open_Date, Organized_by
  - people: * (all columns)
  - wedding: Male_ID, Year

Question: Show the opening year in whcih at least two churches opened.
Answer: SELECT open_date FROM church GROUP BY open_date HAVING count(*)  >=  2
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT open_date FROM church GROUP BY open_date HAVING count(*)  >=  2