Find the names and addresses of employees

Assignment Help PL-SQL Programming
Reference no: EM131431803

Assignment

1. Specify the following queries on the database schema shown in Figure.1 below using the relational algebra operators. Also show the result of each query if applied to the database of Figure.2. (Use the symbol σ for SELECT, Π for PROJECT, ς for EQUIJOIN, * for NATURAL JOIN, and f for FUNCTION)

(a) Retrieve the names of employees in department 5 who work more than 10 hours per week on the 'ProductX' project.

(b) List the names of employees who have a dependent with the same first name as themselves.

(c) Find the names of employees that are directly supervised by 'Franklin Wong'.

(d) For each project, list the project name and the total hours per week (by all employees) spent on that project.

(e) Retrieve the names of employees who work on every project.

(f) Retrieve the names of employees who do not work on any project

(g) For each department, retrieve the department name, and the average salary of employees working in that department.

(h) Retrieve the average salary of all female employees.

(i) Find the names and addresses of employees who work on at least one project located in Houston but whose department has no location in Houston

(j) List the last names of department managers who have no dependents.

1843_Figure.jpg

Figure. 1

451_Figure1.jpg

Figure. 2

2. Suppose each of the following update operations is applied directly to the database of Figure.2. Discuss all integrity constraints violated by each operation, if any, and the different ways of enforcing these constraints.

(a) Insert < 'Robert', 'F', 'Scott', '943775543', '21-JUN-42', '2365 Newcastle Rd, Bellaire, TX', M, 58000, '888665555', 1 > into EMPLOYEE.

(b) Insert < 'ProductA', 4, 'Bellaire', 2 > into PROJECT.

(c) Insert < 'Production', 4, '943775543', '01-OCT-88' > into DEPARTMENT

(d) Insert < '677678989', null, '40.0' > into WORKS_ON.

(e) Insert < '453453453', 'John', M, '12-DEC-60', 'SPOUSE' > into DEPENDENT

(f) Delete the WORKS_ON tuples with ESSN= '333445555'.

(g) Delete the EMPLOYEE tuple with SSN= '987654321'

(h) Delete the PROJECT tuple with PNAME= 'ProductX'

(i) Modify the MGRSSN and MGRSTARTDATE of the DEPARTMENT tuple with DNUMBER= 5 to '123456789' and '01-OCT-88', respectively

(j) Modify the SUPERSSN attribute of the EMPLOYEE tuple with SSN= '999887777' to '943775543'.

(k) Modify the HOURS attribute of the WORKS_ON tuple with ESSN= '999887777' and PNO= 10 to '5.0'

3. Specify the following views in SQL on the COMPANY database schema:

(a) A view that has the department name, manager name, and manager salary for every department.

(b) A view that has the employee name, supervisor name, employee salary for each employee who works in the 'Research' department.

(c) A view that has project name, controlling department name, number of employees, and total hours worked per week on the project for each project.

(d) A view that has project name, controlling department name, number of employees, and total hours worked per week on the project for each project with more than one employee working on it.

*Note- Send the solution in MS Word along with snaposhot images where required

Verified Expert

This assignment involves writing queries on database and extracting the useful information from them. The queries are written using relational algebra. by using symbols like for SELECT, PROJECT, EQUIJOIN, NATURAL JOIN, and FUNCTION. Then for the set of DML queries the integrity constraints violated by each operation and different ways of enforcing them are discussed. Then view is created on the COMPANY database schema to gather information about each department, project and employees working on each project.

Reference no: EM131431803

Questions Cloud

Identify the crime and types of cyber crimes : Business Case Problem: Using special software, South Dakota law enforcement officers found a person who appeared to posses' child pornography at a specific Internet address. The officers subpoenaed midcontinent communications, the service that ass..
Imaginary economy using the product : Calculate the GDP of this imaginary economy using the product, income and expenditure methods. Explain how these methods deal with the problem of double counting in the calculation of GDP.
Calculate the chi square test : Based on the 2x2 contingency table posted below calculate the chi square test to see if the result rejects the null hypothesis. You can calculate this long hand or use a standard calculator such as found at this site
Unemployment rate and natural rate of unemployment : Question 1: What is the difference(s), if any, between the unemployment rate and the natural rate of unemployment? Discuss.
Find the names and addresses of employees : Retrieve the names of employees in department 5 who work more than 10 hours per week on the 'ProductX' project and List the names of employees who have a dependent with the same first name as themselves.
Write a brief statement of your findings : Do the Kruskal-Wallis test. Explain the distinction between the hypotheses tested by Kruskal-Wallis and ANOVA.- Write a brief statement of your findings. Include a numerical comparison of the groups as well as your test result.
Government cutting taxes by amount : Assume in economy is in recession with a MPC of 0.75 and there is a GDP gap of $100 billion. How much must government spending increase to eliminate the gap? Instead of increasing government spending by the amount that you calculated what would be..
Is the conflict inevitable between united states and china : Is the conflict inevitable between the United States and China? If a conflict occurs in the future, are there ways to discourage them? Or are these conflicts just part of global politics between great powers?
Find the median number of beetles trapped by boards : Find the median number of beetles trapped by boards of each color. Which colors appear more effective? Use the Kruskal-Wallis test to see if there are significant differences among the colors. What do you conclude?

Reviews

inf1431803

3/24/2017 5:29:33 AM

This is totally FANTASTIC!!!! I can't thank you enough to help me out with this paper. You are EXTREMELY skilled and I can't get over how elegantly composed this paper is. It's PERFECT!! You were HIGHLY suggested for my venture and now I see why they "Exceedingly" prescribed you! Once more, bless your heart!

Write a Review

PL-SQL Programming Questions & Answers

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Create sql statements for the scenarios

Create SQL statements for the scenarios. Your response should include SQL statement, output and any other assumptions you have made to arrive at the solution.

  Script that creates and calls a function

Write a script that creates and calls a function named fnItemTotal that calculates the total amount of an item in the OrderItems table (discount price multiplied by quantity)

  Write a select statement that returns the productname

Write a SELECT statement that returns the ProductName and ListPrice columns from the Products table.

  Write sql queries to answer the following questions

Double the capacity of each DC-10 airplane.

  Write a query that will list the part number

Write a query that will list the part number, part description, and on-hand value (units on hand * unit price) for each part in item class AP. Give the expression an alias of "On Hand Value".

  Write pl-sql block that displays last name

Write PL/SQL block which displays last name and salary of following people. Each of these can be done separately as PL/SQL, first to test and get output lines.

  Write an sql statement to produce a single column called

write an sql statement to produce a single column called itemlocation that combines the skudescriptionthe phrase is

  Draw an entity relationship model for galle face elephants

Using the Oracle Developer Data Modeler tool, draw an Entity Relationship Model for the Galle Face Elephants case study above. Explain any assumptions you have made.

  Convert the er/eer model

To represent a problem description given in natural language as an (Enhanced) Entity -Relationship model; to convert the ER/EER model into a relational data model;

  Select statement that uses the first select statement

Write a SELECT statement that returns three columns: EmailAddress, OrderID, and the order total for each customer. To do this, you can group the result set by the EmailAddress and OrderID columns.

  Write a select statement

Write a SELECT statement that returns these columns from the CustomerAddresses view that you created in exercise 1: CustomerID, LastName, FirstName, BillLine1.

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