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

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: How many conductors are there?
Answer: SELECT count(*) FROM conductor
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM conductor
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Count the number of conductors.
Answer: SELECT count(*) FROM conductor
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM conductor
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: List the names of conductors in ascending order of age.
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: conductor: Age)
Gold SQL: SELECT Name FROM conductor ORDER BY Age ASC
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What are the names of conductors, ordered by age?
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: conductor: Age)
Gold SQL: SELECT Name FROM conductor ORDER BY Age ASC
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What are the names of conductors whose nationalities are not "USA"?
Answer: SELECT Name FROM conductor WHERE Nationality != 'USA'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Name FROM conductor WHERE Nationality != 'USA'
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Return the names of conductors that do not have the nationality "USA".
Answer: SELECT Name FROM conductor WHERE Nationality != 'USA'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Name FROM conductor WHERE Nationality != 'USA'
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What are the record companies of orchestras in descending order of years in which they were founded?
Answer: SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Return the record companies of orchestras, sorted descending by the years in which they were founded.
Answer: SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What is the average attendance of shows?
Answer: SELECT avg(Attendance) FROM SHOW
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(Attendance) FROM SHOW
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Return the average attendance across all shows.
Answer: SELECT avg(Attendance) FROM SHOW
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(Attendance) FROM SHOW
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What are the maximum and minimum share of performances whose type is not "Live final".
Answer: SELECT max(SHARE) ,  min(SHARE) FROM performance WHERE TYPE != "Live final"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT max(SHARE) ,  min(SHARE) FROM performance WHERE TYPE != "Live final"
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Return the maximum and minimum shares for performances that do not have the type "Live final".
Answer: SELECT max(SHARE) ,  min(SHARE) FROM performance WHERE TYPE != "Live final"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT max(SHARE) ,  min(SHARE) FROM performance WHERE TYPE != "Live final"
##Instruction:
Database: orchestra
Total Tables: 4
Total Columns: 23

Table Schemas:

orchestra contains tables such as conductor, orchestra, performance, show.
Table conductor has columns such as Conductor_ID, Name, Age, Nationality, Year_of_Work.
Conductor_ID is the primary key.
Table orchestra has columns such as Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format.
Orchestra_ID is the primary key.
Table performance has columns such as Performance_ID, Orchestra_ID, Type, Date, Official_ratings_(millions), Weekly_rank, Share.
Performance_ID is the primary key.
Table show has columns such as Show_ID, Performance_ID, If_first_show, Result, Attendance.
The Conductor_ID of orchestra is the foreign key of Conductor_ID of conductor.
The Orchestra_ID of performance is the foreign key of Orchestra_ID of orchestra.
The Performance_ID of show is the foreign key of Performance_ID of performance.

##Role Access Policy (Column-Level):
Role: OrchestraManager
Accessible Columns: conductor: Conductor_ID, Name, Nationality, Year_of_Work; orchestra: Orchestra_ID, Orchestra, Conductor_ID, Record_Company, Year_of_Founded, Major_Record_Format; performance: Performance_ID, Orchestra_ID, Type, Date, Weekly_rank, Share; show: Show_ID, Performance_ID, If_first_show, Result, Attendance

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: How many different nationalities do conductors have?
Answer: SELECT count(DISTINCT Nationality) FROM conductor
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT Nationality) FROM conductor