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

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What are the names of all singers that are from the UK and released a song in English?
Answer: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english"
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What are the average rating and resolution of songs that are in Bangla?
Answer: SELECT avg(rating) ,  avg(resolution) FROM song WHERE languages  =  "bangla"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(rating) ,  avg(resolution) FROM song WHERE languages  =  "bangla"
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What is the average rating and resolution of all bangla songs?
Answer: SELECT avg(rating) ,  avg(resolution) FROM song WHERE languages  =  "bangla"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(rating) ,  avg(resolution) FROM song WHERE languages  =  "bangla"
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What are the maximum and minimum resolution of songs whose duration is 3 minutes?
Answer: SELECT max(T2.resolution) ,  min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "3:%"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT max(T2.resolution) ,  min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "3:%"
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What is the maximum and minimum resolution of all songs that are approximately 3 minutes long?
Answer: SELECT max(T2.resolution) ,  min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "3:%"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT max(T2.resolution) ,  min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "3:%"
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What are the maximum duration and resolution of songs grouped and ordered by languages?
Answer: SELECT max(T1.duration) ,  max(T2.resolution) ,  T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.languages ORDER BY T2.languages
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT max(T1.duration) ,  max(T2.resolution) ,  T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.languages ORDER BY T2.languages
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What are the maximum duration and resolution of all songs, for each language, ordered alphabetically by language?
Answer: SELECT max(T1.duration) ,  max(T2.resolution) ,  T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.languages ORDER BY T2.languages
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT max(T1.duration) ,  max(T2.resolution) ,  T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.languages ORDER BY T2.languages
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What are the shortest duration and lowest rating of songs grouped by genre and ordered by genre?
Answer: SELECT min(T1.duration) ,  min(T2.rating) ,  T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT min(T1.duration) ,  min(T2.rating) ,  T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What is the shortest and most poorly rated song for each genre, ordered alphabetically by genre?
Answer: SELECT min(T1.duration) ,  min(T2.rating) ,  T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT min(T1.duration) ,  min(T2.rating) ,  T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: Find the names and number of works of all artists who have at least one English songs.
Answer: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english" GROUP BY T2.artist_name HAVING count(*)  >=  1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english" GROUP BY T2.artist_name HAVING count(*)  >=  1
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What are the names and number of works for all artists who have sung at least one song in English?
Answer: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english" GROUP BY T2.artist_name HAVING count(*)  >=  1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "english" GROUP BY T2.artist_name HAVING count(*)  >=  1
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: Find the name and country of origin for all artists who have release at least one song of resolution above 900.
Answer: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.resolution  >  900 GROUP BY T2.artist_name HAVING count(*)  >=  1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.resolution  >  900 GROUP BY T2.artist_name HAVING count(*)  >=  1
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What is the name and country of origin for each artist who has released a song with a resolution higher than 900?
Answer: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.resolution  >  900 GROUP BY T2.artist_name HAVING count(*)  >=  1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.resolution  >  900 GROUP BY T2.artist_name HAVING count(*)  >=  1
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: Find the names and number of works of the three artists who have produced the most songs.
Answer: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3
##Instruction:
Database: music_1
Total Tables: 4
Total Columns: 21

Table Schemas:

music_1 contains tables such as genre, artist, files, song.
Table genre has columns such as g_name, rating, most_popular_in.
g_name is the primary key.
Table artist has columns such as artist_name, country, gender, preferred_genre.
artist_name is the primary key.
Table files has columns such as f_id, artist_name, file_size, duration, formats.
f_id is the primary key.
Table song has columns such as song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution.
song_name is the primary key.
The preferred_genre of artist is the foreign key of g_name of genre.
The artist_name of files is the foreign key of artist_name of artist.
The genre_is of song is the foreign key of g_name of genre.
The f_id of song is the foreign key of f_id of files.
The artist_name of song is the foreign key of artist_name of artist.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - artist: artist_name, country, gender
  - files: * (all columns)
  - genre: g_name, rating
  - song: * (all columns)

Question: What are the names of the three artists who have produced the most songs, and how many works did they produce?
Answer: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3