Database & Data Handling (NCCIA) MCQs
1999 MCQs is category mein available hain.
All MCQs in Database & Data Handling (NCCIA)
761 Why is referential integrity enforced by the DBMS rather than only by application code?
A
Because application code is always faster
B
Because the DBMS has no other work to do
C
Because foreign keys cannot be checked in code
D
Because the DBMS enforces it for every application and direct data change, preventing bypasses
Explanation
Database-level constraints apply consistently even if data is changed by another program, a script or a direct SQL command, while application checks can be bypassed.
Last verified on 27-11-2026
762 Which constraint enforces referential integrity in SQL?
A
FOREIGN KEY
B
UNIQUE
C
CHECK
D
PRIMARY KEY
Explanation
A FOREIGN KEY constraint links a column to the primary key of another table and the DBMS rejects values with no match.
Last verified on 27-11-2026
763 A foreign key column is allowed to be NULL. What does a NULL foreign key mean?
A
The row violates referential integrity
B
The row is not linked to any parent row yet, which is permitted
C
The parent row has been deleted
D
The row must be deleted
Explanation
A null foreign key means no parent is assigned, which is allowed when the relationship is optional, and it does not point to a non-existent parent.
Last verified on 27-11-2026
764 Which integrity rule is violated if a primary key column contains a NULL?
A
Domain integrity
B
Referential integrity
C
Entity integrity
D
User-defined integrity
Explanation
Entity integrity states that a primary key can never be null, because a null cannot uniquely identify a row.
Last verified on 27-11-2026
765 Which integrity rule is violated if an Order references a CustomerID that does not exist?
A
Entity integrity
B
Key integrity
C
Domain integrity
D
Referential integrity
Explanation
A foreign key with no matching parent breaks the link between tables, which is a referential integrity violation.
Last verified on 27-11-2026
766 What is domain integrity?
A
The rule that values in a column must be of the correct type, format and allowed range
B
The rule that a primary key must be unique
C
The rule that foreign keys must match
D
The rule that tables must be normalised
Explanation
Domain integrity restricts each column to valid values, for example age must be a number in a sensible range.
Last verified on 27-11-2026
767 A table has a primary key on (StudentID, CourseID). A new row has StudentID 12 and CourseID NULL. What happens?
A
The row is accepted because StudentID is unique
B
The row is rejected because part of a composite primary key is null
C
The row is accepted if CourseID is later filled
D
The row is stored as a duplicate
Explanation
No part of a primary key may be null, so a composite key with any null component violates entity integrity.
Last verified on 27-11-2026
768 When choosing a primary key, which property is most important?
A
That it is easy to remember
B
That it is long and descriptive
C
That it is unique, stable and never null
D
That it can be changed often
Explanation
A primary key must identify each row uniquely, stay unchanged, and always have a value, otherwise identification and joins fail.
Last verified on 27-11-2026
769 Which attribute is NOT a good natural key for an Employee table?
A
National identity card number
B
Passport number
C
Employee's home address
D
Official employee code issued by the organisation
Explanation
An address can change, can be shared by several people, and is not guaranteed unique, so it fails as a key.
Last verified on 27-11-2026
770 What is the main risk of using a phone number as a primary key?
A
Phone numbers are always numeric
B
Phone numbers cannot be used in joins
C
Phone numbers are too long for indexing
D
Phone numbers can be changed, shared or reassigned
Explanation
A phone number may change ownership or be reused, so rows linked to it would point to the wrong person after reassignment.
Last verified on 27-11-2026