Compute the number of male employees and average salary

Assignment Help Database Management System
Reference no: EM133302132

Problem 1:
Add the following two records to the Employee table and the new department record to the Department table. Cut and paste the code and display the modified tables.

Employee Table Attribute

Person 1

Person 2

Person 3

Fname

John

Bruce

Mick

Minit

C

J

J

Lname

Fogerty

Springsteen

Jagger

SSN

444-55-8888

101-23-5175

585-66-3733

Bdate

1981-06-17

1948-09-08

1946-08-19

Home Address (#+Street), City, State)

101Plano, Dallas, TX

369 Plano, Houston, CA

4499 Humble, Plano, TX

Sex

M

M

M

Salary

100,000

150,000

250,000

Super_ssn

585-66-3733

585-66-3733

888-66-5555

Dno

9

9

9

Department Table Attribute

New Department

Dname

RocknRoll

Dnumber

9

Mgr_ssn

585-66-3733

Mgr_start_date

2022-09-14

Problem 2
Using the data from Problem 1, list all employees who live (home address)on PlanoStreet. The Address format is House # Street, City, State. Display Fname, Lname, Address, SSN. Order by SSN in descending order.

Problem 3
Using the data from problem 1, list all male employees who do not live in Plano, TX. Display Fname, Lname, Address, SSN. Order by SSN in descending order

Problem 4
The record added in Problem 1 forJaggerwas entered with an error. The salary should have been 137,425. The rest of the information was correct. Correct the record and display just that record. You do not have to rerun problem 2 or 3,but you do need to show the SQL code used to make the correction.

Problem 5
Delete the 4 records that were created.

Show the SQL statement that confirms that the record was deleted. Display the Employee and Department tables after the record has been deleted. I need to see some representation from the DBMS that shows the record was deleted.
• Show the code used to delete the record for each table
• Show eachtable after the records were deleted.

Problem 6
Each employee gets an insurance policy with the following death benefits:
If spouse dies, employee gets 50% of his salary (Employee Death Benefit)
If employee dies, son gets 30% of his salary (Son Death Benefit)

The attributes to display and the required column headings are shown below. Your column headings should be exactly as shown in the Display As column. Order output by employee by salary in descending order. Only show the employees with dependents.
Note: The employee death benefit is the amount the employee gets when his spouse dies, and the spouse death benefit is the amount the spouse gets if the employee dies.

Attribute

Display As

SSN

Employee SSN

EmployeeLname

EE Last Name

Dependent Name

Dep First Name

Employee Salary

EE Salary (include commas and two decimal places, i.e., 35000 should be 35,000.00)

Employee Death Benefit (calculated)

EE Death Benefit (include commas and two decimal places, i.e., 35000 should be 35,000.00)

Son Death Benefit (calculated)

Son Death Benefit (include commas and two decimal places, i.e., 35000 should be 35,000.00)

Relationship

Rel

Problem 7 Compute the pension benefit for each employee based on his salary in the Employee table and these conditions:

Pension Level

Salary

Pension

PL1

=<30,000

30% of salary

PL2

>30,000 and =<43,000

30% of salary up to 30,000 plus

40% of salary portion above 30,000

PL3

>43,000

30% of salary up to 30,000 plus

40% of salary portion greater than 30,000 and less than or equal to 43,000

plus

75% of salary portion above 43,000

So, for someone making 16,000, their pension would be .30*16,000 = 4,800

For someone making 32,000, their benefit would be

.30 * 30,000 + .4* (32,000 - 30,000) = 9,000 + 800 = 9,800

For someone making 60,000 their benefit would be:

.3 * 30,000+.40*(43,000-30,000) +.75 *(60,000-43,000) = 9,000+5,200+12,750=26,950

Display these columns: SSN, Lname, Salary, Pension Level 1 amount (display as PL1), Pension Level 2 amount (display as PL2), Pension Level 3amount (display as PL3), and Total Pension. Order by salary followed by Lname.

Problem 8 Compute the number of male employees and average salary paid for each department. Display these columns exactly as shown: Dno, Dname, Number of EEs, and Average Salary. Order by DNO, ascending.

Problem 9 For each record in the Works_on table that shows hours greater than 15, display ESSN, PNO, Pname, Hours, Dnumber, Dname, Lname. Order by Lname then Hours.

Problem 10 Displayall records from the following tables. Use the format Select * from table name.

Employee
Department
Works_On
Project
Dependent

Reference no: EM133302132

Questions Cloud

What are the many ways the children are involved in story : what are the many ways the children are involved in the story?What instruments and movements could be added for the children to take a more active role in story
Can you write a persuasive speech in running as president : Can you write a Persuasive Speech in running as president.
Design your program with relevant experiences for children : Design your program for one week, with relevant experiences for your focus children. Include all experiences, routines, and transitions.
How will your activity promote creativity in your classroom : How will your activity promote creativity in your classroom? How do you develop and manifest creativity in your own daily activities?
Compute the number of male employees and average salary : Compute the number of male employees and average salary paid for each department. Display these columns exactly as shown: Dno, Dname, Number of EEs, and Average
Why you find each idea interesting to teaching kids : Why you find each idea/quote interesting and relevant to teaching kids. What is the greatest gift you can give to your students?
What coarticulation effects occurs when speaking stand : What coarticulation effects occurs when speaking 'Stand"
What is the main idea of reading monster by chelsea vowel : What is the main idea of reading "Monster" by Chelsea Vowel
Explain why this relation is not in BCNF : Explain why this relation is not in BCNF and Decompose this relation into BCNF - Note that C is the key. This relation has this set of functional dependencies

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd