Need some advice designing my database

Discussion in 'Servers and Control Panels' started by Panupat, Dec 31, 2011.

  1. Panupat

    Panupat Habitué

    1,561
    342
    +86
    This database is mainly for recording "items". Here's my condition

    I create a project.

    In each projects are many episodes.
    In each episodes are many shots.
    In each shots are many items.

    Episode can only be under 1 project.
    Same as shots which will be under 1 episode
    and items which will only be under 1 shot.

    Users can choose filters to list the items. Like this

    Choose project --> load list of available episodes
    choose episode --> load list of available shots

    The user can choose only project alone to show all items under it, or choose episode too, or choose shot too.

    In this case, which table design would be more appropriate? Top or bottom?
     

    Attached Files:

    1
  2. xMog

    xMog Neophyte

    3
    1
    +0
    The top one.

    The second one is not logical (if you compare it to the "real life" model) and you have duplicate keys. To manage duplicate keys, you'll have to add more code if you want to write an admin panel to enter your data, for example.

    And the first one is more suitable for future evolution and is easier to understand.
     
Verification:
Draft saved Draft deleted