Computing.Net > Forums > Web Development > Normalization - Please Help!

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Normalization - Please Help!

Reply to Message Icon

Name: Palookaville
Date: December 10, 2005 at 14:16:17 Pacific
OS: XP Pro
CPU/Ram: Athlon 2800+ / 1G
Comment:

I am working on a project for uni (an ecommerce site), but am stuck designing the database. It is a music store, so I know it needs a customer, products and order table. But then I don't know what to do next. I've done this before, but I can't remember. I've looked in a couple of books and online, but it hasn't helped.

For example the table products(product_id, artist, album, song_title) is in 1NF, but what do I do to put it in 2NF, then even 3NF if needed.

If someone knows how to do this, could you talk me through what tables I will need.

Cheers



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: December 11, 2005 at 08:17:52 Pacific
Reply:

Here is an article about database normalization: http://databases.about.com/od/specificproducts/a/normalization.htm

However, just a quick look at what you proposed shows some weaknesses. Are you selling individual songs or albums? This will make a difference. For the sake of argument let's suppose you are selling full albums.

you PRODUCT table should contain (at a minimum) a unique product ID, album name, and ONLY other information that is SPECIFIC to each album. You do not want to include artist or songs - I'll explain why.

An album can contain many songs AND some songs can appear on several albums by different artists. So you would want to have a table for songs that includes song ID and song name. Then you create a cross reference table that ties songs to the albums with columns for songID and albumID. This makes it easy to do a search for all albums with a particular song.

The same logic works for artists. many albums can belong to a single artist and sometimes artists will work on an album together. So you need to have a separate table for artists and then cross reference them with the albums.

Michael J


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Normalization - Please Help!

Please HElP!!!!! www.computing.net/answers/webdevel/please-help/1177.html

Please help me my site has viruses www.computing.net/answers/webdevel/please-help-me-my-site-has-viruses-/2494.html

Please Help With Code www.computing.net/answers/webdevel/please-help-with-code/462.html