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

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: TemplateDesigner
Accessible Columns: Ref_Template_Types: ALL COLUMNS; Templates: Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details; Documents: Document_ID, Template_ID, Document_Name, Document_Description; Paragraphs: 

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 id and name of the document with the most paragraphs.
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: paragraphs: document_id)
Gold SQL: SELECT T1.document_id ,  T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id GROUP BY T1.document_id ORDER BY count(*) DESC LIMIT 1
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: TemplateDesigner
Accessible Columns: Ref_Template_Types: ALL COLUMNS; Templates: Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details; Documents: Document_ID, Template_ID, Document_Name, Document_Description; Paragraphs: 

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 document id with least number of paragraphs?
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: paragraphs: Document_ID)
Gold SQL: SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: TemplateDesigner
Accessible Columns: Ref_Template_Types: ALL COLUMNS; Templates: Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details; Documents: Document_ID, Template_ID, Document_Name, Document_Description; Paragraphs: 

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 id of the document with the fewest paragraphs.
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: paragraphs: Document_ID)
Gold SQL: SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: TemplateDesigner
Accessible Columns: Ref_Template_Types: ALL COLUMNS; Templates: Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details; Documents: Document_ID, Template_ID, Document_Name, Document_Description; Paragraphs: 

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 document id with 1 to 2 paragraphs?
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: paragraphs: Document_ID)
Gold SQL: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) BETWEEN 1 AND 2
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: TemplateDesigner
Accessible Columns: Ref_Template_Types: ALL COLUMNS; Templates: Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details; Documents: Document_ID, Template_ID, Document_Name, Document_Description; Paragraphs: 

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: Give the ids of documents that have between one and two paragraphs.
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: paragraphs: Document_ID)
Gold SQL: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) BETWEEN 1 AND 2
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: TemplateDesigner
Accessible Columns: Ref_Template_Types: ALL COLUMNS; Templates: Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details; Documents: Document_ID, Template_ID, Document_Name, Document_Description; Paragraphs: 

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 document id with paragraph text 'Brazil' and 'Ireland'.
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: paragraphs: Document_ID, Paragraph_Text)
Gold SQL: SELECT document_id FROM Paragraphs WHERE paragraph_text  =  'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text  =  'Ireland'
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: TemplateDesigner
Accessible Columns: Ref_Template_Types: ALL COLUMNS; Templates: Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details; Documents: Document_ID, Template_ID, Document_Name, Document_Description; Paragraphs: 

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 ids of documents that contain the paragraph text 'Brazil' and 'Ireland'?
Answer: Sorry, I cannot answer.
Permission: denied (Missing column permissions: paragraphs: Document_ID, Paragraph_Text)
Gold SQL: SELECT document_id FROM Paragraphs WHERE paragraph_text  =  'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text  =  'Ireland'
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: DocumentEditor
Accessible Columns: Ref_Template_Types: Template_Type_Code, Template_Type_Description; Templates: Template_ID, Template_Type_Code, Date_Effective_From, Template_Details; Documents: ALL COLUMNS; Paragraphs: ALL COLUMNS

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 documents do we have?
Answer: SELECT count(*) FROM Documents
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM Documents
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: DocumentEditor
Accessible Columns: Ref_Template_Types: Template_Type_Code, Template_Type_Description; Templates: Template_ID, Template_Type_Code, Date_Effective_From, Template_Details; Documents: ALL COLUMNS; Paragraphs: ALL COLUMNS

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 documents.
Answer: SELECT count(*) FROM Documents
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM Documents
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: DocumentEditor
Accessible Columns: Ref_Template_Types: Template_Type_Code, Template_Type_Description; Templates: Template_ID, Template_Type_Code, Date_Effective_From, Template_Details; Documents: ALL COLUMNS; Paragraphs: ALL COLUMNS

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 document IDs, document names, and document descriptions for all documents.
Answer: SELECT document_id ,  document_name ,  document_description FROM Documents
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT document_id ,  document_name ,  document_description FROM Documents
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: DocumentEditor
Accessible Columns: Ref_Template_Types: Template_Type_Code, Template_Type_Description; Templates: Template_ID, Template_Type_Code, Date_Effective_From, Template_Details; Documents: ALL COLUMNS; Paragraphs: ALL COLUMNS

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 ids, names, and descriptions for all documents?
Answer: SELECT document_id ,  document_name ,  document_description FROM Documents
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT document_id ,  document_name ,  document_description FROM Documents
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: DocumentEditor
Accessible Columns: Ref_Template_Types: Template_Type_Code, Template_Type_Description; Templates: Template_ID, Template_Type_Code, Date_Effective_From, Template_Details; Documents: ALL COLUMNS; Paragraphs: ALL COLUMNS

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 document name and template id for document with description with the letter 'w' in it?
Answer: SELECT document_name ,  template_id FROM Documents WHERE Document_Description LIKE "%w%"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT document_name ,  template_id FROM Documents WHERE Document_Description LIKE "%w%"
##Instruction:
Database: cre_Doc_Template_Mgt
Total Tables: 4
Total Columns: 17

Table Schemas:

cre_Doc_Template_Mgt contains tables such as Ref_Template_Types, Templates, Documents, Paragraphs.
Table Ref_Template_Types has columns such as Template_Type_Code, Template_Type_Description.
Template_Type_Code is the primary key.
Table Templates has columns such as Template_ID, Version_Number, Template_Type_Code, Date_Effective_From, Date_Effective_To, Template_Details.
Template_ID is the primary key.
Table Documents has columns such as Document_ID, Template_ID, Document_Name, Document_Description, Other_Details.
Document_ID is the primary key.
Table Paragraphs has columns such as Paragraph_ID, Document_ID, Paragraph_Text, Other_Details.
Paragraph_ID is the primary key.
The Template_Type_Code of Templates is the foreign key of Template_Type_Code of Ref_Template_Types.
The Template_ID of Documents is the foreign key of Template_ID of Templates.
The Document_ID of Paragraphs is the foreign key of Document_ID of Documents.

##Role Access Policy (Column-Level):
Role: DocumentEditor
Accessible Columns: Ref_Template_Types: Template_Type_Code, Template_Type_Description; Templates: Template_ID, Template_Type_Code, Date_Effective_From, Template_Details; Documents: ALL COLUMNS; Paragraphs: ALL COLUMNS

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 names and template ids for documents that contain the letter w in their description.
Answer: SELECT document_name ,  template_id FROM Documents WHERE Document_Description LIKE "%w%"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT document_name ,  template_id FROM Documents WHERE Document_Description LIKE "%w%"