Question: 1. Create the following tables in SQL Developer : member (memberNo, lname, fname, dept, desig, joiningDate, salary, rating, locationCode) location (locationCode, address, city, phone, yearOfOpening)

1. Create the following tables in SQL Developer :

member (memberNo, lname, fname, dept, desig, joiningDate, salary, rating, locationCode)

location (locationCode, address, city, phone, yearOfOpening)

** please note that locationCode is foreign key and works as primary key in location table. So the data will go in location table first before locationcode goes in member table.

Please note the code for rating as

{1 = Full-time member 2 = Contract member 3 = Visiting member (point will be use - 1,2,3) }

  1. Insert 10 rows in the new tables member and location
  2. Alter the member table to add DOB, commission and gross salary fields
  3. Write the queries to: (2 marks each)
    1. List all the full-time member
    2. List the names of the member who are managers (fname + lname)
    3. List the names of all member who joined in last year
    4. List all the manager based on decreasing order of their salary
    5. Calculate the commission as 5% for managers and 4% for others
    6. Calculate gross salary as the sum of salary and commission
    7. Display the estimated retirement date of every member (based on the retirement age of 65, it should be the last day of that month)

Tip: (last_day(add_months(sysdate, 12))

  1. Display all members whose ages are greater than 50
  2. Display the member based on ages (i.e. eldest on top)
  3. List the location from the oldest to the newest location.

Please provide all required commands for creating the tables and inserting data commands. And most importantly - all queries commands for sqldeveloper -in serialize. Thanks in advance. Would much appreciate it if you can add screenshots.

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!