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: What are the names of conductors who have conducted orchestras founded after the year 2008?
Answer: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID  =  T2.Conductor_ID WHERE Year_of_Founded  >  2008
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID  =  T2.Conductor_ID WHERE Year_of_Founded  >  2008
##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: Please show the different record companies and the corresponding number of orchestras.
Answer: SELECT Record_Company ,  COUNT(*) FROM orchestra GROUP BY Record_Company
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Record_Company ,  COUNT(*) FROM orchestra GROUP BY Record_Company
##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 orchestras does each record company manage?
Answer: SELECT Record_Company ,  COUNT(*) FROM orchestra GROUP BY Record_Company
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Record_Company ,  COUNT(*) FROM orchestra GROUP BY Record_Company
##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: Please show the record formats of orchestras in ascending order of count.
Answer: SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) 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 major record formats of orchestras, sorted by their frequency?
Answer: SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) 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: List the record company shared by the most number of orchestras.
Answer: SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1
##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 record company used by the greatest number of orchestras?
Answer: SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1
##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 orchestras that have no performance.
Answer: SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)
##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 orchestras that do not have any performances?
Answer: SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)
##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: Show the record companies shared by orchestras founded before 2003 and after 2003.
Answer: SELECT Record_Company FROM orchestra WHERE Year_of_Founded  <  2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded  >  2003
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Record_Company FROM orchestra WHERE Year_of_Founded  <  2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded  >  2003
##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 that are used by both orchestras founded before 2003 and those founded after 2003?
Answer: SELECT Record_Company FROM orchestra WHERE Year_of_Founded  <  2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded  >  2003
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Record_Company FROM orchestra WHERE Year_of_Founded  <  2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded  >  2003
##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: Find the number of orchestras whose record format is "CD" or "DVD".
Answer: SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format  =  "CD" OR Major_Record_Format  =  "DVD"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format  =  "CD" OR Major_Record_Format  =  "DVD"