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

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: ProductCatalogManager
Accessible Columns: phone: Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode; chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, Type

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 pixels of the screen modes that are used by both phones with full accreditation types and phones with Provisional accreditation types.
Answer: SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode  =  t2.screen_mode WHERE t2.Accreditation_type  =  'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode  =  t2.screen_mode WHERE t2.Accreditation_type  =  'Full'
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode  =  t2.screen_mode WHERE t2.Accreditation_type  =  'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode  =  t2.screen_mode WHERE t2.Accreditation_type  =  'Full'
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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: the names of models that launched between 2002 and 2004.
Answer: SELECT Model_name FROM chip_model WHERE Launch_year BETWEEN 2002 AND 2004;
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Model_name FROM chip_model WHERE Launch_year BETWEEN 2002 AND 2004;
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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: Which model has the least amount of RAM? List the model name and the amount of RAM.
Answer: SELECT Model_name ,  RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC LIMIT 1;
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Model_name ,  RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC LIMIT 1;
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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 chip model and screen mode of the phone with hardware model name "LG-P760"?
Answer: SELECT chip_model ,  screen_mode FROM phone WHERE Hardware_Model_name = "LG-P760";
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT chip_model ,  screen_mode FROM phone WHERE Hardware_Model_name = "LG-P760";
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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 phone hardware models are produced by the company named "Nokia Corporation"?
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: phone: Company_name)
Gold SQL: SELECT count(*) FROM phone WHERE Company_name = "Nokia Corporation";
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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 maximum and minimum RAM size of phone produced by company named "Nokia Corporation"?
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: phone: Company_name)
Gold SQL: SELECT max(T1.RAM_MiB) ,  min(T1.RAM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T2.Company_name = "Nokia Corporation";
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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 ROM size of phones produced by the company named "Nokia Corporation"?
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: phone: Company_name)
Gold SQL: SELECT avg(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T2.Company_name = "Nokia Corporation";
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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: List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32.
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: phone: Company_name)
Gold SQL: SELECT T2.Hardware_Model_name ,  T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB  >  32;
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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 all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name.
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: phone: Accreditation_type, Company_name)
Gold SQL: SELECT Hardware_Model_name ,  Company_name FROM phone WHERE Accreditation_type LIKE 'Full';
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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 Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is "LG-P760".
Answer: SELECT T1.Char_cells ,  T1.Pixels ,  T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = "LG-P760";
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Char_cells ,  T1.Pixels ,  T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = "LG-P760";
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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: List the hardware model name and company name for the phone whose screen mode type is "Graphics."
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: phone: Company_name)
Gold SQL: SELECT T2.Hardware_Model_name ,  T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type  =  "Graphics";
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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 the company that has the least number of phone models. List the company name and the number of phone model produced by that company.
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: phone: Company_name)
Gold SQL: SELECT Company_name ,  count(*) FROM phone GROUP BY Company_name ORDER BY count(*) ASC LIMIT 1;
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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: List the name of the company that produced more than one phone model.
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: phone: Company_name)
Gold SQL: SELECT Company_name FROM phone GROUP BY Company_name HAVING count(*)  >  1;
##Instruction:
Database: phone_1
Total Tables: 3
Total Columns: 21

Table Schemas:

phone_1 contains tables such as chip_model, screen_mode, phone.
Table chip_model has columns such as Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth.
Model_name is the primary key.
Table screen_mode has columns such as Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type.
Graphics_mode is the primary key.
Table phone has columns such as Company_name, Hardware_Model_name, Accreditation_type, Accreditation_level, Date, chip_model, screen_mode.
Hardware_Model_name is the primary key.
The chip_model of phone is the foreign key of Model_name of chip_model.
The screen_mode of phone is the foreign key of Graphics_mode of screen_mode.

##Role Access Policy (Column-Level):
Role: TechnicalSpecAnalyst
Accessible Columns: chip_model: Model_name, Launch_year, RAM_MiB, ROM_MiB, Slots, WiFi, Bluetooth; screen_mode: Graphics_mode, Char_cells, Pixels, Hardware_colours, used_kb, map, Type; phone: Hardware_Model_name, chip_model, screen_mode

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: List the maximum, minimum and average number of used kb in screen mode.
Answer: SELECT max(used_kb) , min(used_kb) , avg(used_kb) FROM screen_mode;
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT max(used_kb) , min(used_kb) , avg(used_kb) FROM screen_mode;