Professional Documents
Culture Documents
General Instructions:
● Read each statement carefully and write SQL statements for each item.
● Cheating and any form of academic dishonesty are NOT allowed, once caught doing such
will be automatically subjected to disciplinary actions and will receive a score of ZERO.
●JobTbl (5pts)
ATTRIBUTE NAME DATA DECLARATION
●EmployeeTbl (5pts)
ATTRIBUTE NAME DATA DECLARATION
EmpHiredDate Date
●ProjectTbl (5pts)
ATTRIBUTE NAME DATA DECLARATION
ProjectValue Decimal(11,2)
EmpNumber Foreign Key related to EmployeeTbl
ANSWER
●EmployeeTbl (5pts)
●ProjectTbl (5pts)
College of Informatics and Computing Sciences
7. Find all the records of the employees that were hired before January 01, 2015.
8. Find all the records of the employees that were hired from January 01, 2016 to December
31, 2017.
11. Retrieve the records of the employee whose last name starts with ‘B’.
12. Retrieve the records of the employee whose first name ends with ‘N’.
13. Retrieve the records of the employee whose first name starts with ‘A’ and ends with ‘Y’.
15. Using an aggregate function, retrieve all the records of the most expensive project.
16. Add another column named ‘Department’ in the JobTbl. Decide the appropriate data type and field size.
17. Create a view based on the question in number 5. Name your view as DBDesigner.
18. Retrieve all the records of the view you created in number 17.
19. Using an aggregate function, compute the total value of the projects of employee E012.
20. Retrieve all the records from EmployeeTbl. Arrange the employee's first names in
alphabetical order.
21. Save all the changes made in your database. (2pts)