Assignment 2-B
Assignment 2-B
Instructions:
1. You will need access to a database system (e.g., MySQL, PostgreSQL, SQLite) to complete these
assignments.
Table 1: Employees
- Attributes: EmployeeID (Primary Key), FirstName, LastName, Department, Position, Salary
Table 2: Projects
- Attributes: ProjectID (Primary Key), ProjectName, StartDate, EndDate
Table 3: Assignments
- Attributes: AssignmentID (Primary Key), EmployeeID (Foreign Key references Employees), ProjectID
(Foreign Key references Projects), HoursWorked
Create the necessary tables (Employees, Projects, Assignments) with appropriate data types and
constraints in the "Company" database. Ensure that primary and foreign keys are defined correctly.
2.2. List the project names and their corresponding start dates.
2.4. Retrieve the project names and the total hours worked on each project.
3.1. Update the salary of the employee with EmployeeID = 101 to $60,000.
4.2. List all employees and their positions, but alias the "Position" column as "JobTitle."
4.3. Retrieve the project with the maximum total hours worked.
Submission:
- Create a script containing your SQL queries and commands for each question.
Grading:
Your lab assignment will be graded based on the correctness of SQL statements, adherence to
instructions, and the accuracy of the results produced by your queries. Additionally, the database
setup in Question 1 will be evaluated for correctness and adherence to good database design
principles
Deadline: Please submit your completed assignment by [20-10-2023] to your CR email and
then CR will zip and email me at address ([email protected]).