user3515624
user3515624

Reputation: 11

Confusion over functional dependencies

I'm currently taking a course in relational Databases, and i cant quite understand functional dependencies to find the proper Primary Key.

Here is my table: D = {P, Q, R, S, T, U, V, W, X, Y, Z}

here are my set of functional dependencies:

{P, R} --> {Q, T, U}

{T} --> {S}

{V, W} --> {X, Z}

{X} --> {Y}

Could someone shed some light on how to find the primary Key for D?

Upvotes: 1

Views: 98

Answers (1)

You figured it out; {PRVW} is the only candidate key for D.

But you should know that functional dependencies don't determine "the proper Primary Key". Instead, functional dependencies determine the set of candidate keys. There's often more than one candidate key.

There's no formal, logical basis for saying, "This candidate key is clearly the primary key, and none of the other candidate keys qualify." But there are often practical reasons for choosing one over the other. For example, narrower keys take less space in indexes, which generally corresponds to faster performance. So, as a purely practical matter, it sometimes makes sense to make the narrowest candidate key the primary key. But, again, that's a practical matter, not a formal, logical matter.

Upvotes: 1

Related Questions