Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following relational schema, where primary keys are underlined and foreign keys are marked with #: Employee (employeeID, empFName, empLName, empDateBirth, address, #DepartmentID) Department

Given the following relational schema, where primary keys are underlined and foreign keys are marked with #: Employee (employeeID, empFName, empLName, empDateBirth, address, #DepartmentID) Department (departmentID, departmentName, location) Project (projectID, projectName, place, startYear, endYear, #DepartmentID) Work-on (#employeeID, #projectID, nbHours) a) Express the following queries in SQL: i. Find the date of birth and the address of the employee whose first name is Ahmed and last name is Maashani.[1 mark] ii. List the first names and addresses of the employees who are working in the department named Research , ordered by first names in descending order. [1] iii. Change to 650 the number of hours that is required to finish the project having the id P10. [1 mark] iv. Add the following column to the table project: sponsor varchar2(50) [1] v. Find the number of projects that are going to finish in 2021.[1] vi. Find the number of projects assigned to each employee along with maximum number of hours spent. [1] vii. For each department, display its name along with the number of employees in which they are working. [1.5] b) Create a view named employees_MuscatProject that contains all the details of employees who worked on the projects, which took place in Muscat and finished in 2020. [2.5 marks]

-- Font family --Andale MonoArialArial BlackBook AntiquaComic Sans MSCourier NewGeorgiaHelveticaImpactSymbolTahomaTerminalTimes New RomanTrebuchet MSVerdanaWebdingsWingdings -- Font size --1 (8pt)2 (10pt)3 (12pt)4 (14pt)5 (18pt)6 (24pt)7 (36pt)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions

Question

=+1. Work in teams of four or five.

Answered: 1 week ago

Question

7. Determine what feedback is provided to employees.

Answered: 1 week ago