By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,011 Members | 2,967 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,011 IT Pros & Developers. It's quick & easy.

Foreign key refer to unique constraint????

P: n/a
foreign key also refer to unique constraint.
(GREAT...)

1.then table that containt unique constraint act as master table?????
2.IS unique constraint will replace with primary key??
3.Is unique constraint gives all fuctionality as primary key constraint???

thanks
kuljeet pal singh
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
> foreign key also refer to unique constraint.
(GREAT...)

1.then table that containt unique constraint act as master table?????
Yes.
2.IS unique constraint will replace with primary key??
3.Is unique constraint gives all fuctionality as primary key constraint???


The only diference between PK and UK (besides built-in indexes) is
that UK can contain NULLs, whereas PK cannot. A given table could
contain many rows with a NULL in the UK column (this is, the
'uniqueness' affects only NOT NULL columns).

Regards.

Carlos.
Jul 19 '05 #2

P: n/a
> foreign key also refer to unique constraint.
(GREAT...)

1.then table that containt unique constraint act as master table?????
Yes.
2.IS unique constraint will replace with primary key??
3.Is unique constraint gives all fuctionality as primary key constraint???


The only diference between PK and UK (besides built-in indexes) is
that UK can contain NULLs, whereas PK cannot. A given table could
contain many rows with a NULL in the UK column (this is, the
'uniqueness' affects only NOT NULL columns).

Regards.

Carlos.
Jul 19 '05 #3

P: n/a
ku***********@hotmail.com (KULJEET) wrote in message news:<fe**************************@posting.google. com>...
foreign key also refer to unique constraint.
(GREAT...)

1.then table that containt unique constraint act as master table?????
2.IS unique constraint will replace with primary key??
3.Is unique constraint gives all fuctionality as primary key constraint???

thanks
kuljeet pal singh


Yes, a FK can refer to a UK or a PK. This is desirable as some table
will have both a PK and UK on them and it may be necessary to validate
against both.

If this bothers you
What is the difference between a unique index and a unique constraint?
http://www.jlcomp.demon.co.uk/faq/uk_idx_con.html

HTH -- Mark D Powell --
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.