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

Table Schemas:

match_season contains tables such as country, team, match_season, player.
Table country has columns such as Country_id, Country_name, Capital, Official_native_language.
Country_id is the primary key.
Table team has columns such as Team_id, Name.
Team_id is the primary key.
Table match_season has columns such as Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College.
Season is the primary key.
Table player has columns such as Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team.
Player_ID is the primary key.
The Team of match_season is the foreign key of Team_id of team.
The Country of match_season is the foreign key of Country_id of country.
The Team of player is the foreign key of Team_id of team.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - country: * (all columns)
  - match_season: * (all columns)
  - player: * (all columns)
  - team: Team_id

Question: Show the name of colleges that have at least two players.
Answer: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2
##Instruction:
Database: match_season
Total Tables: 4
Total Columns: 21

Table Schemas:

match_season contains tables such as country, team, match_season, player.
Table country has columns such as Country_id, Country_name, Capital, Official_native_language.
Country_id is the primary key.
Table team has columns such as Team_id, Name.
Team_id is the primary key.
Table match_season has columns such as Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College.
Season is the primary key.
Table player has columns such as Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team.
Player_ID is the primary key.
The Team of match_season is the foreign key of Team_id of team.
The Country of match_season is the foreign key of Country_id of country.
The Team of player is the foreign key of Team_id of team.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - country: * (all columns)
  - match_season: * (all columns)
  - player: * (all columns)
  - team: Team_id

Question: What are the names of all colleges that have two or more players?
Answer: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2
##Instruction:
Database: match_season
Total Tables: 4
Total Columns: 21

Table Schemas:

match_season contains tables such as country, team, match_season, player.
Table country has columns such as Country_id, Country_name, Capital, Official_native_language.
Country_id is the primary key.
Table team has columns such as Team_id, Name.
Team_id is the primary key.
Table match_season has columns such as Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College.
Season is the primary key.
Table player has columns such as Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team.
Player_ID is the primary key.
The Team of match_season is the foreign key of Team_id of team.
The Country of match_season is the foreign key of Country_id of country.
The Team of player is the foreign key of Team_id of team.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - country: * (all columns)
  - match_season: * (all columns)
  - player: * (all columns)
  - team: Team_id

Question: Show the name of colleges that have at least two players in descending alphabetical order.
Answer: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2 ORDER BY College DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2 ORDER BY College DESC
##Instruction:
Database: match_season
Total Tables: 4
Total Columns: 21

Table Schemas:

match_season contains tables such as country, team, match_season, player.
Table country has columns such as Country_id, Country_name, Capital, Official_native_language.
Country_id is the primary key.
Table team has columns such as Team_id, Name.
Team_id is the primary key.
Table match_season has columns such as Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College.
Season is the primary key.
Table player has columns such as Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team.
Player_ID is the primary key.
The Team of match_season is the foreign key of Team_id of team.
The Country of match_season is the foreign key of Country_id of country.
The Team of player is the foreign key of Team_id of team.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - country: * (all columns)
  - match_season: * (all columns)
  - player: * (all columns)
  - team: Team_id

Question: What are the names of colleges that have two or more players, listed in descending alphabetical order?
Answer: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2 ORDER BY College DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2 ORDER BY College DESC
##Instruction:
Database: match_season
Total Tables: 4
Total Columns: 21

Table Schemas:

match_season contains tables such as country, team, match_season, player.
Table country has columns such as Country_id, Country_name, Capital, Official_native_language.
Country_id is the primary key.
Table team has columns such as Team_id, Name.
Team_id is the primary key.
Table match_season has columns such as Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College.
Season is the primary key.
Table player has columns such as Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team.
Player_ID is the primary key.
The Team of match_season is the foreign key of Team_id of team.
The Country of match_season is the foreign key of Country_id of country.
The Team of player is the foreign key of Team_id of team.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - country: * (all columns)
  - match_season: * (all columns)
  - player: * (all columns)
  - team: Team_id

Question: What are the names of teams that do no have match season record?
Answer: Sorry, I cannot answer.
Permission: denied (All required columns are permitted)
Gold SQL: SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)
##Instruction:
Database: match_season
Total Tables: 4
Total Columns: 21

Table Schemas:

match_season contains tables such as country, team, match_season, player.
Table country has columns such as Country_id, Country_name, Capital, Official_native_language.
Country_id is the primary key.
Table team has columns such as Team_id, Name.
Team_id is the primary key.
Table match_season has columns such as Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College.
Season is the primary key.
Table player has columns such as Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team.
Player_ID is the primary key.
The Team of match_season is the foreign key of Team_id of team.
The Country of match_season is the foreign key of Country_id of country.
The Team of player is the foreign key of Team_id of team.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - country: * (all columns)
  - match_season: * (all columns)
  - player: * (all columns)
  - team: Team_id

Question: Return the names of teams that have no match season record.
Answer: Sorry, I cannot answer.
Permission: denied (All required columns are permitted)
Gold SQL: SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)
##Instruction:
Database: match_season
Total Tables: 4
Total Columns: 21

Table Schemas:

match_season contains tables such as country, team, match_season, player.
Table country has columns such as Country_id, Country_name, Capital, Official_native_language.
Country_id is the primary key.
Table team has columns such as Team_id, Name.
Team_id is the primary key.
Table match_season has columns such as Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College.
Season is the primary key.
Table player has columns such as Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team.
Player_ID is the primary key.
The Team of match_season is the foreign key of Team_id of team.
The Country of match_season is the foreign key of Country_id of country.
The Team of player is the foreign key of Team_id of team.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - country: * (all columns)
  - match_season: * (all columns)
  - player: * (all columns)
  - team: Team_id

Question: What are the names of countries that have both players with position forward and players with position defender?
Answer: SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Defender"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Defender"
##Instruction:
Database: match_season
Total Tables: 4
Total Columns: 21

Table Schemas:

match_season contains tables such as country, team, match_season, player.
Table country has columns such as Country_id, Country_name, Capital, Official_native_language.
Country_id is the primary key.
Table team has columns such as Team_id, Name.
Team_id is the primary key.
Table match_season has columns such as Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College.
Season is the primary key.
Table player has columns such as Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team.
Player_ID is the primary key.
The Team of match_season is the foreign key of Team_id of team.
The Country of match_season is the foreign key of Country_id of country.
The Team of player is the foreign key of Team_id of team.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - country: * (all columns)
  - match_season: * (all columns)
  - player: * (all columns)
  - team: Team_id

Question: Return the names of countries that have players that play the Forward position, as well as players who play the Defender position.
Answer: SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Defender"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Defender"
##Instruction:
Database: match_season
Total Tables: 4
Total Columns: 21

Table Schemas:

match_season contains tables such as country, team, match_season, player.
Table country has columns such as Country_id, Country_name, Capital, Official_native_language.
Country_id is the primary key.
Table team has columns such as Team_id, Name.
Team_id is the primary key.
Table match_season has columns such as Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College.
Season is the primary key.
Table player has columns such as Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team.
Player_ID is the primary key.
The Team of match_season is the foreign key of Team_id of team.
The Country of match_season is the foreign key of Country_id of country.
The Team of player is the foreign key of Team_id of team.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - country: * (all columns)
  - match_season: * (all columns)
  - player: * (all columns)
  - team: Team_id

Question: Which college have both players with position midfielder and players with position defender?
Answer: SELECT College FROM match_season WHERE POSITION  =  "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION  =  "Defender"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT College FROM match_season WHERE POSITION  =  "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION  =  "Defender"
##Instruction:
Database: match_season
Total Tables: 4
Total Columns: 21

Table Schemas:

match_season contains tables such as country, team, match_season, player.
Table country has columns such as Country_id, Country_name, Capital, Official_native_language.
Country_id is the primary key.
Table team has columns such as Team_id, Name.
Team_id is the primary key.
Table match_season has columns such as Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College.
Season is the primary key.
Table player has columns such as Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team.
Player_ID is the primary key.
The Team of match_season is the foreign key of Team_id of team.
The Country of match_season is the foreign key of Country_id of country.
The Team of player is the foreign key of Team_id of team.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - country: * (all columns)
  - match_season: * (all columns)
  - player: * (all columns)
  - team: Team_id

Question: Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.
Answer: SELECT College FROM match_season WHERE POSITION  =  "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION  =  "Defender"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT College FROM match_season WHERE POSITION  =  "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION  =  "Defender"
##Instruction:
Database: phone_market
Total Tables: 3
Total Columns: 13

Table Schemas:

phone_market contains tables such as phone, market, phone_market.
Table phone has columns such as Name, Phone_ID, Memory_in_G, Carrier, Price.
Phone_ID is the primary key.
Table market has columns such as Market_ID, District, Num_of_employees, Num_of_shops, Ranking.
Market_ID is the primary key.
Table phone_market has columns such as Market_ID, Phone_ID, Num_of_stock.
Market_ID is the primary key.
The Phone_ID of phone_market is the foreign key of Phone_ID of phone.
The Market_ID of phone_market is the foreign key of Market_ID of market.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - market: Num_of_shops, Ranking
  - phone: * (all columns)
  - phone_market: * (all columns)

Question: How many phones are there?
Answer: SELECT count(*) FROM phone
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM phone
##Instruction:
Database: phone_market
Total Tables: 3
Total Columns: 13

Table Schemas:

phone_market contains tables such as phone, market, phone_market.
Table phone has columns such as Name, Phone_ID, Memory_in_G, Carrier, Price.
Phone_ID is the primary key.
Table market has columns such as Market_ID, District, Num_of_employees, Num_of_shops, Ranking.
Market_ID is the primary key.
Table phone_market has columns such as Market_ID, Phone_ID, Num_of_stock.
Market_ID is the primary key.
The Phone_ID of phone_market is the foreign key of Phone_ID of phone.
The Market_ID of phone_market is the foreign key of Market_ID of market.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - market: Num_of_shops, Ranking
  - phone: * (all columns)
  - phone_market: * (all columns)

Question: List the names of phones in ascending order of price.
Answer: SELECT Name FROM phone ORDER BY Price ASC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Name FROM phone ORDER BY Price ASC
##Instruction:
Database: phone_market
Total Tables: 3
Total Columns: 13

Table Schemas:

phone_market contains tables such as phone, market, phone_market.
Table phone has columns such as Name, Phone_ID, Memory_in_G, Carrier, Price.
Phone_ID is the primary key.
Table market has columns such as Market_ID, District, Num_of_employees, Num_of_shops, Ranking.
Market_ID is the primary key.
Table phone_market has columns such as Market_ID, Phone_ID, Num_of_stock.
Market_ID is the primary key.
The Phone_ID of phone_market is the foreign key of Phone_ID of phone.
The Market_ID of phone_market is the foreign key of Market_ID of market.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - market: Num_of_shops, Ranking
  - phone: * (all columns)
  - phone_market: * (all columns)

Question: What are the memories and carriers of phones?
Answer: SELECT Memory_in_G ,  Carrier FROM phone
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Memory_in_G ,  Carrier FROM phone
##Instruction:
Database: phone_market
Total Tables: 3
Total Columns: 13

Table Schemas:

phone_market contains tables such as phone, market, phone_market.
Table phone has columns such as Name, Phone_ID, Memory_in_G, Carrier, Price.
Phone_ID is the primary key.
Table market has columns such as Market_ID, District, Num_of_employees, Num_of_shops, Ranking.
Market_ID is the primary key.
Table phone_market has columns such as Market_ID, Phone_ID, Num_of_stock.
Market_ID is the primary key.
The Phone_ID of phone_market is the foreign key of Phone_ID of phone.
The Market_ID of phone_market is the foreign key of Market_ID of market.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - market: Num_of_shops, Ranking
  - phone: * (all columns)
  - phone_market: * (all columns)

Question: List the distinct carriers of phones with memories bigger than 32.
Answer: SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G  >  32
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G  >  32
##Instruction:
Database: phone_market
Total Tables: 3
Total Columns: 13

Table Schemas:

phone_market contains tables such as phone, market, phone_market.
Table phone has columns such as Name, Phone_ID, Memory_in_G, Carrier, Price.
Phone_ID is the primary key.
Table market has columns such as Market_ID, District, Num_of_employees, Num_of_shops, Ranking.
Market_ID is the primary key.
Table phone_market has columns such as Market_ID, Phone_ID, Num_of_stock.
Market_ID is the primary key.
The Phone_ID of phone_market is the foreign key of Phone_ID of phone.
The Market_ID of phone_market is the foreign key of Market_ID of market.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - market: Num_of_shops, Ranking
  - phone: * (all columns)
  - phone_market: * (all columns)

Question: Show the names of phones with carrier either "Sprint" or "TMobile".
Answer: SELECT Name FROM phone WHERE Carrier  =  "Sprint" OR Carrier  =  "TMobile"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Name FROM phone WHERE Carrier  =  "Sprint" OR Carrier  =  "TMobile"
##Instruction:
Database: phone_market
Total Tables: 3
Total Columns: 13

Table Schemas:

phone_market contains tables such as phone, market, phone_market.
Table phone has columns such as Name, Phone_ID, Memory_in_G, Carrier, Price.
Phone_ID is the primary key.
Table market has columns such as Market_ID, District, Num_of_employees, Num_of_shops, Ranking.
Market_ID is the primary key.
Table phone_market has columns such as Market_ID, Phone_ID, Num_of_stock.
Market_ID is the primary key.
The Phone_ID of phone_market is the foreign key of Phone_ID of phone.
The Market_ID of phone_market is the foreign key of Market_ID of market.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - market: Num_of_shops, Ranking
  - phone: * (all columns)
  - phone_market: * (all columns)

Question: What is the carrier of the most expensive phone?
Answer: SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1
##Instruction:
Database: phone_market
Total Tables: 3
Total Columns: 13

Table Schemas:

phone_market contains tables such as phone, market, phone_market.
Table phone has columns such as Name, Phone_ID, Memory_in_G, Carrier, Price.
Phone_ID is the primary key.
Table market has columns such as Market_ID, District, Num_of_employees, Num_of_shops, Ranking.
Market_ID is the primary key.
Table phone_market has columns such as Market_ID, Phone_ID, Num_of_stock.
Market_ID is the primary key.
The Phone_ID of phone_market is the foreign key of Phone_ID of phone.
The Market_ID of phone_market is the foreign key of Market_ID of market.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - market: Num_of_shops, Ranking
  - phone: * (all columns)
  - phone_market: * (all columns)

Question: Show different carriers of phones together with the number of phones with each carrier.
Answer: SELECT Carrier ,  COUNT(*) FROM phone GROUP BY Carrier
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Carrier ,  COUNT(*) FROM phone GROUP BY Carrier
##Instruction:
Database: phone_market
Total Tables: 3
Total Columns: 13

Table Schemas:

phone_market contains tables such as phone, market, phone_market.
Table phone has columns such as Name, Phone_ID, Memory_in_G, Carrier, Price.
Phone_ID is the primary key.
Table market has columns such as Market_ID, District, Num_of_employees, Num_of_shops, Ranking.
Market_ID is the primary key.
Table phone_market has columns such as Market_ID, Phone_ID, Num_of_stock.
Market_ID is the primary key.
The Phone_ID of phone_market is the foreign key of Phone_ID of phone.
The Market_ID of phone_market is the foreign key of Market_ID of market.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - market: Num_of_shops, Ranking
  - phone: * (all columns)
  - phone_market: * (all columns)

Question: Show the most frequently used carrier of the phones.
Answer: SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1
##Instruction:
Database: phone_market
Total Tables: 3
Total Columns: 13

Table Schemas:

phone_market contains tables such as phone, market, phone_market.
Table phone has columns such as Name, Phone_ID, Memory_in_G, Carrier, Price.
Phone_ID is the primary key.
Table market has columns such as Market_ID, District, Num_of_employees, Num_of_shops, Ranking.
Market_ID is the primary key.
Table phone_market has columns such as Market_ID, Phone_ID, Num_of_stock.
Market_ID is the primary key.
The Phone_ID of phone_market is the foreign key of Phone_ID of phone.
The Market_ID of phone_market is the foreign key of Market_ID of market.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - market: Num_of_shops, Ranking
  - phone: * (all columns)
  - phone_market: * (all columns)

Question: Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64.
Answer: SELECT Carrier FROM phone WHERE Memory_in_G  <  32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G  >  64
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Carrier FROM phone WHERE Memory_in_G  <  32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G  >  64