Question
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.
- 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
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 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
Assignment
Assets
|
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...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started