sharkiefff/RBAC-Text2SQL-Benchmark huggingface dataset:
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Show all the locations where some cinemas were opened in both year 2010 and year 2011.
Answer: SELECT LOCATION FROM cinema WHERE openning_year  =  2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year  =  2011
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT LOCATION FROM cinema WHERE openning_year  =  2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year  =  2011
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: How many cinema do we have?
Answer: SELECT count(*) FROM cinema
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM cinema
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

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

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Show name, opening year, and capacity for each cinema.
Answer: SELECT name ,  openning_year ,  capacity FROM cinema
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name ,  openning_year ,  capacity FROM cinema
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Show the cinema name and location for cinemas with capacity above average.
Answer: SELECT name ,  LOCATION FROM cinema WHERE capacity  >  (SELECT avg(capacity) FROM cinema)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name ,  LOCATION FROM cinema WHERE capacity  >  (SELECT avg(capacity) FROM cinema)
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: What are all the locations with a cinema?
Answer: SELECT DISTINCT LOCATION FROM cinema
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT DISTINCT LOCATION FROM cinema
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Find the distinct locations that has a cinema.
Answer: SELECT DISTINCT LOCATION FROM cinema
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT DISTINCT LOCATION FROM cinema
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Show all the cinema names and opening years in descending order of opening year.
Answer: SELECT name ,  openning_year FROM cinema ORDER BY openning_year DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name ,  openning_year FROM cinema ORDER BY openning_year DESC
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: What are the name and location of the cinema with the largest capacity?
Answer: SELECT name ,  LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name ,  LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later.
Answer: SELECT avg(capacity) ,  min(capacity) ,  max(capacity) FROM cinema WHERE openning_year  >=  2011
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(capacity) ,  min(capacity) ,  max(capacity) FROM cinema WHERE openning_year  >=  2011
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Show each location and the number of cinemas there.
Answer: SELECT LOCATION ,  count(*) FROM cinema GROUP BY LOCATION
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT LOCATION ,  count(*) FROM cinema GROUP BY LOCATION
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: What is the location with the most cinemas opened in year 2010 or later?
Answer: SELECT LOCATION FROM cinema WHERE openning_year  >=  2010 GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT LOCATION FROM cinema WHERE openning_year  >=  2010 GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Show all the locations with at least two cinemas with capacity above 300.
Answer: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Which locations have 2 or more cinemas with capacity over 300?
Answer: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Show the title and director for all films.
Answer: SELECT title ,  directed_by FROM film
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT title ,  directed_by FROM film
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: What are the title and director of each film?
Answer: SELECT title ,  directed_by FROM film
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT title ,  directed_by FROM film
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Show all directors.
Answer: SELECT DISTINCT directed_by FROM film
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT DISTINCT directed_by FROM film
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: Who are all the directors?
Answer: SELECT DISTINCT directed_by FROM film
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT DISTINCT directed_by FROM film
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: List all directors along with the number of films directed by each director.
Answer: SELECT directed_by ,  count(*) FROM film GROUP BY directed_by
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT directed_by ,  count(*) FROM film GROUP BY directed_by
##Instruction:
Database: cinema
Total Tables: 3
Total Columns: 17

Table Schemas:

cinema contains tables such as film, cinema, schedule.
Table film has columns such as Film_ID, Rank_in_series, Number_in_season, Title, Directed_by, Original_air_date, Production_code.
Film_ID is the primary key.
Table cinema has columns such as Cinema_ID, Name, Openning_year, Capacity, Location.
Cinema_ID is the primary key.
Table schedule has columns such as Cinema_ID, Film_ID, Date, Show_times_per_day, Price.
Cinema_ID is the primary key.
The Cinema_ID of schedule is the foreign key of Cinema_ID of cinema.
The Film_ID of schedule is the foreign key of Film_ID of film.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - cinema: * (all columns)
  - film: Directed_by, Film_ID, Number_in_season, Original_air_date, Production_code, Title
  - schedule: * (all columns)

Question: What is total number of show times per dat for each cinema?
Answer: SELECT T2.name ,  sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id  =  T2.cinema_id GROUP BY T1.cinema_id
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.name ,  sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id  =  T2.cinema_id GROUP BY T1.cinema_id