Question: Expert reply only. Use the relational schema to provide SQL queries. (For Oracle) RELATIONAL SCHEMA: EMPLOYEE (FNAME, MINIT, LNAME, SSN, BDATE, ADDRESS, SEX, SALARY, #SUPERSSN,

Expert reply only. Use the relational schema to provide SQL queries. (For Oracle)

RELATIONAL SCHEMA:

EMPLOYEE (FNAME, MINIT, LNAME, SSN, BDATE, ADDRESS, SEX, SALARY, #SUPERSSN, #DNO)

DEPARTMENT (DNAME, DNUMBER, #MGRSSN, MGRSTARTDATE)

DEPT_LOCATIONS (#DNUMBER, DLOCATION)

PROJECT (PNAME, PNUMBER, PLOCATION, #DNUM)

WORKS_ON (#ESSN, #PNO, HOURS)s

DEPENDENT (#ESSN, DEPENDENT_NAME, SEX, BDATE, RELATIONSHIP)

Provide sql query/statements: (To be run in Oracle)

A. For each employee, retrieve the employee's first and last name and the first and last name of the his or her immediate supervisor.

B. Retrieve the name of each employee who has a dependent with the same first name and same sex as the employee.

Fix this query to run in Oracle. This query is returning a message that says....No data found:

select E.FNAME, E.LNAME

from EMPLOYEE E

where E.SSN in (select ESSN from DEPENDENT where E.FNAME = DEPENDENT_NAME and E.SEX = SEX );

C. For each project on which more than two employees work, retrieve the project number, the project name, and the number of employees who work on that project.

Fix this query to run in Oracle. This query is returning a message that says....No data found:

select PNAME, PNUMBER , count(*)

from PROJECT , WORKS_ON

where PNUMBER = PNO

group by PNAME, PNUMBER

having count(*)>2;

D. Find all employees who were born during the 1950s.

Fix this query to run in Oracle. This query is returning a message that says....No data found:

select FNAME , LNAME

from EMPLOYEE

where BDATE like '____1950' ;

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!