Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Jonathan's Magic Emporium was founded in 1957 in Seattle, Washington. It has grown into an internationally recognized organization in the magical community. The company is

Jonathan's Magic Emporium was founded in 1957 in Seattle, Washington. It has grown into an internationally recognized organization in the magical community. The company is in two buildings. One building houses the Administration, Accounting, Finance, and Human Resources departments, and the second houses the Production, Marketing, and Information Systems departments. The company database contains information about employees, departments, projects, and assets. 

 

A department has many employees, but an employee only works for one department. A department may have many projects or no projects, but a project is assigned to only one department. An employee may be assigned more than one project. The asset table currently only contains data about computers. An employee is assigned only one computer and a computer can only be assigned to one employee at a time. 

 

  1. Based on your analysis of the sample data below (primary keys are bolded and foreign keys are bold/italicized), use a diagramming software of your choice to create an E-R diagram for Jonathan's Magic Emporium Database. Document it fully, noting primary keys, foreign keys, cardinality, and modality. For a deliverable, insert the diagram into your answer sheet as a picture.   If you choose to use https://app.diagrams.net 

 

2. Recreate the above tables in MySQL, using the sample data below to determine data types and lengths. During table creation, make sure to define primary keys and foreign keys. For deliverables, take screenshots of each Create Table command (5 total). 

 

3. Insert the data below into your newly created tables. Data should match exactly as it is shown (capitalization, punctuation, etc.). For deliverables take a screenshot of a SELECT * command being performed on each table (5 total). 

 

4. Create the following queries. Each query should be completed as a single command. If a column is the result of a calculation or a function, use an alias to assign a more descriptive name. Make sure screenshots show the full SQL command and its results.

 

a. Assume all employees make 18.50 an hour. Create a query that lists the projectID, projectName, MaxHours, and the calculated ProjectCost.

 

b. Jonathan's Magic Emporium is interested in seeing which departments have more than one employee. Create a report listing the department name and the number of employees that work in that department. 

 

c. Using a subquery, list all employees (firstname, lastname) who have worked more than 50 hours on any single assignment. Hint: Use of a distinct in your subquery may be useful. 

 

d. Create a report listing the project name, the first and last name of the employee assigned to the project, and the number of hours the employee has worked. Order by project name.

 

e. Who is currently using which computer? Create a SQL query showing serial Number, Make, and model, along with the employeeID, firstname, lastname, and department of the assigned employee. 

 

 

5. Create a new table, based on the existing assets table. Name it DellComputer and insert all recorders with the Make of DELL into it. Do this in a single SQL command. 

 

6. In the DellComputer table, decrease the purchase price of all records by 10%. 

 

 

7. In the DellComputer table, delete all records whose serial number ends in Q2. 

 

8. Remove the DellComputer table from your database. 

 

 

Department

DepartmentNameBudgetCodeOfficeNumberPhone
AdministrationBC-100-10BLDG01-300360-285-8100
LegalBC-200-10BLDG01-301360-285-8200
AccountingBC-300-10BLDG01-302360-285-8300
FinanceBC-400-10BLDG01-303360-285-8400
Human R..n@W..e@W..s@W..s@W..y@WPC.com7GeorgeSmithHuman R..h@WPC.com8TomJacksonProduction360-285-8880TomJackson@W..s@WPC.com10KenNumotoMarketing360-285-8101KenNumoto@W..r@WPC.com12RickBrownInfoSystems360-285-8121RickBrown@WPC.com

 

Project

ProjectIDProjectNameDepartmentMaxHoursStartDateEndDate
10002023 Q3 Product PlanMarketing13510-May-2315-Jun-23
11002023 Q3 Portfolio AnalysisFinance1205-Jul-2325-Jul-23
12002023 Q3 Tax PreparationAccounting14510-Aug-2315-Oct-23
13002023 Q4 Product PlanMarketing15010-Aug-2315-Sep-23
14002023 Q4 Portfolio AnalysisFinance1405-Oct-2331-Dec-23

 

Assignment

AssignmentIDProjectIDEmployeeNumberHoursWorked
11000130
21000875
310001055
41100440
51100645
61200125
71200220
81200445
91200540
101300135
111300880
1213001050
131400415
141400510
151400627.5

 

 

Assets

Serial NumberMakeModelPurchaseAmountEmployeeIssued
2S1K4Q2DELL LATITUDE 5590820.771
3MLN4Q2DELL LATITUDE 5590820.772
95LLST2DELL LATITUDE 55901385.053
2ZKX2X2DELL LATITUDE 55909744
8MXQ4Q2DELL LATITUDE 5590820.775
JCCG4Q2DELL LATITUDE 5590820.776
GG2H4Q2DELL LATITUDE 5590820.777
70LX2X2DELL LATITUDE 55909748
JFRX2X2AppleMACBOOK PRO 1532909
FBZ15Y2AppleMACBOOK PRO 15329010
786D4Q2AppleMACBOOK PRO 15329011
3PY33X2AppleMACBOOK PRO 15329012

Department DepartmentName BudgetCode OfficeNumber Phone Administration BC-100-10 BLDG01-300 360-285-8100 Employee EmployeeNumber FirstName LastName Jacobs Jackson 1 Mary 2 Rosalie Richard 3 4 Tom 5 Heather 6 Mary 7 

Department DepartmentName BudgetCode OfficeNumber Phone Administration BC-100-10 BLDG01-300 360-285-8100 Legal BC-200-10 BLDG01-301 360-285-8200 Accounting BC-300-10 BLDG01-302 360-285-8300 Finance BC-400-10 BLDG01-303 360-285-8400 Human Resources BC-500-10 BLDG01-304 360-285-8500 BC-600-10 BLDG01-305 360-285-8600 BC-700-10 BLDG02-99 360-285-8700 BC-800-10 BLDG02-100 360-285-8800 Production Marketing InfoSystems

Step by Step Solution

3.48 Rating (155 Votes )

There are 3 Steps involved in it

Step: 1

It seems like there is a request for several actions here that involve creating an ER diagram setting up a database in MySQL and performing various queries To assist in this task I can guide you on ho... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Ethics Ethical Decision Making and Cases

Authors: O. C. Ferrell

11th Edition

1305500846, 1305500849, 9781305856233 , 978-1305500846

More Books

Students also viewed these Databases questions

Question

Box

Answered: 1 week ago