I´m developing a simple software in which a user/employee is able to create new orders for customers. These orders will show which employee is working on the order, who is the customer and what product does the customer want. Since I´m not extremely experienced with databse models, I wanted to ask if this simple representation of my databases is correct considering the database normalization.
Asked
Active
Viewed 82 times
0
-
1What normalization? 123bcnf45? – Grim Sep 08 '17 at 16:34
-
(1) Those are _tables_ not _databases_; (2) looks fairly normalized to me, but Customers and Users seem similar enough they _might_ benefit from some sort of merge/change (but that'll depend on actual context absent from the question and diagram); (3) so an "order" can only have a single "product"? – Uueerdo Sep 08 '17 at 16:54
-
@Uueerdo Thanks for your quick reply. (1) Sry still have problems with the translations, since English is not my first language. (2) I will think about changing this to make them more distinguishable. (3) Yeah you´re right, should be several products. I´d probably need another column in my "order" table. – LukyFoggy Sep 08 '17 at 17:55
-
@PeterRader I was thinking about 1NF, 2NF and 3NF and maybe the BCNF – LukyFoggy Sep 08 '17 at 17:57
-
@LukyFoggy (2) I'm not sure anything needs done with Customers and Users, just something to consider; sometimes it is better to have independent "people" tables (especially if those people are handled very differently). (3) You'll probably want a whole other OrderProducts table instead. – Uueerdo Sep 08 '17 at 18:03
-
@Uueerdo (2) Yeah makes sense. (3) Ok I will look more into this, thank you very much. My biggest concern was, if I used the correct arrows to represent the relation between tables. So if an "order" can only have a single "product", would the current representation be correct? – LukyFoggy Sep 08 '17 at 18:14
-
@LukyFoggy arrows look right as far as I can tell; since there are a few different notations, I usually go by the actual FK's in the tables to be sure anyway. – Uueerdo Sep 08 '17 at 18:17
-
@Uueerdo Ok, this was basically the answer I was looking for, thank you. Since this is the first question I ever asked on stackoverflow, I don´t know really how to mark the question as answered. – LukyFoggy Sep 08 '17 at 18:34
-
What is Customer and what is User? Are they same person? Orders are ussualy purchased by Customers, then who are Users? – Maksym Moskvychev Sep 08 '17 at 22:31
-
@MaksymMoskvychev In this case the user is an employee, who creates the order. So the customer is a person that asks for a certain service, which is then filed by the employee/user to get an overview of all active orders in the company. – LukyFoggy Sep 08 '17 at 23:50
1 Answers
1
Your table design is properly normalized, which means that no information is available twice in multiple locations/tables.
As for a sales system, from experience, it's best to have a Orders
table and an Order_Details
table which will allow you to have multiple products per order
Take the p_id
away from the Orders
table and move it to the new Order_Details
table

Jacques Amar
- 1,803
- 1
- 10
- 12