Question: a . Write the SQL code to create a view, EmployeeGrades, in which we can store the EmployeeID and Grade of each employee. Compute the

a. Write the SQL code to create a view, EmployeeGrades, in which we can store the EmployeeID and Grade of each employee. Compute the grade as described above.
[5 Marks]
b. For each of the queries below, answer in Relational Algebra as well as SQL form:
i. Show the EmploveeName, Salary and DepartmentName for all the managers.
ii. Show the EmployeeName and Grade for all employees working at"Location='NewYork'.
iii. Show for the EmploveeName='Smith' the maximum possible raise in Salary in the same Grade.
c. For each of the queries below, answer in SQL forntonly.
]=[10 Marks
i. Show the sum of Salary of employees in a department and the DepartmentName for each department. Assume DepartmentName is also unique field.
ii. Show the EmployeeName for all the employees in the salary Grade='G1'. You must use a nested query for this.
Note: The fields that must appear in the output are typed in Italic.
 a. Write the SQL code to create a view, EmployeeGrades, in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!