human
Schema:
Ref_Document_Types (Document_Type_Code, Document_Type_Name, Document_Type_Description)
Ref_Calendar (Calendar_Date, Day_Number)
Ref_Locations (Location_Code, Location_Name, Location_Description)
Roles (Role_Code, Role_Name, Role_Description)
All_Documents (Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details)
Employees (Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details)
Document_Locations (Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To)
Documents_to_be_Destroyed (Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the name and description for role code 'MG'?
assistant
SELECT role_name , role_description FROM ROLES WHERE role_code = 'MG'
human
What is the document type name for the document with name 'How to read a book'?
assistant
SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = 'How to read a book'
human
What are the name and description for location code x?
assistant
SELECT location_name , location_description FROM Ref_locations WHERE location_code = 'x'
human
List all document type codes and document type names.
assistant
SELECT document_type_code , document_type_name FROM Ref_document_types
human
What is the document type code for document type 'Paper'?
assistant
SELECT document_type_code FROM Ref_document_types WHERE document_type_name = 'Paper'
human
What is the name and description for document type code RV?
assistant
SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = "RV" ;