Use MySQL Workbench to create the following Schema EMPLOYEE Fname Minit Lname Ssn Bdate Address Sex...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Use MySQL Workbench to create the following Schema EMPLOYEE Fname Minit Lname Ssn Bdate Address Sex Salary Super_ssn Dno DEPARTMENT Dname Dnumber Mgr_ssn Mgr_start_date DEPT_LOCATIONS Dnumber Dlocation PROJECT Pname Pnumber Plocation WORKS ON Essn Pno Hours Dnum DEPENDENT Essn Dependent_name Sex Bdate Relationship One possible database state for the COMPANY relational database schema (Fig. 5.6) EMPLOYEE Fname Minit Lname Ssn John B Smith 123456789 Franklin T Wong 333445555 Alicia J Zelaya 999887777 Jennifer S Wallace 987654321 Ramesh K Narayan 666884444 Joyce A English Ahmad V Jabbar James 1955-12-08 638 Voss, Houston, TX 1968-01-19 3321 Castle, Spring, TX 1941-06-20 291 Berry, Bellaire, TX 1962-09-15 975 Fire Oak, Humble, TX 453453453 1972-07-31 5631 Rice, Houston, TX 987987987 1969-03-29 980 Dallas, Houston, TX E Borg 888665555 1937-11-10 450 Stone, Houston, TX DEPARTMENT Dname Research Administration Headquarters Bdate Address Sex Salary Super_ssn Dno 1965-01-09 731 Fondren, Houston, TX M 30000 333445555 5 M 40000 888665555 5 F 25000 987654321 4 43000 888665555 4 F Dnumber 5 4 1 Mgr_ssn 333445555 987654321 888665555 Mgr_start_date 1988-05-22 1995-01-01 1981-06-19 M F M 38000 333445555 25000 333445555 25000 987654321 4 55000 NULL 1 DEPT_LOCATIONS Dnumber 1 4 5 LO 5 LO LO 5 5 LO 5 Dlocation Houston Stafford Bellaire Sugarland Houston One possible database state for the COMPANY relational database schema - continued (Fig. 5.6) PROJECT WORKS ON Essn 123456789 123456789 666884444 453453453 453453453 333445555 333445555 333445555 333445555 999887777 999887777 987987987 987987987 987654321 987654321 888665555 Pno 1 2 3 1 2 2 3 10 20 30 10 10 30 30 20 20 Hours 32.5 7.5 40.0 20.0 20.0 10.0 10.0 10.0 10.0 30.0 10.0 35.0 5.0 20.0 15.0 NULL DEPENDENT Essn Pnumber Plocation 1 Bellaire 2 Sugarland 3 Houston Computerization 10 20 Reorganization Newbenefits 30 333445555 333445555 333445555 Joy 987654321 123456789 123456789 123456789 Pname ProductX ProductY ProductZ Dependent_name Sex F M F M M Alice Theodore Abner Michael Alice Elizabeth F Stafford Houston Stafford Dnum 5 5 5 4 1 4 Bdate Relationship 1986-04-05 Daughter 1983-10-25 Son 1958-05-03 Spouse 1942-02-28 Spouse 1988-01-04 Son 1988-12-30 Daughter 1967-05-05 Spouse SQL CREATE TABLE data definition statements for defining the COMPANY schema from Figure 5.7 (Fig. 6.1) CREATE TABLE EMPLOYEE (Fname Minit Lname Ssn Bdate Address Sex Salary Super_ssn Dno PRIMARY KEY (Ssn), CREATE TABLE DEPARTMENT (Dname Dnumber Mgr_ssn Mgr_start_date VARCHAR(15) CHAR, VARCHAR(15) CHAR(9) DATE, CREATE TABLE DEPT_LOCATIONS VARCHAR(30), CHAR, DECIMAL (10,2), CHAR(9), INT VARCHAR(15) INT CHAR(9) DATE, PRIMARY KEY (Dnumber), UNIQUE (Dname), FOREIGN KEY (Mgr_ssn) REFERENCES EMPLOYEE(Ssn)); INT NOT NULL, VARCHAR(15) NOT NULL, NOT NULL, NOT NULL, (Dnumber Dlocation PRIMARY KEY (Dnumber, Dlocation), FOREIGN KEY (Dnumber) REFERENCES DEPARTMENT (Dnumber) ); NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, continued on next slide SQL CREATE TABLE data definition statements for defining the COMPANY schema from Figure 5.7 (Fig. 6.1)-continued CREATE TABLE PROJECT (Pname Pnumber Plocation CREATE TABLE WORKS_ON Dnum PRIMARY KEY (Pnumber), UNIQUE (Pname), FOREIGN KEY (Dnum) REFERENCES DEPARTMENT(Dnumber)); CREATE TABLE DEPENDENT (Essn VARCHAR(15) VARCHAR(15), Dependent_name INT Sex Bdate INT (Essn Pno Hours PRIMARY KEY (Essn, Pno), FOREIGN KEY (Essn) REFERENCES EMPLOYEE(Ssn), FOREIGN KEY (Pno) REFERENCES PROJECT(Pnumber)); CHAR(9) INT DECIMAL (3,1) CHAR(9) VARCHAR(15) CHAR, DATE, VARCHAR(8), Relationship PRIMARY KEY (Essn, Dependent_name), FOREIGN KEY (Essn) REFERENCES EMPLOYEE(Ssn)); NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, What to do? Using MySQL Workbench write at least 50 SQL queries (of your choice and your prior query experience- make sure you include all the categories "query_select, query_count, query_join, query_null, JOIN query, IN query subquery, DROP query, VIEW query,,etc) Do this: Using MySQL Workbench, add at least five more rows of data to each of your Then, using MySQL Workbench, create and execute advanced queries of your choice that demonstrate each of the following: The use of a GROUP BY clause, with a HAVING clause, and one or more group functions The use of UNION operator The use of a subquery The use of an outer join Then create and execute at least one SQL UPDATE and at least one SQL DELETE query. Apply at least one IN query Apply one DROP command Finally, create and use an SQL view and in a SELECT query. Submit the following outputs of your SQL script file processing (note: screenshots are accepted), in this order and appropriately labeled, in a single Word file: At the top of your Word file include your name, and the date. tables. Use MySQL Workbench to create the following Schema EMPLOYEE Fname Minit Lname Ssn Bdate Address Sex Salary Super_ssn Dno DEPARTMENT Dname Dnumber Mgr_ssn Mgr_start_date DEPT_LOCATIONS Dnumber Dlocation PROJECT Pname Pnumber Plocation WORKS ON Essn Pno Hours Dnum DEPENDENT Essn Dependent_name Sex Bdate Relationship One possible database state for the COMPANY relational database schema (Fig. 5.6) EMPLOYEE Fname Minit Lname Ssn John B Smith 123456789 Franklin T Wong 333445555 Alicia J Zelaya 999887777 Jennifer S Wallace 987654321 Ramesh K Narayan 666884444 Joyce A English Ahmad V Jabbar James 1955-12-08 638 Voss, Houston, TX 1968-01-19 3321 Castle, Spring, TX 1941-06-20 291 Berry, Bellaire, TX 1962-09-15 975 Fire Oak, Humble, TX 453453453 1972-07-31 5631 Rice, Houston, TX 987987987 1969-03-29 980 Dallas, Houston, TX E Borg 888665555 1937-11-10 450 Stone, Houston, TX DEPARTMENT Dname Research Administration Headquarters Bdate Address Sex Salary Super_ssn Dno 1965-01-09 731 Fondren, Houston, TX M 30000 333445555 5 M 40000 888665555 5 F 25000 987654321 4 43000 888665555 4 F Dnumber 5 4 1 Mgr_ssn 333445555 987654321 888665555 Mgr_start_date 1988-05-22 1995-01-01 1981-06-19 M F M 38000 333445555 25000 333445555 25000 987654321 4 55000 NULL 1 DEPT_LOCATIONS Dnumber 1 4 5 LO 5 LO LO 5 5 LO 5 Dlocation Houston Stafford Bellaire Sugarland Houston One possible database state for the COMPANY relational database schema - continued (Fig. 5.6) PROJECT WORKS ON Essn 123456789 123456789 666884444 453453453 453453453 333445555 333445555 333445555 333445555 999887777 999887777 987987987 987987987 987654321 987654321 888665555 Pno 1 2 3 1 2 2 3 10 20 30 10 10 30 30 20 20 Hours 32.5 7.5 40.0 20.0 20.0 10.0 10.0 10.0 10.0 30.0 10.0 35.0 5.0 20.0 15.0 NULL DEPENDENT Essn Pnumber Plocation 1 Bellaire 2 Sugarland 3 Houston Computerization 10 20 Reorganization Newbenefits 30 333445555 333445555 333445555 Joy 987654321 123456789 123456789 123456789 Pname ProductX ProductY ProductZ Dependent_name Sex F M F M M Alice Theodore Abner Michael Alice Elizabeth F Stafford Houston Stafford Dnum 5 5 5 4 1 4 Bdate Relationship 1986-04-05 Daughter 1983-10-25 Son 1958-05-03 Spouse 1942-02-28 Spouse 1988-01-04 Son 1988-12-30 Daughter 1967-05-05 Spouse SQL CREATE TABLE data definition statements for defining the COMPANY schema from Figure 5.7 (Fig. 6.1) CREATE TABLE EMPLOYEE (Fname Minit Lname Ssn Bdate Address Sex Salary Super_ssn Dno PRIMARY KEY (Ssn), CREATE TABLE DEPARTMENT (Dname Dnumber Mgr_ssn Mgr_start_date VARCHAR(15) CHAR, VARCHAR(15) CHAR(9) DATE, CREATE TABLE DEPT_LOCATIONS VARCHAR(30), CHAR, DECIMAL (10,2), CHAR(9), INT VARCHAR(15) INT CHAR(9) DATE, PRIMARY KEY (Dnumber), UNIQUE (Dname), FOREIGN KEY (Mgr_ssn) REFERENCES EMPLOYEE(Ssn)); INT NOT NULL, VARCHAR(15) NOT NULL, NOT NULL, NOT NULL, (Dnumber Dlocation PRIMARY KEY (Dnumber, Dlocation), FOREIGN KEY (Dnumber) REFERENCES DEPARTMENT (Dnumber) ); NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, continued on next slide SQL CREATE TABLE data definition statements for defining the COMPANY schema from Figure 5.7 (Fig. 6.1)-continued CREATE TABLE PROJECT (Pname Pnumber Plocation CREATE TABLE WORKS_ON Dnum PRIMARY KEY (Pnumber), UNIQUE (Pname), FOREIGN KEY (Dnum) REFERENCES DEPARTMENT(Dnumber)); CREATE TABLE DEPENDENT (Essn VARCHAR(15) VARCHAR(15), Dependent_name INT Sex Bdate INT (Essn Pno Hours PRIMARY KEY (Essn, Pno), FOREIGN KEY (Essn) REFERENCES EMPLOYEE(Ssn), FOREIGN KEY (Pno) REFERENCES PROJECT(Pnumber)); CHAR(9) INT DECIMAL (3,1) CHAR(9) VARCHAR(15) CHAR, DATE, VARCHAR(8), Relationship PRIMARY KEY (Essn, Dependent_name), FOREIGN KEY (Essn) REFERENCES EMPLOYEE(Ssn)); NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, What to do? Using MySQL Workbench write at least 50 SQL queries (of your choice and your prior query experience- make sure you include all the categories "query_select, query_count, query_join, query_null, JOIN query, IN query subquery, DROP query, VIEW query,,etc) Do this: Using MySQL Workbench, add at least five more rows of data to each of your Then, using MySQL Workbench, create and execute advanced queries of your choice that demonstrate each of the following: The use of a GROUP BY clause, with a HAVING clause, and one or more group functions The use of UNION operator The use of a subquery The use of an outer join Then create and execute at least one SQL UPDATE and at least one SQL DELETE query. Apply at least one IN query Apply one DROP command Finally, create and use an SQL view and in a SELECT query. Submit the following outputs of your SQL script file processing (note: screenshots are accepted), in this order and appropriately labeled, in a single Word file: At the top of your Word file include your name, and the date. tables.
Expert 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
-
Does this make sense "For my thesis, we are considering a regression model due to its compatibility with a continuous dependent variable, in this case, 'housing instability.' This model will have a...
-
Assume the following selected income statement and balance sheet information for Larriet Inc.: Larriet Inc. Larriet Inc. Income Statement Balance Sheet Information Year Ended December 3 1 , Year 5 (...
-
Repeat Laboratory Exercises 8.34 through 8.38 in domain relational calculus (DRC) by using the DRC interpreter. Exercises 8.34 Specify and execute the following queries in relational algebra (RA)...
-
The consumer price index tends to underrepresent; overstating underrepresent; understating overrepresent; overstating overrepresent; understating ignore; understating the substitution of lower-priced...
-
The sales budget for your company in the coming year is based on a quarterly growth rate of 10 percent, with the first-quarter sales projection at $185 million. In addition to this basic trend, the...
-
Use the substitution or elimination method to solve each system of equations. Identify any inconsistent systems or systems with infinitely many solutions. If a system has infinitely many solutions,...
-
A car is bought for 16,000. It is to be depreciated on a diminishing balance basis using a rate of 40% p.a. What is the car's net book value at the end of 2 years' ownership? a. 9,600 b. 5,760 c....
-
Fortune ran an article on Bob Olstein, an investment analyst who was particularly bullish at the time on several well-known stocks. He said the following indicators were the keys to his success: (1)...
-
8. A town with a population of 100 people grows to a population of 200 in five years. Assume the dP dt population P grows exponentially according to the equation = kP. Find the relative growth rate k.
-
On October 1, 2016, Culver Corp. issued $936,000, 8%, 10-year bonds at face value. The bonds were dated October 1, 2016, and pay interest annually on October 1. Financial statements are prepared...
-
Attorney Lillian Liberty wants to expand the firm's sports law practice, and is very pleased to have a new client, Dwayne Simpson, a waterpolo player. Liberty wants you to assist with Simpson's...
-
Image transcription text Activity 2A Estimated Time 20 Minutes (10 minutes for presentation) Objective To provide you with an opportunity to summarise key concepts and ideas .and present to target...
-
Which one of the following statements is false? A full binary tree has an even number of vertices. A binary tree is an m-ary with m = 2. In an m-ary tree, each internal vertex has at most m children....
-
Explain why NH3 (ammonia) is considered a base under the Bronsted-Lowry definition, but is not an Arrhenius base. HTML Editor BIUA AIEE 2 1 1 x XE E 12pt Paragraph O words
-
For each of the following, find x in terms of y: 5 4x + 3y = 2x + 21y
-
Which feature in Simucase assists faculty with providing feedback to students? A. Faculty Dashboard B. Part Task Trainer C. Video Library D. Assessment Form
-
https://www.youtube.com/watch?v=sK51nv8mo-o Neuroplasticity Ignorance and bias towards those who have experienced trauma. Assessing trauma focusing on immediate concerns assess trauma exposure...
-
A company has the following incomplete production budget data for the first quarter: In the previous December, ending inventory was 200 units, which was the minimum required, at 10% of projected...
-
What other projects are included in the open source Hadoop ecosystem?
-
Suppose that the following search field values are deleted, in the given order, from the B + -tree of Exercise 17.19; show how the tree will shrink and show the final tree. The deleted values are 65,...
-
What is meant by row-level access control?
-
Dollar/Euro Forwards. Use the following spot and forward bid-ask rates for the U.S. dollar/euro (US$/) from December 10, 2010, to answer the following questions: a. What is the mid-rate for each...
-
Swissie Triangular Arbitrage. The following exchange rates are available to you. (You can buy or sell at the stated rates.) Assume you have an initial SF12,000,000. Can you make a profit via...
-
Aussie Dollar Forward. Use the following spot and forward bid-ask rates for the U.S. dollar/Australian dollar (US$ = A$1.00) exchange rate from December 10, 2010, to answer the following questions:...
Study smarter with the SolutionInn App