473,480 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Foreign key refer to unique constraint????

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
3 11179
> 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
> 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6344
by: Luc Martineau | last post by:
Hello When we create a table, what is the difference between the REFERENCE constraint on column and the FOREIGN KEY constraint on table ? I guess that the FOREIGN KEY constraint assures us...
10
42377
by: Bodza Bodza | last post by:
I'm having an argument with an incumbent self-taught programmer that it is OK to use null foreign keys in database design. My take is the whole point of a foreign key is that it's not supposed...
31
3331
by: Robert Brown | last post by:
Let's say I have a type hierarchy: (just an example) the general entity customer: CREATE TABLE customer(customer_id int, customer_name varchar(250), customer_type int) three specific...
4
3154
by: teddysnips | last post by:
This is a rather abstract question about data design, but I ask it here because a) the database is SQL Server, and b) you're such a learned bunch! Let's assume the classic relation of Customers...
0
1418
by: Scott Ribe | last post by:
I've got a problem which I think may be a bug in Postgres, but I wonder if I'm missing something. Two tables, A & B have foreign key relations to each other. A 3rd table C, inherits from A. A...
1
3762
by: ken_knee | last post by:
I have a PARENT/CHILD I'm attempting to attach another CHILD to. When I try to add a FOREIGN KEY to the 3rd table referring to CHILD1 (AGTERNS), I get error SQL0573N A column list specified in the...
5
2480
by: Bob Stearns | last post by:
For good and sufficient reasons I wish to insure that a primary key of table 1 is not a primary key of table 2. The following does not work: ALTER TABLE IS3.AUCTION_SUPER_CATEGORIES ADD...
3
174
by: KULJEET | last post by:
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...
0
3001
by: Frank Swarbrick | last post by:
So we're trying to decide if it's better to use IDENTITY columns or sequences to create a surrogate key as the primary key for our tables. I kind of like the identity column, because it's more...
0
7054
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6750
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4493
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3003
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2993
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
567
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.