Keys in DBMS MCQ - General Knowledge Question and Answer

Keys in DBMS MCQ - Question and Answer

Primary Key: A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table.
Super Key: A superkey is a set of one or more columns (attributes) to uniquely identify rows in a table.
Candidate Key: A super key with no redundant attribute is known as a candidate key
Alternate Key:  Out of all candidate keys, only one gets selected as primary key, remaining keys are known as alternate or secondary keys.
Composite Key:  A key that consists of more than one attribute to uniquely identify rows (also known as records & tuples) in a table is called composite key.
Foreign Key: Foreign keys are the columns of a table that points to the primary key of another table. They act as a cross-reference between tables.

Which one of the following attribute can be taken as a primary key?  


Name
Street
Id
Department

Answer:

The attributes name, street, and department can repeat for some tuples. But the id attribute has to be unique.So it forms a primary key.

Share Me:

A _____ is a property of the entire relation, rather than of the individual tuples in which each tuple is unique.  


Rows
Key
Attribute
Fields

Answer:

Key is the constraint which specifies uniqueness.

Share Me:

The subset of super key is a candidate key under what condition?  


No proper subset is a super key
All subsets are super keys
Subset is a super key
Each subset is a super key

Answer:

The subset of a set cannot be the same set.Candidate key is a set from a super key which cannot be the whole of the super set

Share Me:

Consider attributes ID , CITY and NAME . Which one of this can be considered as a super key?  


NAME
ID
CITY
CITY , ID

Answer:

Here the id is the only attribute which can be taken as a key. Other attributes are not uniquely identified.

Share Me:

Which one of the following is a set of one or more attributes taken collectively to uniquely identify a record?  


Candidate key
Sub key
Super key
Foreign key

Answer:

Super key is the superset of all the keys in a relation.

Share Me:

A _________ integrity constraint requires that the values appearing in specified attributes of any tuple in the referencing relation also appear in specified attributes of at least one tuple in the referenced relation.  


Referential
Referencing
Specific
Primary

Answer:

A relation, say r1, may include among its attributes the primary key of another relation, say r2. This attribute is called a foreign key from r1, referencing r2. The relation r1 is also called the referencing relation of the foreign key dependency, and r2 is called the referenced relation of the foreign key.

Share Me:

The ______ is the one in which the primary key of one relation is used as a normal attribute in another relation.  


Referential relation
Referencing relation
Referenced relation
Referred relation

Answer:

Referenced relation

Share Me:

The relation with the attribute which is the primary key is referenced in another relation. The relation which has the attribute as primary key is called  


Referential relation
Referencing relation
Referenced relation
Referred relation

Answer:

Referencing relation

Share Me:

A attribute in a relation is a foreign key if the _______ key from one relation is used as an attribute in that relation .  


Candidate
Primary
Super
Sub

Answer:

The primary key has to be referred in the other relation to form a foreign key in that relation.

Share Me:

Which one of the following cannot be taken as a primary key ?  


Id
Register number
Dept_id
Street

Answer:

Street is the only attribute which can occur more than once.

Share Me:

The situation where the lock waits only for a specified amount of time for another lock to be released is  


Lock timeout
Wait-wound
Timeout
Wait

Answer:

The timeout scheme is particularly easy to implement, and works well if transactions are short and if longwaits are likely to be due to deadlocks.

Share Me: