Figure 5.6 One possible database state for the COMPANY relational database schema EMPLOYEE Sex Address Frame...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Figure 5.6 One possible database state for the COMPANY relational database schema EMPLOYEE Sex Address Frame Minit Lhame John B Smith 1234567891965-01-00 731 Fondren, Houston, TX M 333445555 1955-12-08 638 Voss, Houston, TX M Frankdin T Wong Alicia F Jennifer S Ramesh K J Zelaya 999887777 1968-01-19 3321 Castle, Spring, TX Walace 987654321 1941-06-20 291 Berry, Bellaire, TX F Narayan 666884444 1962-09-15 975 Fire Oak, Humble, TX M A English 453453453 1972-07-31 5631 Rice, Houston, TX M Joyon Ahmad V Jabbar 987987987 1060-03-29 980 Dallas, Houston, TX 888665555 1937-11-10 450 Stone, Houston, TX James E Borg DEPARTMENT Dame Research Administration Headquarters Dnumber 5 4 1 WORKS ON Esen Poo 123456789 1 123456789 2 #88884444 453463453 453463450 333445550 333445660 333445555 333445555 Hours 32.5 7.5 3 40.0 1 20.0 2 20.0 2 10.0 3 10.0 10 10:0 28829 San 20 10.0 999887777 999887777 907987987 987987987 987654321 967654321 20 888065556 20 30.0 10 10.0 10 35.0 5.0 30 30 20.0 15.0 NULL Bdate Mgr sen 333445555 987654321 888665555 Mgr start date 1988-05-22 1995-01-01 1981-06-19 DEPENDENT Esen 333445555 333445556 333445555 987654321 123456789 123456789 123456789 PROJECT Pname ProductX Product Product Computerization Reorganization Newbenefits Alice Theodore F Joy Abner Michael Alice Elizabeth Dependent name Sex F M F M 55000 NULL M M Salary Super_san De 30000 333445555 5 40000 888665555 5. F 25000 987654321 43000 888665555 F 5 38000 333445555 25000 333445555 25000 987654321 4 5 1 DEPT LOCATIONS Dnumber 1 Pnumber 1 Bellaire 2 Sugarland Houston 3 10 Stafford 20 Houston 30 Stafford 4 5 5 5 Diocation Houston Stafford Bellaire Sugarland Houston Plocation 4 4 Drum 5 5 5 1983-10-25 Son 1958-05-03 1942-02-28 Bdate Relationship 1986-04-05 Daughter 4 1 4 1988-01-04 Son 1988-12-30 1967-05-05 Spouse Spouse Daughter Spouse A. (15 points) You need to implement the database using MySQL RDBMS or any Open-source RDBMS of your choice. Examples of Open-source free RDBMS are SQLcl and SQL Developer Command Line, PostgreSQL, etc. B. (5 points) Populate the database with the tuples given in Figure 5.6 on page 162 of the Elmarsi textbook. C. (30 points) after the database is defined and populated, you then need to perform the following queries: 1. List the names of all male employees with two or more dependents 2. Find the names of all employees who are directly supervised by the employee whose SSN is '888665555' 3. For each project, list the project name and the total hours per week (by all employees) spent on that project. 4. Retrieve the names of all employees who work in the department that has the employee with the highest salary among all employees 5. List the names of all employees who work on more than two projects 6. For each department whose average employee salary is more than $30,000, retrieve the department name and the number of employees working for that department. Figure 5.6 One possible database state for the COMPANY relational database schema EMPLOYEE Sex Address Frame Minit Lhame John B Smith 1234567891965-01-00 731 Fondren, Houston, TX M 333445555 1955-12-08 638 Voss, Houston, TX M Frankdin T Wong Alicia F Jennifer S Ramesh K J Zelaya 999887777 1968-01-19 3321 Castle, Spring, TX Walace 987654321 1941-06-20 291 Berry, Bellaire, TX F Narayan 666884444 1962-09-15 975 Fire Oak, Humble, TX M A English 453453453 1972-07-31 5631 Rice, Houston, TX M Joyon Ahmad V Jabbar 987987987 1060-03-29 980 Dallas, Houston, TX 888665555 1937-11-10 450 Stone, Houston, TX James E Borg DEPARTMENT Dame Research Administration Headquarters Dnumber 5 4 1 WORKS ON Esen Poo 123456789 1 123456789 2 #88884444 453463453 453463450 333445550 333445660 333445555 333445555 Hours 32.5 7.5 3 40.0 1 20.0 2 20.0 2 10.0 3 10.0 10 10:0 28829 San 20 10.0 999887777 999887777 907987987 987987987 987654321 967654321 20 888065556 20 30.0 10 10.0 10 35.0 5.0 30 30 20.0 15.0 NULL Bdate Mgr sen 333445555 987654321 888665555 Mgr start date 1988-05-22 1995-01-01 1981-06-19 DEPENDENT Esen 333445555 333445556 333445555 987654321 123456789 123456789 123456789 PROJECT Pname ProductX Product Product Computerization Reorganization Newbenefits Alice Theodore F Joy Abner Michael Alice Elizabeth Dependent name Sex F M F M 55000 NULL M M Salary Super_san De 30000 333445555 5 40000 888665555 5. F 25000 987654321 43000 888665555 F 5 38000 333445555 25000 333445555 25000 987654321 4 5 1 DEPT LOCATIONS Dnumber 1 Pnumber 1 Bellaire 2 Sugarland Houston 3 10 Stafford 20 Houston 30 Stafford 4 5 5 5 Diocation Houston Stafford Bellaire Sugarland Houston Plocation 4 4 Drum 5 5 5 1983-10-25 Son 1958-05-03 1942-02-28 Bdate Relationship 1986-04-05 Daughter 4 1 4 1988-01-04 Son 1988-12-30 1967-05-05 Spouse Spouse Daughter Spouse A. (15 points) You need to implement the database using MySQL RDBMS or any Open-source RDBMS of your choice. Examples of Open-source free RDBMS are SQLcl and SQL Developer Command Line, PostgreSQL, etc. B. (5 points) Populate the database with the tuples given in Figure 5.6 on page 162 of the Elmarsi textbook. C. (30 points) after the database is defined and populated, you then need to perform the following queries: 1. List the names of all male employees with two or more dependents 2. Find the names of all employees who are directly supervised by the employee whose SSN is '888665555' 3. For each project, list the project name and the total hours per week (by all employees) spent on that project. 4. Retrieve the names of all employees who work in the department that has the employee with the highest salary among all employees 5. List the names of all employees who work on more than two projects 6. For each department whose average employee salary is more than $30,000, retrieve the department name and the number of employees working for that department.
Expert Answer:
Answer rating: 100% (QA)
Query SELECT FnameLnameCOUNTPno AS NoofProjects FROM workson department employee WHERE worksonESS... View the full answer
Related Book For
Fundamentals Of Database Systems
ISBN: 9780133970777
7th Edition
Authors: Ramez Elmasri, Shamkant Navathe
Posted Date:
Students also viewed these databases questions
-
Which of the following is not a universal rule for achieving internal control over cash? A) Separate recordkeeping from accounting for cash to the extent possible. B) Deposit each day's cash receipts...
-
Consider the COMPANY database described in Figure 5.6. Using the syntax of Oracle triggers, write active rules to do the following: a. Whenever an employees project assignments are changed, check if...
-
Specify the following queries on the database in Figure 5.5 in SQL. Show the query results if each query is applied to the database state in Figure 5.6. a. For each department whose average employee...
-
How does the range of hFE (Fig. 3.23j, normalized from hFE = 100) compare with the range of hfe (Fig. 3.23f) for the range of IC from 0.1 to 10 mA?
-
A permanent magnet is shaped as a ring with a narrow gap between the poles. The mean diameter of the ring equals d = 20 cm. The width of the gap is equal to b = 2.0 mm and the magnetic induction in...
-
If you win a lottery, you are given two options to collect the prize: taking a $500,000 lump sum today or receiving $100,000 per year for the next ten years. Which would you choose? Please use the...
-
Why are information security and privacy important considerations in the design, development, and maintenance of an HRIS?
-
Frankel Inc. experienced the following transactions for 2013, its first year of operations: 1. Issued common stock for $60,000 cash. 2. Purchased $210,000 of merchandise on account. 3. Sold...
-
5. For what value of the c is the function continuous everywhere? (a-1) x>2 f(x)= cx-1 if x2
-
On May 1, Janeka Clothing Exchange paid cash of $54,000 for computers that are expected to remain useful for three years. At the end of three years, the value of the computers is expected to be zero....
-
(iii) Which of the statements about protocol architecture are CORRECT? Check all that apply: [2 pts] a. Packet network protocols are structured into layers such as ISO 7-layer or IP 4-layer. b....
-
One of the biggest news items in the UK retail sector recently is the 1.4 billion acquisition in September 2016 of Home Retail Group, the parent company of Argos, by Sainsburys, one of the leading...
-
Suppose that the interest rate on one-year bonds is 4 percent and is expected to be 5 percent in one year and 6 percent in two years. Using the expectations hypothesis, compute the yields in two- and...
-
Based on the following information about Banks A and B, compute for each bank its return on assets (ROA), return on equity (ROE), and leverage ratio. a. Bank A has net profit after taxes of $1.8...
-
Consider the balance sheets of Bank A and Bank B. Suppose that reserve requirements are 10 percent of transaction deposits and both banks have equal access to the interbank market and funds from the...
-
In September 2019, Niem Duong opened a car hire business. The following transactions occurred during the first month of the business (ignore GST). Required (a) Journalize the above transactions. (b)...
-
Which of the following sorting algorithms does not effectively divide the list into two parts? Select one: a. Quicksort b. Bubble sort c. Selection sort d. Insertion sort cross out cross out cross...
-
Evaluate how many lines there are in a true rotational spectrum of CO molecules whose natural vibration frequency is w = 4.09 1014 s1 and moment of inertia I = 1.44 1039 g cm2.
-
What is the relationship between a type and its subtype in a type hierarchy? What is the constraint that is enforced on extents corresponding to types in the type hierarchy?
-
Name the main types of spatial operators and different classes of spatial queries.
-
What are the main reasons for and potential advantages of distributed databases?
-
What is the formula to calculate an individuals taxable income?
-
Explain why a taxpayer with higher income does not have as large of a behavioral response to an increase in the tax rate as a lower-income taxpayer.
-
Describe the goal of tax planning.
Study smarter with the SolutionInn App