Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi Every one,

Thank you all for helping me out these days when ever I was stuck while coding!!
however guys I'm a newbee when it comes to database design and I'm very much interested in learning how it is done. I'm planning to design a sample hotel management database. I am planning to have the following tables in my database.

customer(cust_id,name,address,phone number,country)
hotel:(hotl_id,name,Location,Country)
branches:(brn_id,name,hotl_id)
menu:(slno,dish,price)
bills:(bill_no,Cust_id,price,Supp_id)
booking:(cust_id,brn_id,checkin_date.Checkout_date)
staff(Staff_id,name,salary,shift,hid)


The problem that I'm facing is I do not know how to normalize these tables. I do not even know if they are normalized. Could any one help me with this?

I would appreciate if some one could tell me how to draw an ER diagram for this.

I thought to relate customer to hotel and hotel to branch then staff to each hotel and then bills to customers. However I do not know if that is correct.

I also want to know how can one understand if a table is in normalized form(1st 2nd or 3rd etc).

Thanks in Advance
Posted
Updated 22-Feb-14 8:13am
v2

1 solution

I will try to answer as much as I can. But please know that what you are asking is a huge subject in itself and needs months to study, practice and master. You may want to start by just doing a google and learn about how to design tables, databases and entity relationships. There are plenty of tutorials online for free as well as videos on youtube.

The table schema that you have outlined seem to be normalized enough. You can read about normalization and its advantages online[^]. Again there are plenty of tutorials for free. Please try not to understand every Normal Form straightaway, as they take a bit of time and experience to really make sense. It is okay to learn slowly.

Regarding diagrams: Do not confuse between a Table schema diagram[^] with an ER diagram[^]. They are totally different things and sometimes used synonymously by people who don't understand them. For your purpose a Table Schema diagram is what you are looking for.

Free tools such as Goodle Draw[^], Gliffy[^] and Lucid Chart/[^] can come really handy if you don't have MS Visio.

[Please accept/up-vote answers or solutions that work for you to encourage participation]
 
Share this answer
 
v2
Comments
shrav007 25-Feb-14 0:39am    
could you please specify an online learning site for normalization .... it would be of great help...
thanks.
CoderPanda 25-Feb-14 0:48am    
Well, I will google it the way you would, so not much difference there. And it is better you try out some because what I like may not be really of your choice. We all have different paces of learning.
However, one thing that I would strongly recommend is look at videos than just blogs. YouTube videos would be a better source to learn IMO.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900