View Full Version : Normalization HELP! - Simple Question


Broad
12-30-2009, 04:13 AM
Please help is needed in this topic: I would be very very thankful.

It is about a pizza shop: (Questions are at the bottom)

Read this first:

[Customers will need to be registereed , with their name, adddress and phone number. Once registered, customers can phone up and order the food they require by quoting their customer number (or name/ address if they can't rember it). Customers select which pizza (s) they require and how many they want. The order is then assembled and delivered to the customer.
When an order is taken, a note needs to be made of the time and date when it was made, and the member of staff who has taken it. The order value has to be more than $10 otherwise a $2 delivery charge is applied.]

Question:
Identify for me all entities.
List the attributes of the entities,
Ensure attributes can't be broken down into further attributes (atomic).


Thanks again in advance:)

This is my WORK:

[[

Entities



Customer




Order




Pizza




Member of Staff


Attributes

Customer:


CustomerNo
Customer Name
Surname
Address
Phone Number


Pizza:


Pizza Type
Quantity
Pizza Price


Order:


Order Date
Order Time


Member of Staff:


Employee ID
Employee Name
Employee Surname


First normal form (1NF)

1st Normal Form
CUSTOMER(CustomerNo, CustomerName, CustomerSurname,
ADDRESS, PhoneNumber,)

PIZZA(PizzaID, PizzaType,)

MEMBEROFSTAFF(StaffID, StaffForename, Staff Surname)

ORDER(OrderID, OrderTime, Orderdate, DeliveryCharge, PizzaQuantity , TotalCost)


]]

Adam Caramon
12-30-2009, 04:37 AM
Gotta be honest with you, this sounds like a school assignment. If that's the case, you should be doing it on your own.

dbDamo
12-30-2009, 05:05 AM
Pretty sure you're meant to be learning this for yourself - you're not going to get any help here unless you can convince us that this is not the case.

Take the time to learn, you'll benefit from it in the end.

boblarson
12-30-2009, 05:22 AM
And for heaven's sake, don't post the same question to more than one category. It is considered very bad manners in forums to do so.

Broad
12-30-2009, 07:51 AM
Sorry, this is my first time using forums.

Broad
12-30-2009, 07:56 AM
Bro, I have done my one but I want to make sure that it is correct. If you don't believe, no problem I will post my work.

dbDamo
12-30-2009, 11:10 PM
Post your work then and we will have a look at it for you

Broad
12-31-2009, 05:04 AM
Look at my work

dbDamo
12-31-2009, 05:13 AM
To start with, how about a please? Good manners cost nothing.

1. Your Pizza table should not contain the Pizza Quantity field - that should be held in the Order table

2. You should have a Pizza Price field in your Pizza table

3. Order Cost should not be stored in any table - it should be calculated in a query

Now give it another go - and spend some time thinking. You need to think about all data that will need to be stored then follow normalisation from 0NF to 3NF. Let normalisation decide which fields belong in which table rather than deciding randomly.

Broad
12-31-2009, 05:29 AM
Thanks for the help friend.

You said I need to think about all data that will need to be stored. You mean I should think of possible attributes for the entities.

Thanks again.

dbDamo
12-31-2009, 05:34 AM
You shouldn't even think about the entities until you have listed all of your attributes. When you're sure you have all of your attributes, create a table with some dummy data and then you can begin normalisation, which will decide your entities.

Broad
12-31-2009, 05:42 AM
OK. Thanks for your time.

dbDamo
12-31-2009, 05:50 AM
No problem - any problems/questions don't hesitate to ask - but I'm off to the pub now so will have to wait until the New Year!!! Have a good one.

Broad
01-05-2010, 01:41 PM
Can you check this please.



Entities



Customer




Order




Pizza




Member of Staff


Attributes

Customer:


CustomerNo
Customer Name
Surname
Address
Phone Number


Pizza:


Pizza Type
Quantity
Pizza Price


Order:


Order Date
Order Time


Member of Staff:


Employee ID
Employee Name
Employee Surname


First normal form (1NF)

1st Normal Form
CUSTOMER(CustomerNo, CustomerName, CustomerSurname,
ADDRESS, PhoneNumber,)

PIZZA(PizzaID, PizzaType,)

MEMBEROFSTAFF(StaffID, StaffForename, Staff Surname)

ORDER(OrderID, OrderTime, Orderdate, DeliveryCharge, PizzaQuantity , TotalCost)

dbDamo
01-07-2010, 03:08 AM
How about different pizza sizes?

What about pizza prices - how do you plan to calculate an order total without any prices?

DeliveryCharge - usually free if you spend a certain amount so would need to be calculated, therefore this should be calculated in a query, not stored in a table?

TotalCost - as i've already said should not be stored in a table, it should be calculated in a query

What if a customer wants more than one kind of pizza - how do you plan to deal with this?


Lots of questions to answer - like I said, you need to list every attribute that you will need to store before you even think about entities - start with that