Thanks,
Luis
SQL Cookbook by Anthony Molinaro: http://tinyurl.com/2pgvem
Evan
I hardly think of views as an "advanced topic". But you're entitled to your
opinion.
There are two webistes I can recommend:
http://www.utexas.edu/its-archive/windows/database/datamodeling/dm/overview.html
For an overview to data modeling and database design.
and
http://www.databaseanswers.org/
For about 200 free database designs, covering many common problems. You
will want to revise the design to suit your own requirements.
They have it right here. All non-key attributes must be dependent on the
full key. Only applies to tables with keys composed of multiple columns>
> "The third normal form requires that all columns in a relational table are
> dependent only upon the primary key"
They have it right again. No transitive dependecies. So the problem? Oh yes,
remove the candidate key in this test.
>
> http://www.utexas.edu/its/windows/database/datamodeling/rm/overview.html
> http://www.utexas.edu/its/windows/database/datamodeling/rm/rm1.html
> http://www.utexas.edu/its/windows/database/datamodeling/dm/keys.html
> http://www.utexas.edu/its/windows/database/datamodeling/rm/rm7.html
>
> --
> David Portas
>
>
> Call me picky but I am not entirely comfortable with that U.Texas site,
even
> though it's a commendable effort overall.
>
> "The relational model represents data in the form of two-dimension tables"
> "A relational table is a flat file ..."
> "Primary and foreign keys are the most basic components on which
relational
> theory is based."
> "The definition of second normal form states that only tables with
composite
> primary keys can be in 1NF but not in 2NF"
> "The third normal form requires that all columns in a relational table are
> dependent only upon the primary key"
>
I'm not entirely comfortable with it myself, and I had found some of the
same things you quoted. I still recommend it. I'm looking for something
that's better. when I find it, I'll recommend that.
No. There may be dependencies where the left side is empty. But it's a
common mistake. If I remember correctly, one of my database textbooks
"proves" that any relvar with just two attributes is automatically in BCNF.
--
Jon
In that case the declared candidate key is not really a candidate
key. Under the assumption that the declared candidate keys are indeed
candidate keys, the claim is correct.
> But it's a
> common mistake. If I remember correctly, one of my database textbooks
> "proves" that any relvar with just two attributes is automatically in BCNF.
Under the assumption that I just mentioned, that claim is actually
also correct.
-- Jan Hidders
I'm really confused by the above. First off, if there were a dependency
where the left side is empty, wouldn't the same value have to exist the
dependent column, for all of the rows?
That's not true, Jan, consider:
{A, B, C} | A --> B /\ {} --> C
If {} --> C holds, then A --> C also holds.
Since A --> B /\ A --> C, then A --> BC.
{{A:1, B:2, C:1}
{A:2, B:4, C:1}
{A:3, B:4, C:1}
{A:4, B:3, C:1}}
Clearly A is the only candidate key, even though the FD {} --> C holds.
Indeed, I stand corrected.
-- Jan Hidders
Yes. But as Brian correctly pointed out, what I said in the above was
wrong. In fact my remark about binary relations in BCNF is also not
correct. For example R(A,B) with FD {}-->B is not in BCNF. Not my day,
apparently. :-(
-- Jan Hidders
The case already mentioned by Jon is one exception to the statement about
2NF.
Normalization is concerned with candidate keys not just primary keys, so the
definitions are necessary conditions but not sufficient ones.
--
David Portas
> --
> David Portas
>
>