Calculate the grocery store’s SUM salary and the AVG salary per position.
Question
I’m having trouble with this.
Imagine you work for an independent grocery store with 20 employees. The business owner has tasked you with creating a relational database that will track employee names, IDs, positions (e.g., cashier, manager, clerk, or night crew), and salaries.
Create a relational database table in Microsoft® Excel® for the grocery store using the provided data points.
Apply the universal rules (unique primary keys, unique column names, no duplicate rows) to your table.
Include all necessary null values.
Display in the table the requested database queries:
INSERT INTO Account: VALUES (188820, 'Wendall Glass', $12/h) UPDATE Account: Set salary = $12/h WHERE ID = 128872 DELETE FROM Account WHERE ID = 244332
Calculate the grocery store’s SUM salary and the AVG salary per position.
USE Data Points
Data Points
1. Blanche Dishner – 438927 – Manager – $25/h
2. 372991 – Night crew – $17/h
3. Luciano Sloney – 300126 – Night crew – $17/h
4. Dorris Goodsell – Cashier – $15/h
5. Sybil Fain – 119325 – Clerk – $11/h
6. Shaun McNeil – 200743 – Cashier – $13/h
7. Olen Wigley – 222345 – Cashier – $14/h
8. Dovie Seawood – 109321 – Clerk – $12/h
9. Magdalen Mullaney – 256921 – Cashier
10. Salena Souza – 185549 – Clerk – $12/h
11. Paige Alvarez – 132943 – Clerk – $11/h
12. Cassy Lundin – 391285 – Night crew
13. Tajuana Stoval – 491621 – Manager – $23/h
14. Joaquina Piasecki – 185392 – Clerk – $13/h
15. Janiece Abelson – 244332 – Cashier – $13/h
16. Rogelio Peppler – 128872 – Clerk – $11/h
17. Fatima Haymaker – 100321 – $13/h
18. Rico Fairbank – 318821 – Night crew – $16/h
19. Trey Peloquin – 488326 – Manager – $24/h
20. Paulene Thibeau – 193931 – Clerk – $12/h
Summary
In the above question, we have given a SQL query. Where we have data points and we have to Create a relational database table in Microsoft Excel for the grocery store. Where we are going to use the universal rules (unique primary keys, unique column names, no duplicate rows) to our table. After that, we are going to Display in the table the requested database queries.
Explanation
Primary Key | Unique constraint | Not Null | |
Employee Name | Employee ID | Position | Salary |
Blanche Dishner | 438927 | Manager | $25/h |
Null | 372991 | Night crew | $17/h |
Luciano Sloney | 300126 | Night crew | $17/h |
Dorris Goodsell | Null | Cashier | $15/h |
Sybil Fain | 119325 | Clerk | $11/h |
Shaun McNeil | 200743 | Cashier | $13/h |
Olen Wigley | 222345 | Cashier | $14/h |
Dovie Seawood | 109321 | Clerk | $12/h |
. Magdalen Mullaney | 256921 | Cashier | Null |
Salena Souza | 185549 | Clerk | $12/h |
Paige Alvarez | 132943 | Clerk | $11/h |
Cassy Lundin | 391285 | Night crew | Null |
Tajuana Stoval | 491621 | Manager | $23/h |
Joaquina Piasecki | 185392 | Clerk | $13/h |
Janiece Abelson | 244332 | Cashier | $13/h |
Rogelio Peppler | 128872 | Clerk | $11/h |
Fatima Haymaker | 100321 | Null | $13/h |
Rico Fairbank | 318821 | Night crew | $16/h |
Trey Peloquin | 488326 | Manager | $24/h |
Paulene Thibeau | 193931 | Clerk | $12/h |
The relational table after making modifications as per the query above in the question
Primary Key | Unique constraint | Not Null | |
Employee Name | Employee ID | Position | Salary |
Blanche Dishner | 438927 | Manager | $25/h |
Null | 372991 | Night crew | $17/h |
Luciano Sloney | 300126 | Night crew | $17/h |
Dorris Goodsell | Null | Cashier | $15/h |
Sybil Fain | 119325 | Clerk | $11/h |
Shaun McNeil | 200743 | Cashier | $13/h |
Olen Wigley | 222345 | Cashier | $14/h |
Dovie Seawood | 109321 | Clerk | $12/h |
. Magdalen Mullaney | 256921 | Cashier | Null |
Salena Souza | 185549 | Clerk | $12/h |
Paige Alvarez | 132943 | Clerk | $11/h |
Cassy Lundin | 391285 | Night crew | Null |
Tajuana Stoval | 491621 | Manager | $23/h |
Joaquina Piasecki | 185392 | Clerk | $13/h |
Janiece Abelson | 244332 | Cashier | $13/h |
Rogelio Peppler | 128872 | Clerk | $11/h |
Fatima Haymaker | 100321 | Null | $13/h |
Rico Fairbank | 318821 | Night crew | $16/h |
Trey Peloquin | 488326 | Manager | $24/h |
Paulene Thibeau | 193931 | Clerk | $12/h |
Wendall Glass | 128872 | Null | $12/h |
The table showing the SUM salary and the AVG salary for every position:
Position | Sum | Avg |
Manager | 72 | 24 |
Night crew | 50 | 16.667 |
Cashier | 42 | 14 |
Clerk | 83 | 11.857 |
Also read, Write the definition of a class that has the following properties.