• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Composite primary key question

 
M Burke
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With this senario, I am thinking that only D is incorrect. Because A alone cannot define the key. C may be wrong, but I think it depends on the value of B. I assume if a FK can be null, but it's a composite, that it would be invalid if one part of the key is null and the other is not. What do you think?

Which of the following statement(s) is/are not True __d______:
In relation R ( A, B, C, D, E ) , A and B together are defined as primary key, S ( X, A, B, Y, Z) is another relation, and the A and B in relation S are the same attributes A, B correspondently in R.
a. As A and B are defined as primary key in R, so the values of A and B in R cannot be null.
b. Attribute A in R itself cannot be null.
c. Attribute A in S may be null.
d. A in S can be defined as foreign key reference to A in R.
e. A and B in S together can be defined as foreign key reference to A and B in R.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is this question from? I hope not from a real actual cert exam. We do not allow real questions to be posted and they do get deleted.

Thanks for understanding.

Mark
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mark Spritzler:
We do not allow real questions to be posted and they do get deleted.

Mark


Hmmm.. I didn't know such a law is present here.

Considering that this is not a real exam question,

'B' and 'C' can be true. D is not possible. That violates the derivative of 2NF. Having a foreign key which refers to part of a composite primary key is not advisable. (Now where did the smiley which shakes it's index finger go...)
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arun Kumarr:


Hmmm.. I didn't know such a law is present here.



Yes, especially with Sun's Certified tests. Some people try to post real questions and we don't like that. It is infringing on people's copyrights, and we consider it cheating.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic