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

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: camera_lens_id, color, id, mountain_id

Question: What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?
Answer: SELECT T1.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id  =  T1.id WHERE T1.brand  =  'Sigma' OR T1.brand  =  'Olympus'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id  =  T1.id WHERE T1.brand  =  'Sigma' OR T1.brand  =  'Olympus'
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: camera_lens_id, color, id, mountain_id

Question: How many different kinds of lens brands are there?
Answer: SELECT count(DISTINCT brand) FROM camera_lens
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT brand) FROM camera_lens
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: camera_lens_id, color, id, mountain_id

Question: How many camera lenses are not used in taking any photos?
Answer: SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: camera_lens_id, color, id, mountain_id

Question: How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'?
Answer: SELECT count(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.country  =  'Ethiopia'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.country  =  'Ethiopia'
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: camera_lens_id, color, id, mountain_id

Question: List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif'
Answer: SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T1.range  =  'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T1.range  =  'Lasta Massif'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T1.range  =  'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T1.range  =  'Lasta Massif'
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: camera_lens_id, color, id, mountain_id

Question: Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.
Answer: SELECT name ,  prominence FROM mountain EXCEPT SELECT T1.name ,  T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T3.brand  =  'Sigma'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name ,  prominence FROM mountain EXCEPT SELECT T1.name ,  T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id  =  T3.id WHERE T3.brand  =  'Sigma'
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: camera_lens_id, color, id, mountain_id

Question: List the camera lens names containing substring "Digital".
Answer: SELECT name FROM camera_lens WHERE name LIKE "%Digital%"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM camera_lens WHERE name LIKE "%Digital%"
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: camera_lens_id, color, id, mountain_id

Question: What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos.
Answer: SELECT T1.name ,  count(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id  =  T2.camera_lens_id GROUP BY T1.id ORDER BY count(*)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.name ,  count(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id  =  T2.camera_lens_id GROUP BY T1.id ORDER BY count(*)
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: How many camera lenses have a focal length longer than 15 mm?
Answer: SELECT count(*) FROM camera_lens WHERE focal_length_mm  >  15
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM camera_lens WHERE focal_length_mm  >  15
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: Find the brand and name for each camera lens, and sort in descending order of maximum aperture.
Answer: SELECT brand ,  name FROM camera_lens ORDER BY max_aperture DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT brand ,  name FROM camera_lens ORDER BY max_aperture DESC
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: List the id, color scheme, and name for all the photos.
Answer: SELECT id ,  color ,  name FROM photos
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT id ,  color ,  name FROM photos
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: What are the maximum and average height of the mountains?
Answer: SELECT max(height) ,  avg(height) FROM mountain
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT max(height) ,  avg(height) FROM mountain
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: What are the average prominence of the mountains in country 'Morocco'?
Answer: SELECT avg(prominence) FROM mountain WHERE country  =  'Morocco'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(prominence) FROM mountain WHERE country  =  'Morocco'
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?
Answer: SELECT name ,  height ,  prominence FROM mountain WHERE range != 'Aberdare Range'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name ,  height ,  prominence FROM mountain WHERE range != 'Aberdare Range'
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: What are the id and name of the photos for mountains?
Answer: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.height  >  4000
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.height  >  4000
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: What are the id and name of the mountains that have at least 2 photos?
Answer: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id GROUP BY T1.id HAVING count(*)  >=  2
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id GROUP BY T1.id HAVING count(*)  >=  2
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: What are the names of the cameras that have taken picture of the most mountains?
Answer: Sorry, I cannot answer.
Permission: denied (All required columns are permitted)
Gold SQL: SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id  =  T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?
Answer: Sorry, I cannot answer.
Permission: denied (All required columns are permitted)
Gold SQL: SELECT T1.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id  =  T1.id WHERE T1.brand  =  'Sigma' OR T1.brand  =  'Olympus'
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: How many different kinds of lens brands are there?
Answer: SELECT count(DISTINCT brand) FROM camera_lens
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT brand) FROM camera_lens
##Instruction:
Database: mountain_photos
Total Tables: 3
Total Columns: 16

Table Schemas:

mountain_photos contains tables such as mountain, camera_lens, photos.
Table mountain has columns such as id, name, Height, Prominence, Range, Country.
id is the primary key.
Table camera_lens has columns such as id, brand, name, focal_length_mm, max_aperture.
id is the primary key.
Table photos has columns such as id, camera_lens_id, mountain_id, color, name.
id is the primary key.
The mountain_id of photos is the foreign key of id of mountain.
The camera_lens_id of photos is the foreign key of id of camera_lens.

##Role Access Policy (Column-Level):
Role: DataOperator_3
Accessible Columns:
  - camera_lens: * (all columns)
  - mountain: * (all columns)
  - photos: color, id, mountain_id, name

Question: How many camera lenses are not used in taking any photos?
Answer: Sorry, I cannot answer.
Permission: denied (All required columns are permitted)
Gold SQL: SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )