sharkiefff/RBAC-Text2SQL-Benchmark huggingface dataset:
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 the dorms that don't have any amenities?
Answer: SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity)
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 number of distinct gender for dorms.
Answer: SELECT count(DISTINCT gender) FROM dorm
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT gender) FROM dorm
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 different genders are there in the dorms?
Answer: SELECT count(DISTINCT gender) FROM dorm
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT gender) FROM dorm
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 capacity and gender type of the dorm whose name has substring ‘Donor’.
Answer: SELECT student_capacity ,  gender FROM dorm WHERE dorm_name LIKE '%Donor%'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT student_capacity ,  gender FROM dorm WHERE dorm_name LIKE '%Donor%'
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 student capacity and type of gender for the dorm whose name as the phrase Donor in it?
Answer: SELECT student_capacity ,  gender FROM dorm WHERE dorm_name LIKE '%Donor%'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT student_capacity ,  gender FROM dorm WHERE dorm_name LIKE '%Donor%'
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 name and gender type of the dorms whose capacity is greater than 300 or less than 100.
Answer: SELECT dorm_name ,  gender FROM dorm WHERE student_capacity  >  300 OR student_capacity  <  100
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT dorm_name ,  gender FROM dorm WHERE student_capacity  >  300 OR student_capacity  <  100
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 types of the dorms that have a capacity greater than 300 or less than 100?
Answer: SELECT dorm_name ,  gender FROM dorm WHERE student_capacity  >  300 OR student_capacity  <  100
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT dorm_name ,  gender FROM dorm WHERE student_capacity  >  300 OR student_capacity  <  100
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 numbers of different majors and cities.
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: student: city_code)
Gold SQL: SELECT count(DISTINCT major) ,  count(DISTINCT city_code) FROM student
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 different majors are there and how many different city codes are there for each student?
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: student: city_code)
Gold SQL: SELECT count(DISTINCT major) ,  count(DISTINCT city_code) FROM student
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 name of dorms which have both TV Lounge and Study Room as amenities.
Answer: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'Study Room'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'Study Room'
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 name of the dorm with both a TV Lounge and Study Room listed as amenities?
Answer: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'Study Room'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'Study Room'
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 name of dorms which have TV Lounge but no Study Room as amenity.
Answer: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'Study Room'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'Study Room'
##Instruction:
Database: dorm_1
Total Tables: 5
Total Columns: 19

Table Schemas:

dorm_1 contains tables such as Student, Dorm, Dorm_amenity, Has_amenity, Lives_in.
Table Student has columns such as StuID, LName, Fname, Age, Sex, Major, Advisor, city_code.
StuID is the primary key.
Table Dorm has columns such as dormid, dorm_name, student_capacity, gender.
Table Dorm_amenity has columns such as amenid, amenity_name.
Table Has_amenity has columns such as dormid, amenid.
Table Lives_in has columns such as stuid, dormid, room_number.
The amenid of Has_amenity is the foreign key of amenid of Dorm_amenity.
The dormid of Has_amenity is the foreign key of dormid of Dorm.
The dormid of Lives_in is the foreign key of dormid of Dorm.
The stuid of Lives_in is the foreign key of StuID of Student.

##Role Access Policy (Column-Level):
Role: ResidentAssistant
Accessible Columns: Student: StuID, LName, Fname, Age, Sex, Major; Dorm: dormid, dorm_name, student_capacity, gender; Dorm_amenity: amenid, amenity_name; Has_amenity: dormid, amenid; Lives_in: stuid, dormid, room_number

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 name of each dorm that has a TV Lounge but no study rooms?
Answer: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'Study Room'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'Study Room'