Database: cre_Doc_Tracking_DB

Question: How many calendar items do we have?
SQL: SELECT count(*) FROM Ref_calendar

Question: Show all calendar dates and day Numbers.
SQL: SELECT calendar_date ,  day_Number FROM Ref_calendar

Question: Show the number of document types.
SQL: SELECT count(*) FROM Ref_document_types

Question: List all document type codes and document type names.
SQL: SELECT document_type_code ,  document_type_name FROM Ref_document_types

Question: What is the name and description for document type code RV?
SQL: SELECT document_type_name ,  document_type_description FROM Ref_document_types WHERE document_type_code  =  "RV"

Question: What is the document type code for document type "Paper"?
SQL: SELECT document_type_code FROM Ref_document_types WHERE document_type_name  =  "Paper"

Question: Show the number of documents with document type code CV or BK.
SQL: SELECT count(*) FROM All_documents WHERE document_type_code  =  "CV" OR document_type_code  =  "BK"

Question: What is the date when the document "Marry CV" was stored?
SQL: SELECT date_stored FROM All_documents WHERE Document_name  =  "Marry CV"

Question: What is the day Number and date of all the documents?
SQL: SELECT T2.day_Number ,  T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored  =  T2.calendar_date

Question: What is the document type name for the document with name "How to read a book"?
SQL: 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"

Question: Show the number of locations.
SQL: SELECT count(*) FROM Ref_locations

Question: List all location codes and location names.
SQL: SELECT location_code ,  location_name FROM Ref_locations

Question: What are the name and description for location code x?
SQL: SELECT location_name ,  location_description FROM Ref_locations WHERE location_code  =  "x"

Question: What is the location code for the country "Canada"?
SQL: SELECT location_code FROM Ref_locations WHERE location_name  =  "Canada"

Question: How many roles are there?
SQL: SELECT count(*) FROM ROLES

Question: List all role codes, role names, and role descriptions.
SQL: SELECT role_code ,  role_name ,  role_description FROM ROLES

Question: What are the name and description for role code "MG"?
SQL: SELECT role_name ,  role_description FROM ROLES WHERE role_code  =  "MG"

Question: Show the description for role name "Proof Reader".
SQL: SELECT role_description FROM ROLES WHERE role_name  =  "Proof Reader"

Question: How many employees do we have?
SQL: SELECT count(*) FROM Employees

Question: Show the name, role code, and date of birth for the employee with name 'Armani'.
SQL: SELECT employee_name ,  role_code ,  date_of_birth FROM Employees WHERE employee_Name  =  'Armani'

Question: What is the id for the employee called Ebba?
SQL: SELECT employee_ID FROM Employees WHERE employee_name  =  "Ebba"

Question: Show the names of all the employees with role "HR".
SQL: SELECT employee_name FROM Employees WHERE role_code  =  "HR"