arowa704
-
Posts
1 -
Joined
-
Last visited
Never
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Primary Key and Unique confusion
in MySQL Help
Posted
hi,
AFter reading this paragraph from a book, I got confused:
\"While PRIMARY KEY forbids NULL\'s in the attributes of the key, UNIQUE permits them. Moreover, the rule that two tuples may not agree in all of a set of attributes declared UNIQUEmay be violated if one or more of the components involved have NULL as a value. In fact, it is even permitted for both tuples to have NULL in corresponding attributes of the UNIQUE key.\"
What I got from this:
1) PRIMARY KEY cannot have NULL
2) UNIQUE can have NULL
From Moreover on... is where I got confused.
1) 2 tuples can have NULL in an UNIQUE attribute, which is legal....
Another Question
A Primary Key is Unique indirectly...?
But I\'m assuming those two keywords can never be used together.
Correct me If i\'m wrong. Thanks in advance