sharkiefff/RBAC-Text2SQL-Benchmark huggingface dataset:
##Instruction:
Database: roller_coaster
Total Tables: 2
Total Columns: 14

Table Schemas:

roller_coaster contains tables such as roller_coaster, country.
Table roller_coaster has columns such as Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status.
Roller_Coaster_ID is the primary key.
Table country has columns such as Country_ID, Name, Population, Area, Languages.
Country_ID is the primary key.
The Country_ID of roller_coaster is the foreign key of Country_ID of country.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - country: * (all columns)
  - roller_coaster: * (all columns)

Question: Show the names of countries that have more than one roller coaster.
Answer: SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID GROUP BY T1.Name HAVING COUNT(*)  >  1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID GROUP BY T1.Name HAVING COUNT(*)  >  1
##Instruction:
Database: roller_coaster
Total Tables: 2
Total Columns: 14

Table Schemas:

roller_coaster contains tables such as roller_coaster, country.
Table roller_coaster has columns such as Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status.
Roller_Coaster_ID is the primary key.
Table country has columns such as Country_ID, Name, Population, Area, Languages.
Country_ID is the primary key.
The Country_ID of roller_coaster is the foreign key of Country_ID of country.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - country: * (all columns)
  - roller_coaster: * (all columns)

Question: Show the name and population of the country that has the highest roller coaster.
Answer: SELECT T1.Name ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID ORDER BY T2.Height DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Name ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID ORDER BY T2.Height DESC LIMIT 1
##Instruction:
Database: roller_coaster
Total Tables: 2
Total Columns: 14

Table Schemas:

roller_coaster contains tables such as roller_coaster, country.
Table roller_coaster has columns such as Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status.
Roller_Coaster_ID is the primary key.
Table country has columns such as Country_ID, Name, Population, Area, Languages.
Country_ID is the primary key.
The Country_ID of roller_coaster is the foreign key of Country_ID of country.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - country: * (all columns)
  - roller_coaster: * (all columns)

Question: Show the names of countries and the average speed of roller coasters from each country.
Answer: SELECT T1.Name ,  avg(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID GROUP BY T1.Name
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Name ,  avg(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID GROUP BY T1.Name
##Instruction:
Database: roller_coaster
Total Tables: 2
Total Columns: 14

Table Schemas:

roller_coaster contains tables such as roller_coaster, country.
Table roller_coaster has columns such as Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status.
Roller_Coaster_ID is the primary key.
Table country has columns such as Country_ID, Name, Population, Area, Languages.
Country_ID is the primary key.
The Country_ID of roller_coaster is the foreign key of Country_ID of country.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - country: * (all columns)
  - roller_coaster: * (all columns)

Question: How many countries do not have an roller coaster longer than 3000?
Answer: SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH  >  3000 )
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH  >  3000 )
##Instruction:
Database: roller_coaster
Total Tables: 2
Total Columns: 14

Table Schemas:

roller_coaster contains tables such as roller_coaster, country.
Table roller_coaster has columns such as Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status.
Roller_Coaster_ID is the primary key.
Table country has columns such as Country_ID, Name, Population, Area, Languages.
Country_ID is the primary key.
The Country_ID of roller_coaster is the foreign key of Country_ID of country.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - country: * (all columns)
  - roller_coaster: * (all columns)

Question: What are the country names, area and population which has both roller coasters with speed higher
Answer: SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  >  60 INTERSECT SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  <  55
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  >  60 INTERSECT SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  <  55
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: Find the names of channels that are not owned by CCTV.
Answer: SELECT name FROM channel WHERE OWNER != 'CCTV'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM channel WHERE OWNER != 'CCTV'
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: Which channels are not owned by CCTV? Give me the channel names.
Answer: SELECT name FROM channel WHERE OWNER != 'CCTV'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM channel WHERE OWNER != 'CCTV'
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: List all channel names ordered by their rating in percent from big to small.
Answer: SELECT name FROM channel ORDER BY rating_in_percent DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM channel ORDER BY rating_in_percent DESC
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: Give me a list of all the channel names sorted by the channel rating in descending order.
Answer: SELECT name FROM channel ORDER BY rating_in_percent DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM channel ORDER BY rating_in_percent DESC
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: What is the owner of the channel that has the highest rating ratio?
Answer: SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: Show me the owner of the channel with the highest rating.
Answer: SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: how many programs are there?
Answer: SELECT count(*) FROM program
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM program
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: Count the number of programs.
Answer: SELECT count(*) FROM program
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM program
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: list all the names of programs, ordering by launch time.
Answer: SELECT name FROM program ORDER BY launch
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM program ORDER BY launch
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: What is the list of program names, sorted by the order of launch date?
Answer: SELECT name FROM program ORDER BY launch
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM program ORDER BY launch
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: List the name, origin and owner of each program.
Answer: SELECT name ,  origin ,  OWNER FROM program
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name ,  origin ,  OWNER FROM program
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: What are the name, origin and owner of each program?
Answer: SELECT name ,  origin ,  OWNER FROM program
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name ,  origin ,  OWNER FROM program
##Instruction:
Database: program_share
Total Tables: 4
Total Columns: 17

Table Schemas:

program_share contains tables such as program, channel, broadcast, broadcast_share.
Table program has columns such as Program_ID, Name, Origin, Launch, Owner.
Program_ID is the primary key.
Table channel has columns such as Channel_ID, Name, Owner, Share_in_percent, Rating_in_percent.
Channel_ID is the primary key.
Table broadcast has columns such as Channel_ID, Program_ID, Time_of_day.
Channel_ID is the primary key.
Table broadcast_share has columns such as Channel_ID, Program_ID, Date, Share_in_percent.
Channel_ID is the primary key.
The Program_ID of broadcast is the foreign key of Program_ID of program.
The Channel_ID of broadcast is the foreign key of Channel_ID of channel.
The Program_ID of broadcast_share is the foreign key of Program_ID of program.
The Channel_ID of broadcast_share is the foreign key of Channel_ID of channel.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - broadcast: Program_ID, Time_of_day
  - broadcast_share: * (all columns)
  - channel: * (all columns)
  - program: * (all columns)

Question: find the name of the program that was launched most recently.
Answer: SELECT name FROM program ORDER BY launch DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM program ORDER BY launch DESC LIMIT 1