This is a question about storing nulls (or not), and two answers that do a very good job answering the use of nulls are:
- What to do with null values when modeling and normalizing?
- Database: Can I have nullable attributes in a third normal form database?
Let's say I want to store a list of movies that are stored on iTunes. For simplicity, we'll just store a few fields so that the film Avatar has these values:
- ID: 354112018
- Name: Avatar
- Year: 2009
- Synopsis: "From Academy Award®-winning director James Cameron comes Avatar, the story..."
However, sometimes the Synopsis is missing, such as: https://itunes.apple.com/be/movie/id437975371 and sometimes the Year is missing, especially for future or tentative-releases, such as: https://itunes.apple.com/au/movie/id1598491343.
Without giving it a second thought, I would probably create one table to store those four fields, something like this:
- ID (INT)
- Name (VARCHAR)
- Year (INT NULL)
- Synopsis (VARCHAR NULL)
Is there any advantage in 'further normalizing' the database so that, for example, I don't store any null values, such as:
Title
- TitleID
- Name
TitleSynopsis
- TitleID
- Synopsis
TitleYear
- TitleID
- Year
To me it seems like doing this would potentially create hundreds of extra tables (on a large database) and make inserts a nightmare -- I suppose a View could be created to flatten out the results so it's queryable, but even though I feel like it would require so much overhead. So is there any reason in the above case to normalize to remove nulls, or in general, what would be the case to do so, if there ever is one?