db_name
stringclasses 146
values | prompt
stringlengths 310
4.81k
|
|---|---|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the id for the employee called Ebba?
#
### SQL:
#
# SELECT employee_ID FROM Employees WHERE employee_name = "Ebba"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the id of the employee named Ebba.
#
### SQL:
#
# SELECT employee_ID FROM Employees WHERE employee_name = "Ebba"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the names of all the employees with role "HR".
#
### SQL:
#
# SELECT employee_name FROM Employees WHERE role_code = "HR"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Which employees have the role with code "HR"? Find their names.
#
### SQL:
#
# SELECT employee_name FROM Employees WHERE role_code = "HR"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show all role codes and the number of employees in each role.
#
### SQL:
#
# SELECT role_code , count(*) FROM Employees GROUP BY role_code
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the code of each role and the number of employees in each role?
#
### SQL:
#
# SELECT role_code , count(*) FROM Employees GROUP BY role_code
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the role code with the largest number of employees?
#
### SQL:
#
# SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) DESC LIMIT 1
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Find the code of the role that have the most employees.
#
### SQL:
#
# SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) DESC LIMIT 1
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show all role codes with at least 3 employees.
#
### SQL:
#
# SELECT role_code FROM Employees GROUP BY role_code HAVING count(*) >= 3
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the roles with three or more employees? Give me the role codes.
#
### SQL:
#
# SELECT role_code FROM Employees GROUP BY role_code HAVING count(*) >= 3
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the role code with the least employees.
#
### SQL:
#
# SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) ASC LIMIT 1
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the role with the smallest number of employees? Find the role codes.
#
### SQL:
#
# SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) ASC LIMIT 1
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the role name and role description for employee called Ebba?
#
### SQL:
#
# SELECT T2.role_name , T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = "Ebba"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the name and description of the role played by the employee named Ebba.
#
### SQL:
#
# SELECT T2.role_name , T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = "Ebba"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the names of employees with role name Editor.
#
### SQL:
#
# SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Editor"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Find the names of all the employees whose the role name is "Editor".
#
### SQL:
#
# SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Editor"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the employee ids for all employees with role name "Human Resource" or "Manager".
#
### SQL:
#
# SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Human Resource" OR T2.role_name = "Manager"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the employee ids of the employees whose role name is "Human Resource" or "Manager"?
#
### SQL:
#
# SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Human Resource" OR T2.role_name = "Manager"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the different location codes for documents?
#
### SQL:
#
# SELECT DISTINCT location_code FROM Document_locations
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Give me all the distinct location codes for documents.
#
### SQL:
#
# SELECT DISTINCT location_code FROM Document_locations
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the location name for document "Robin CV".
#
### SQL:
#
# SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = "Robin CV"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the location name of the document "Robin CV"?
#
### SQL:
#
# SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = "Robin CV"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the location code, the starting date and ending data in that location for all the documents.
#
### SQL:
#
# SELECT location_code , date_in_location_from , date_in_locaton_to FROM Document_locations
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are each document's location code, and starting date and ending data in that location?
#
### SQL:
#
# SELECT location_code , date_in_location_from , date_in_locaton_to FROM Document_locations
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is "the date in location from" and "the date in location to" for the document with name "Robin CV"?
#
### SQL:
#
# SELECT T1.date_in_location_from , T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = "Robin CV"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Find the starting date and ending data in location for the document named "Robin CV".
#
### SQL:
#
# SELECT T1.date_in_location_from , T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = "Robin CV"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the location codes and the number of documents in each location.
#
### SQL:
#
# SELECT location_code , count(*) FROM Document_locations GROUP BY location_code
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the code of each location and the number of documents in that location?
#
### SQL:
#
# SELECT location_code , count(*) FROM Document_locations GROUP BY location_code
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the location code with the most documents?
#
### SQL:
#
# SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY count(*) DESC LIMIT 1
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Find the code of the location with the largest number of documents.
#
### SQL:
#
# SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY count(*) DESC LIMIT 1
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the location codes with at least 3 documents.
#
### SQL:
#
# SELECT location_code FROM Document_locations GROUP BY location_code HAVING count(*) >= 3
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the codes of the locations with at least three documents?
#
### SQL:
#
# SELECT location_code FROM Document_locations GROUP BY location_code HAVING count(*) >= 3
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the location name and code with the least documents.
#
### SQL:
#
# SELECT T2.location_name , T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY count(*) ASC LIMIT 1
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the name and code of the location with the smallest number of documents?
#
### SQL:
#
# SELECT T2.location_name , T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY count(*) ASC LIMIT 1
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents?
#
### SQL:
#
# SELECT T2.employee_name , T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id;
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# List the names of the employees who authorized the destruction of documents and the employees who destroyed the corresponding documents.
#
### SQL:
#
# SELECT T2.employee_name , T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id;
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the id of each employee and the number of document destruction authorised by that employee.
#
### SQL:
#
# SELECT Destruction_Authorised_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the id of each employee and the number of document destruction authorised by that employee?
#
### SQL:
#
# SELECT Destruction_Authorised_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the employee ids and the number of documents destroyed by each employee.
#
### SQL:
#
# SELECT Destroyed_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the id of each employee and the number of document destroyed by that employee?
#
### SQL:
#
# SELECT Destroyed_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the ids of the employees who don't authorize destruction for any document.
#
### SQL:
#
# SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Which employees do not authorize destruction for any document? Give me their employee ids.
#
### SQL:
#
# SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the ids of all employees who have authorized destruction.
#
### SQL:
#
# SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the ids of all the employees who authorize document destruction?
#
### SQL:
#
# SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the ids of all employees who have destroyed a document.
#
### SQL:
#
# SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the ids of all the employees who have destroyed documents?
#
### SQL:
#
# SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the ids of all employees who don't destroy any document.
#
### SQL:
#
# SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Which employees do not destroy any document? Find their employee ids.
#
### SQL:
#
# SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the ids of all employees who have either destroyed a document or made an authorization to do this.
#
### SQL:
#
# SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Which employees have either destroyed a document or made an authorization to do so? Return their employee ids.
#
### SQL:
#
# SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# How many clubs are there?
#
### SQL:
#
# SELECT count(*) FROM club
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Count the total number of clubs.
#
### SQL:
#
# SELECT count(*) FROM club
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# What are the names of all clubs?
#
### SQL:
#
# SELECT clubname FROM club
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Give me the name of each club.
#
### SQL:
#
# SELECT clubname FROM club
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# How many students are there?
#
### SQL:
#
# SELECT count(*) FROM student
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Count the total number of students.
#
### SQL:
#
# SELECT count(*) FROM student
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# What are the first names of all the students?
#
### SQL:
#
# SELECT DISTINCT fname FROM student
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find each student's first name.
#
### SQL:
#
# SELECT DISTINCT fname FROM student
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find the last names of the members of the club "Bootup Baltimore".
#
### SQL:
#
# SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Who are the members of the club named "Bootup Baltimore"? Give me their last names.
#
### SQL:
#
# SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Who are the members of the club named "Hopkins Student Enterprises"? Show the last name.
#
### SQL:
#
# SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Return the last name for the members of the club named "Hopkins Student Enterprises".
#
### SQL:
#
# SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# How many members does the club "Tennis Club" has?
#
### SQL:
#
# SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Tennis Club"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Count the members of the club "Tennis Club".
#
### SQL:
#
# SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Tennis Club"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find the number of members of club "Pen and Paper Gaming".
#
### SQL:
#
# SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Pen and Paper Gaming"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# How many people have membership in the club "Pen and Paper Gaming"?
#
### SQL:
#
# SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Pen and Paper Gaming"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# How many clubs does "Linda Smith" belong to?
#
### SQL:
#
# SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Linda" AND t3.lname = "Smith"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# How many clubs does "Linda Smith" have membership for?
#
### SQL:
#
# SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Linda" AND t3.lname = "Smith"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find the number of clubs where "Tracy Kim" is a member.
#
### SQL:
#
# SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Tracy" AND t3.lname = "Kim"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# For how many clubs is "Tracy Kim" a member?
#
### SQL:
#
# SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Tracy" AND t3.lname = "Kim"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find all the female members of club "Bootup Baltimore". Show the first name and last name.
#
### SQL:
#
# SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.sex = "F"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Give me the first name and last name for all the female members of the club "Bootup Baltimore".
#
### SQL:
#
# SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.sex = "F"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find all the male members of club "Hopkins Student Enterprises". Show the first name and last name.
#
### SQL:
#
# SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t3.sex = "M"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# What are the first name and last name of each male member in club "Hopkins Student Enterprises"?
#
### SQL:
#
# SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t3.sex = "M"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find all members of "Bootup Baltimore" whose major is "600". Show the first name and last name.
#
### SQL:
#
# SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.major = "600"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Which members of "Bootup Baltimore" major in "600"? Give me their first names and last names.
#
### SQL:
#
# SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.major = "600"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Which club has the most members majoring in "600"?
#
### SQL:
#
# SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = "600" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find the club which has the largest number of members majoring in "600".
#
### SQL:
#
# SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = "600" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find the name of the club that has the most female students.
#
### SQL:
#
# SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Which club has the most female students as their members? Give me the name of the club.
#
### SQL:
#
# SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# What is the description of the club named "Tennis Club"?
#
### SQL:
#
# SELECT clubdesc FROM club WHERE clubname = "Tennis Club"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find the description of the club called "Tennis Club".
#
### SQL:
#
# SELECT clubdesc FROM club WHERE clubname = "Tennis Club"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find the description of the club "Pen and Paper Gaming".
#
### SQL:
#
# SELECT clubdesc FROM club WHERE clubname = "Pen and Paper Gaming"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# What is the description of the club "Pen and Paper Gaming"?
#
### SQL:
#
# SELECT clubdesc FROM club WHERE clubname = "Pen and Paper Gaming"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# What is the location of the club named "Tennis Club"?
#
### SQL:
#
# SELECT clublocation FROM club WHERE clubname = "Tennis Club"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Where us the club named "Tennis Club" located?
#
### SQL:
#
# SELECT clublocation FROM club WHERE clubname = "Tennis Club"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find the location of the club "Pen and Paper Gaming".
#
### SQL:
#
# SELECT clublocation FROM club WHERE clubname = "Pen and Paper Gaming"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Where is the club "Pen and Paper Gaming" located?
#
### SQL:
#
# SELECT clublocation FROM club WHERE clubname = "Pen and Paper Gaming"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Where is the club "Hopkins Student Enterprises" located?
#
### SQL:
#
# SELECT clublocation FROM club WHERE clubname = "Hopkins Student Enterprises"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Tell me the location of the club "Hopkins Student Enterprises".
#
### SQL:
#
# SELECT clublocation FROM club WHERE clubname = "Hopkins Student Enterprises"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find the name of all the clubs at "AKW".
#
### SQL:
#
# SELECT clubname FROM club WHERE clublocation = "AKW"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Which clubs are located at "AKW"? Return the club names.
#
### SQL:
#
# SELECT clubname FROM club WHERE clublocation = "AKW"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# How many clubs are located at "HHH"?
#
### SQL:
#
# SELECT count(*) FROM club WHERE clublocation = "HHH"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Count the number of clubs located at "HHH".
#
### SQL:
#
# SELECT count(*) FROM club WHERE clublocation = "HHH"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# What are the first and last name of the president of the club "Bootup Baltimore"?
#
### SQL:
#
# SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t2.position = "President"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Who is the president of the club "Bootup Baltimore"? Give me the first and last name.
#
### SQL:
#
# SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t2.position = "President"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Who is the "CTO" of club "Hopkins Student Enterprises"? Show the first name and last name.
#
### SQL:
#
# SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t2.position = "CTO"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Find the first name and last name for the "CTO" of the club "Hopkins Student Enterprises"?
#
### SQL:
#
# SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t2.position = "CTO"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# How many different roles are there in the club "Bootup Baltimore"?
#
### SQL:
#
# SELECT count(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = "Bootup Baltimore"
#
### End.
|
club_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Club ( ClubID, ClubName, ClubDesc, ClubLocation )
# Member_of_club ( StuID, ClubID, Position )
#
# Member_of_club.ClubID can be joined with Club.ClubID
# Member_of_club.StuID can be joined with Student.StuID
#
### Question:
#
# Count the number of different positions in the club "Bootup Baltimore".
#
### SQL:
#
# SELECT count(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = "Bootup Baltimore"
#
### End.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.