Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Do I need to normalise?

  • 05-05-2011 10:43PM
    #1
    Registered Users, Registered Users 2 Posts: 1,266 ✭✭✭


    I'm creating a database which has items and lists. A list can have many items and an item can be on many lists. In my design I had

    a table for items: (item_id, description, quantity)
    a table for lists: (list_id, description)
    a junction table: (list_id, item_id)

    But I'm wondering if having just one table: (list_id, list_description, item_description, quantity)

    and having the repeating list_id and list_description would outweigh the creation of two extra tables?

    Does anyone have any ideas? This is for a college project, so I'm wondering should I just stick to what we did in college and just create the three normalised tables?


Comments

  • Registered Users, Registered Users 2 Posts: 3,357 ✭✭✭snappieT


    You almost certainly want the normalised tables for a college project. Ordinarily, you denormalise only for performance when reading (only need to read from one table), but you want to avoid writing to a denormalised table because of the necessity to update values in multiple locations.


Advertisement