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

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: StudentCounselor
Accessible Columns: Highschooler: ID, name, grade; Friend: student_id, friend_id; Likes: student_id, liked_id

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What is the average grade of students who have friends?
Answer: SELECT avg(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id)
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: StudentCounselor
Accessible Columns: Highschooler: ID, name, grade; Friend: student_id, friend_id; Likes: student_id, liked_id

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Find the minimum grade of students who have no friends.
Answer: SELECT min(grade) FROM Highschooler WHERE id NOT IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT min(grade) FROM Highschooler WHERE id NOT IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id)
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: StudentCounselor
Accessible Columns: Highschooler: ID, name, grade; Friend: student_id, friend_id; Likes: student_id, liked_id

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What is the lowest grade of students who do not have any friends?
Answer: SELECT min(grade) FROM Highschooler WHERE id NOT IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT min(grade) FROM Highschooler WHERE id NOT IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id)
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: How many high schoolers are there?
Answer: SELECT count(*) FROM Highschooler
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM Highschooler
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Count the number of high schoolers.
Answer: SELECT count(*) FROM Highschooler
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM Highschooler
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Show the names and grades of each high schooler.
Answer: SELECT name ,  grade FROM Highschooler
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name ,  grade FROM Highschooler
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What are the names and grades for each high schooler?
Answer: SELECT name ,  grade FROM Highschooler
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name ,  grade FROM Highschooler
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Show all the grades of the high schoolers.
Answer: SELECT grade FROM Highschooler
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT grade FROM Highschooler
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What is the grade of each high schooler?
Answer: SELECT grade FROM Highschooler
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT grade FROM Highschooler
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What grade is Kyle in?
Answer: SELECT grade FROM Highschooler WHERE name  =  "Kyle"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT grade FROM Highschooler WHERE name  =  "Kyle"
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Return the grade for the high schooler named Kyle.
Answer: SELECT grade FROM Highschooler WHERE name  =  "Kyle"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT grade FROM Highschooler WHERE name  =  "Kyle"
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Show the names of all high schoolers in grade 10.
Answer: SELECT name FROM Highschooler WHERE grade  =  10
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM Highschooler WHERE grade  =  10
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What are the names of all high schoolers in grade 10?
Answer: SELECT name FROM Highschooler WHERE grade  =  10
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT name FROM Highschooler WHERE grade  =  10
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Show the ID of the high schooler named Kyle.
Answer: SELECT ID FROM Highschooler WHERE name  =  "Kyle"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT ID FROM Highschooler WHERE name  =  "Kyle"
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: What is Kyle's id?
Answer: SELECT ID FROM Highschooler WHERE name  =  "Kyle"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT ID FROM Highschooler WHERE name  =  "Kyle"
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: How many high schoolers are there in grade 9 or 10?
Answer: SELECT count(*) FROM Highschooler WHERE grade  =  9 OR grade  =  10
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM Highschooler WHERE grade  =  9 OR grade  =  10
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Count the number of high schoolers in grades 9 or 10.
Answer: SELECT count(*) FROM Highschooler WHERE grade  =  9 OR grade  =  10
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM Highschooler WHERE grade  =  9 OR grade  =  10
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: Show the number of high schoolers for each grade.
Answer: SELECT grade ,  count(*) FROM Highschooler GROUP BY grade
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT grade ,  count(*) FROM Highschooler GROUP BY grade
##Instruction:
Database: network_1
Total Tables: 3
Total Columns: 7

Table Schemas:

network_1 contains tables such as Highschooler, Friend, Likes.
Table Highschooler has columns such as ID, name, grade.
ID is the primary key.
Table Friend has columns such as student_id, friend_id.
student_id is the primary key.
Table Likes has columns such as student_id, liked_id.
student_id is the primary key.
The friend_id of Friend is the foreign key of ID of Highschooler.
The student_id of Friend is the foreign key of ID of Highschooler.
The student_id of Likes is the foreign key of ID of Highschooler.
The liked_id of Likes is the foreign key of ID of Highschooler.

##Role Access Policy (Column-Level):
Role: AcademicAdvisor
Accessible Columns: Highschooler: ID, name, grade; Friend: ; Likes: 

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: How many high schoolers are in each grade?
Answer: SELECT grade ,  count(*) FROM Highschooler GROUP BY grade
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT grade ,  count(*) FROM Highschooler GROUP BY grade