Database & Data Handling (NCCIA) MCQs
1999 MCQs is category mein available hain.
All MCQs in Database & Data Handling (NCCIA)
1021 Which action violates referential integrity?
A
Deleting an unreferenced parent
B
Inserting a row with a NULL primary key
C
Inserting a child row whose foreign key has no matching parent
D
Inserting a row with a duplicate primary key
Explanation
Referential integrity requires every non-NULL foreign key to match an existing parent key, so an unmatched child row violates it.
Last verified on 27-11-2026
1022 A table has a candidate key {PhoneNo}. If PhoneNo can be NULL for some students, can it still be a candidate key?
A
Yes, if only one NULL exists
B
No, a candidate key must not contain NULLs
C
Yes, NULLs are allowed in candidate keys
D
No, because it is not unique
Explanation
A candidate key must uniquely identify every row, and NULL means unknown, so a candidate key cannot contain NULLs.
Last verified on 27-11-2026
1023 Which key type is most suitable as a primary key for a table of books?
A
Author name, which may repeat
B
Price, which may repeat
C
Title, which may repeat
D
ISBN, which is unique for each book
Explanation
ISBN uniquely identifies each book edition, so it is a suitable natural primary key.
Last verified on 27-11-2026
1024 Which key ensures entity integrity?
A
Alternate key
B
Foreign key
C
Secondary key
D
Primary key
Explanation
Entity integrity requires that the primary key is unique and not null, so every row is identifiable.
Last verified on 27-11-2026
1025 Which key type is most suitable as a primary key for a table of citizens?
A
Name, which may repeat
B
City, which may repeat
C
Age, which may repeat
D
National ID, which is unique for each citizen
Explanation
A National ID is unique and non-null for each citizen, making it a suitable primary key.
Last verified on 27-11-2026
1026 Which key ensures referential integrity?
A
Primary key
B
Secondary key
C
Alternate key
D
Foreign key
Explanation
Referential integrity is enforced by foreign keys, which require values to exist in the referenced parent table.
Last verified on 27-11-2026
1027 Why is Name a poor choice for a primary key?
A
It is always numeric
B
It may repeat and may change over time
C
It cannot be indexed
D
It is always unique
Explanation
Names are not unique and can change, so they do not give stable, unique identification.
Last verified on 27-11-2026
1028 What is entity integrity?
A
The rule that all columns are indexed
B
The rule that a primary key must be unique and not null
C
The rule that tables have the same name
D
The rule that foreign keys match parent keys
Explanation
Entity integrity means no primary key value is NULL and no two rows share the same primary key.
Last verified on 27-11-2026
1029 Which statement is TRUE about a primary key and an alternate key?
A
An alternate key is not a candidate key
B
A primary key may contain duplicates
C
An alternate key must be a foreign key
D
Both are candidate keys; the primary key is the chosen one and alternate keys are the rest
Explanation
All candidate keys qualify as identifiers; one is selected as primary and the others become alternate keys.
Last verified on 27-11-2026
1030 In a table with attributes (ID, PassportNo, Email, Name), if ID, PassportNo and Email are each unique and not null, how many candidate keys are there?
A
Three
B
Two
C
Four
D
One
Explanation
ID, PassportNo and Email are each minimal unique identifiers, so there are three candidate keys.
Last verified on 27-11-2026