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) }
- Insert 10 rows in the new tables member and location
- Alter the member table to add DOB, commission and gross salary fields
- Write the queries to: (2 marks each)
- List all the full-time member
- List the names of the member who are managers (fname + lname)
- List the names of all member who joined in last year
- List all the manager based on decreasing order of their salary
- Calculate the commission as 5% for managers and 4% for others
- Calculate gross salary as the sum of salary and commission
- 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))
- Display all members whose ages are greater than 50
- Display the member based on ages (i.e. eldest on top)
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started