Keys

Question 1
Consider the following statements S1 and S2 about the relational data model:
S1: A relation scheme can have at most one foreign key.
S2: A foreign key in a relation schema R cannot be used to refer to tuples of R.
Which one of the following choices is correct?  
A
S1 is false and S2 is true.
B
Both S1 and S2 are false.
C
Both S1 and S2 are true.
D
S1 is true and S2 is false.
Question 1 Explanation: 
  • A database table may have more than one foreign key, and each foreign key can have a different parent table. Hence, the statement I is incorrect.
  • A foreign key is a set of attributes in a table that refers to the primary key of another table or to the primary key of the same table (self-referential table). Hence, the statement II is also incorrect.
Question 2

A super key for an entity consists of

A
one attribute only
B
At least two attributes
C
at most two attributes
D
one or more attributes
Question 2 Explanation: 
Super key is a set of attributes of a relation schema upon which all attributes of the schema are functionally dependent. It can consist of one or more attributes.
For example : Consider a relation R(A,B,C,D) where “A” is the candidate key of “R” then Superkeys of “R” will be {A,AB, AC, AD, ABC, ABD, ACD, ABCD}.
Question 3

A primary key for an entity is

A
A candidate
B
Any attribute
C
A unique attribute
D
A super key
Question 3 Explanation: 
A primary key for an entity is a candidate key.
Question 4

A ___ is the combination of one or more column values in a table that make a row of data unique within the table

A
Foreign key
B
Natural key
C
Candidate Key
D
Primary Key
Question 4 Explanation: 
CANDIDATE KEY is a set of attributes that uniquely identify tuples in a table. Candidate Key is a super key with no repeated attributes. The Primary key should be selected from the candidate keys. Every table must have at least a single candidate key. A table can have multiple candidate keys but only a single primary key.
There are 4 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access