Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Just need to answer queries 3-5 which are in bold text Use the following tables : (xx is your login number) staffxx (staffNo, lname, fname,

Just need to answer queries 3-5 which are in bold text

  1. Use the following tables : (xx is your login number)

staffxx (staffNo, lname, fname, dept, desig, joiningDate, salary, rating, branchCode)

also DOB, commission and GossSalary

branchxx (branchCode, address, city, phone, yearOfOpening)

Please note the code for rating as

1 = Full time employee

2 = Contract employee

3 = Visiting employee

  1. Write the queries to:
    1. List all the Employees working in a branch in Kamloops
    2. List the average salary of managers in Kamloops
    3. List the difference in the salary than average salary of all the managers
    4. List all the details of all the employees with their branch details.
    5. List the non managers getting salary more than any of the manager
    6. List the non managers getting salary more than all the managers
    7. List the details of the manager of the oldest branch

  1. Add two columns Manager (same as staffID) and managerSince (date) in branch table
  2. Modify three tuples of the branch table to add manager code and managerSince date in branch table
  3. Now run the queries:
    1. List the details of all the managers who are listed in branch table
    2. List all the managers who are working as manager for more than 2 years
    3. List a manager who is working as a manager at the same branch ever since he has joined.

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

Does knowledge need to be shared quickly?

Answered: 1 week ago

Question

What does stickiest refer to in regard to social media

Answered: 1 week ago