SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Proper normalization for media with multiple types of owners

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    68
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Proper normalization for media with multiple types of owners

    I am having a hard time deciding on the best way to approach this problem. I am trying to set up an app in rails where users and groups of users can both upload media to albums. The media can be either images or video. I have put together a simple example ERD to show what I have so far https://docs.google.com/file/d/0B8eu...it?usp=sharing.

    1. What would be the best way to normalize this further?
    2. Should I separate the video and images into separate tables all together and not link them to the media table?


    Any suggestions are welcome.

  2. #2
    From Italy with love bronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    8,594
    Mentioned
    76 Post(s)
    Tagged
    4 Thread(s)
    Why do you have separate images and videos tables? Why not add a mediatype column to the media table?

  3. #3
    SQL Consultant silver trophybronze trophy
    SitePoint Award Recipient r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    38,446
    Mentioned
    34 Post(s)
    Tagged
    1 Thread(s)
    for medai, videos, and images, do a search for supertype/subtype

    the videos and images should not have their own PKs, but rather, their PKs should be FKs to the media table
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •