PDA

View Full Version : key constraint


Jian Xu
04-14-01, 02:43
i'm doing a database project, and met one question about the key constraints. what the question asked is simply " Drop key constraint from the table Cust_Order relation." i just dropped the primary key constraint for that relation, but i'm confused with the "not null" constraint. do i need to drop that constraint also? does any one familiar with the key constraint definition to help me ? the relation definition below:

Table name : Cust_Order
primary key : OrderID OrderID integer 4 n
OrderDate Date y
CustomerID int 4 n

here 'y' means can be null, n means can be not null. the first column is attribute name and the second is data type accordingly.

tks and rgs
jxu

Jan Hidders
04-14-01, 06:06
Not neccesarily. The question is why you are dropping the key constraint. Is it for efficiency reasons or did you make a conceptual mistake in your data model? In the first case the not-null should definitely stay, in the second case you simply have to rethink if they may be null or not.

Jan Hidders