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 songs that are ordered by their resolution numbers?
Answer: SELECT song_name FROM song ORDER BY resolution
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT song_name FROM song ORDER BY resolution
##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 ids of songs that are available in either mp4 format or have resolution above 720?
Answer: SELECT f_id FROM files WHERE formats  =  "mp4" UNION SELECT f_id FROM song WHERE resolution  >  720
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT f_id FROM files WHERE formats  =  "mp4" UNION SELECT f_id FROM song WHERE resolution  >  720
##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 ids of all songs that are available on mp4 or have a higher resolution than 720?
Answer: SELECT f_id FROM files WHERE formats  =  "mp4" UNION SELECT f_id FROM song WHERE resolution  >  720
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT f_id FROM files WHERE formats  =  "mp4" UNION SELECT f_id FROM song WHERE resolution  >  720
##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: List the names of all songs that have 4 minute duration or are in English.
Answer: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages  =  "english"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE 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 names of all songs that are approximately 4 minutes long or are in English?
Answer: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages  =  "english"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE 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 is the language used most often in the songs?
Answer: SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 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 languages that are used most often in songs?
Answer: SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 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 language that was used most often in songs with resolution above 500?
Answer: SELECT artist_name FROM song WHERE resolution  >  500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT artist_name FROM song WHERE resolution  >  500 GROUP BY languages ORDER BY count(*) DESC LIMIT 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 of the artist, for each language, that has the most songs with a higher resolution than 500?
Answer: SELECT artist_name FROM song WHERE resolution  >  500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT artist_name FROM song WHERE resolution  >  500 GROUP BY languages ORDER BY count(*) DESC LIMIT 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 of artists who are Male and are from UK?
Answer: SELECT artist_name FROM artist WHERE country  =  "UK" AND gender  =  "Male"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT artist_name FROM artist WHERE country  =  "UK" AND gender  =  "Male"
##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 male British artists?
Answer: SELECT artist_name FROM artist WHERE country  =  "UK" AND gender  =  "Male"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT artist_name FROM artist WHERE country  =  "UK" AND gender  =  "Male"
##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 of songs whose genre is modern or language is English.
Answer: SELECT song_name FROM song WHERE genre_is  =  "modern" OR languages  =  "english"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT song_name FROM song WHERE genre_is  =  "modern" OR 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 names of the songs that are modern or sung in English?
Answer: SELECT song_name FROM song WHERE genre_is  =  "modern" OR languages  =  "english"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT song_name FROM song WHERE genre_is  =  "modern" OR 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: Return the names of songs for which format is mp3 and resolution is below 1000.
Answer: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" INTERSECT SELECT song_name FROM song WHERE resolution  <  1000
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" INTERSECT SELECT song_name FROM song WHERE resolution  <  1000
##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 songs that are in mp3 format and have a resolution lower than 1000?
Answer: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" INTERSECT SELECT song_name FROM song WHERE resolution  <  1000
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" INTERSECT SELECT song_name FROM song WHERE resolution  <  1000
##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: Return the names of singers who are from UK and released an English song.
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"