Results 1 to 2 of 2

Thread: key constraint

  1. #1
    Jian Xu Guest

    Question key constraint

    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

  2. #2
    Jan Hidders Guest
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •