Is this properly normalized?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
tdnxxx444
Forum Newbie
Posts: 23
Joined: Wed Mar 08, 2006 5:57 pm

Is this properly normalized?

Post by tdnxxx444 »

Code: Select all

newspaper
-----------------
newspaper_id
title
city
state
editor

book
-----------------
book_id
title
author

comic
-----------------
comic_id
title
artist
Turned into:

Code: Select all

entity
------
entity_id
title

book
-----------------
book_id
entity_id
author

newspaper
----------
newspaper_id
entity_id
city
state
editor

comic
------
comic_id
entity_id
artist
Or is this unncessary? Also, what NF is this in?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Either can work just fine, however the latter is easier to search all titles or display all titles from.

As for what form it is, I've never dug too deeply into caring what form I was using as long as it was as abstracted as I needed it to be for the purposes of now and projected future.
User avatar
sweatje
Forum Contributor
Posts: 277
Joined: Wed Jun 29, 2005 10:04 pm
Location: Iowa, USA

Post by sweatje »

book.author newspaper.editor and comic.artist are not normalized. Any of those could be repeated (author of multiple books, etc.) also, an author of one book could be the editor of another newspaper, etc.
Post Reply