Question: Using the following database schema: Using SQL/PSM 1) Write a program segment that retrieves the employees who work in the Research department and print the

Using the following database schema:

Using the following database schema: Using SQL/PSM 1) Write a program segment

Using SQL/PSM

1) Write a program segment that retrieves the employees who work in the Research department and print the employee last name and their Ssn.

2) Write a program segment that retrieves the employees who work in departments located in Houston and on the project ProductZ. List their last name, Ssn, and the number of hours that the employee works on that project.

Figure 5.6 One possible database state for the COMPANY relational database schema. EMPLOYEE Fname Minit Lname Sex Salary Super ssn Dno B Smith 123456789 1965-01-09 731 Fondren, Houston, TX M 30000 333445555 5 FranklinT Wong 333445555 1955-12-08 638 Voss, Houston, TX M 40000 888665555 5 JZelaya 999887777 1968-01-19 3321 Castle, Spring, TX F 25000 9876543214 JenniferSWallace 9876543211941-06-20 291 Berry, Bellaire, TXF 43000 888665555 4 Ramesh K Narayan 666884444 1962-09-15 975 Fire Oak, Humble, TX M 38000 3334455555 Joyce AEnglish453453453 1972-07-31 5631 Rice, Houston, TXF 25000 333445555 5 AhmadV Jabbar 9879879871969-03-29 980 Dallas, Houston, TX M 25000 987654321 4 Address James E Borg 888665555 1937-11-10450 Stone, Houston, TXM55000 NULL DEPARTMENT DEPT LOCATIONS Dnumber Dlocation Houston Stafford Bellaire Sugarland Houston Dnumber Dname Research Administration Headquarters Mgr ssn 333445555 987654321 888665555 Mgr_start date 1988-05-22 199501-01 1981-06-19 4 4 WORKS ON PROJECT Essn 123456789 123456789 666884444 453453453 453453453 333445555 333445555 333445555 333445555 999887777 999887777 987987987 987987987 987654321 987654321 888665555 Pno Hours Pnumber Plocation Dnum Bellaire Sugarland Houston Stafford Houston Stafford Pname ProductX ProductY ProductZ Computerization10 Reorganization Newbenefits 3 40.0 20.0 20.0 4 3 DEPENDENT Dependent_name Sex Relationship Essn 333445555 333445555 333445555 987654321 123456789 123456789 123456789 30.0 10.0 35.0 Theodore Jo Abner Michael F 1986-04-05Daughter M 1983-10-25 Son F 1958-05-03Spouse M 1942-02-28 Spouse M 1988-01-04 Son F 1988-12-30 Daughter F 1967-05-05 Spouse 20.0 20 NULL Elizabeth

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!