Question

In: Computer Science

Draw the MySQL Data Model Maria’s Pizza – a local pizza shop that provides pizzas for...

Draw the MySQL Data Model

Maria’s Pizza – a local pizza shop that provides pizzas for pickup with one location - has hired you to create a database for them to store information about the store and its operations. Prior to building the database, you have decided to present the data model to the client for her approval. Here are the set of requirements that you have for the data model.

The client would like you to track the employees that they have in their store and the shift that is worked by the employees. They need to keep track of personal information about the employee including their name, phone number, address, social security number and other relevant information. This information does change from time to time as employees occasionally move. The store maintains two shifts, mid-day (11 AM – 5 PM) and night (5:00 PM to 11:00 PM). Employees can work across multiple shifts and shifts have multiple employees that work in that period. Shifts also have an employee as a supervisor. Therefore, different employees have different shift supervisors depending on which shift they are working – an employee in one shift may be the shift supervisor in another shift during the week.

Maria’s Pizza would also like this database to tie into their inventory system of food products that they offer. They sell only pizza for pickup, so the ingredients are what they need to keep track of – and all ingredients are tracked by packages of certain ounces (for example flour comes in 400 oz packages, mushrooms come in 64 oz packages, mozzarella cheese comes in 128 oz packages). They need to know the purchase price for each package, and the date of receipt of each shipment, and they update the quantity on hand every night before closing.

Maria’s Pizza has a single food distributor as its main supplier, but will buy a few items like sausage and fresh tomatoes from other local sources. After conducting inventory every night, they send orders if inventory levels get below certain thresholds. They would like to track the reordering of the different products from the suppliers including the date the re-order was placed, the employee that placed the order, and the scheduled delivery date of that order. Products can get re-ordered multiple times and employees can place multiple orders for products. Supplier information is also to be stored in the database including the supplier’s contact information, name and address. Because the same product can get ordered from multiple suppliers, it is important that the reorder contain information about which supplier that re-order was placed with.

Draw a data model for the above scenario.

Solutions

Expert Solution

The below image depicts how many tables are needed to be formed in the database and how they will be connected to one another:

Now, that we are clear on how the tables are inter- related to one another, let's create each table and add their attributes and attribute types:

Employee - Here, Employee_No, SSN are the primary keys.

Employee_No Varchar(10)
Name Varchar(25)
Phone Varchar(12)
Address Varchar(50)
SSN Varchar(14)

Shifts - Here, Shift_ID is the primary key and Supervisor is the Employee_ID which is a foreign key (ie., primary key from the Employee table above)

Shift_ID Varchar(10)
Shift_Type Varchar(10)
Shift_Start DateTime
Shift_End DateTime
Supervisor Varchar(10)

Shift_Detail - Here, Shift_ID is the foreign key (ie. primary key from Shift table) and Employee_ID which is a foreign key (ie., primary key from the Employee table above)

Shift_ID Varchar(10)
Employee_No Varchar(10)

Inventory - Here, Shipment_No is the primary key for this table.

Shipment_No Varchar(10)
Item_Name Varchar(30)
Package_Quantity Int
Purchase_Price_Per_Package Int
Each_Shipment_Date Datetime
Quantity_On_Hand Int
Updated_Shipment_Date DateTime
ReOrder_ID Varchar(10)

Reorder - Here , Reorder_ID is the primary key for Reorder table. Supplier_ID is the foreign key (ie. primary key for Supplier table, below).

Reorder_ID Varchar(10)
Reorder_Date DateTime
Employee_No Varchar(10)
Delivery_Date DateTime
Supplier_ID Varchar(10)

Supplier - Supplier_ID is the primary key here.

Supplier_ID Varchar(10)
Name Varchar(25)
Phone Varchar(12)
Address Varchar(50)

Related Solutions

Your local pizzeria is having a special offer on medium pizzas. The first pizza will cost...
Your local pizzeria is having a special offer on medium pizzas. The first pizza will cost you $10, but if you buy a second pizza it will only cost you $5. What aspect of consumer theory does this illustrate? Explain why a rational consumer does not spend all of her income buying only her favourite product. a) Suppose that Daniel is willing to pay a maximum of $5 for his first slice of pizza. For each additional slice, he would...
Presto Pizza delivers pizzas throughout its local market area at no charge to the customer. Mr....
Presto Pizza delivers pizzas throughout its local market area at no charge to the customer. Mr. Presto wants to estimate the average delivery distance. A random sample of 11 deliveries revealed the following round trip distances (in km.): 2.2     1.8     5.2     6.0     5.8     3.6     4.0     4.2      3.6     4.2     3.9 a) What is the point estimate of the population mean (in 1 decimal places)? b) At an 90% level of confidence, what is the average delivery distance (km., in 1...
21. Bob’s local pizza place claims it delivers pizzas in 30 minutes on average. Bob is...
21. Bob’s local pizza place claims it delivers pizzas in 30 minutes on average. Bob is convinced it’s more than that. He does a hypothesis test and gets a p-value of .001. a. What does Bob conclude? b. If Bob made the wrong conclusion what error did he make? c. What would be the impact of his error? 22. Bob’s local pizza place claims it delivers pizzas in 30 minutes on average. Bob is convinced it’s more than that. He...
Consider the data set below of the 14” pizzas at Little Italy. There are two pizza...
Consider the data set below of the 14” pizzas at Little Italy. There are two pizza chefs (Anna and Lorenzo, Factor A), two work shifts (day and evening, Factor B), and two dough companies (Sysco and PFG Holdings, Factor C). For each combination, there are four pizzas made (n = 4). The diameter of each pizza is measured.                                                                         Measurements                                                 Pizza                                       Anna                                                   Lorenzo Dough                Shift             1          2        3        4                    1            2        3        4 Sysco                   Day             14.1    ...
1. A local restaurant called “wow Pizza” has been exploring the quality of its pizzas. During...
1. A local restaurant called “wow Pizza” has been exploring the quality of its pizzas. During the past week, the restaurant sold the following number of pizzas each day: Day Pizzas sold Monday 5 Tuesday 7 Wednesday 13 Thursday 20 Friday 65 Saturday 50 Sunday 40 The restaurant owners have identified the following opportunities for mistakes associated with making a pizza.  During the past week of sales, they determined the total number of mistakes for each opportunity. Opportunity Defects Pizza dough...
(mysql)Lab 10 Database Normalization The relation (PatientLab) below provides some sample data for a clinic office...
(mysql)Lab 10 Database Normalization The relation (PatientLab) below provides some sample data for a clinic office that stores patient, insurance, lab test, and lab test result information. The relation is already in first normal form (1NF). Assuming that one patient can have multiple different tests performed in one day and same test can be performed for the same patient in different dates. Patient _ID Name Insurance_Code Insurance_Name DOB Lab_Test_ID Lab_Test_Name Lab_Result Lab_Test_Date P001 Joe Doe IN001 B&B 1/1/1990 L001 WBC...
Q1. Quickmeal Description of data Quickmeal is a local grocery shop that carries a limited variety...
Q1. Quickmeal Description of data Quickmeal is a local grocery shop that carries a limited variety of meat products, vegetable and fruits, dairy products, and beverages. The owner of Quickmeal, let’s call him John, wants to expand his business. John wants to understand the purchasing behaviour of his customers, so he can predict future demands. He recorded daily sales of products in June. The dataset is called “Quickmeal”, which is available in different formats. It shows the daily sales in...
Draw a relational model for the following case study. Case Study The local under-sixteen football league...
Draw a relational model for the following case study. Case Study The local under-sixteen football league needs a database to help track teams, children that sign up to play in the league, the parents of these children and the coaches for each team. The league wishes to record the details for each parent of a particular player (the parents last name, first name, phone contact number and address). For each player, the system needs to record the player's last name,...
Draw a data model for the following: A travel agency is frequently asked questions about tourist...
Draw a data model for the following: A travel agency is frequently asked questions about tourist destinations. For example, customers want to know details of the climate for a particular month, the population of the city, and other geographic facts. Sometimes they request the flying time and distance between two cities. The manager has asked you to create a database to maintain these facts.
In its Fuel Economy Guide for 2016 model vehicles, the Environmental Protection Agency provides data on...
In its Fuel Economy Guide for 2016 model vehicles, the Environmental Protection Agency provides data on 11701170 vehicles. There are a number of high outliers, mainly hybrid gas‑electric vehicles. If we ignore the vehicles identified as outliers, however, the combined city and highway gas mileage of the other 11461146 vehicles is approximately Normal with mean 23.023.0 miles per gallon (mpg) and standard deviation 4.94.9 mpg. The quartiles of any distribution are the values with cumulative proportions 0.250.25 and 0.75.0.75. They...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT