Database & Data Handling (NCCIA) MCQs
1999 MCQs is category mein available hain.
All MCQs in Database & Data Handling (NCCIA)
791 Why is a person’s name a poor choice as a primary key?
A
Names are too long to store
B
Names are always in different languages
C
Names cannot be indexed
D
Names are not unique and can change
Explanation
Two people can share the same name and a person can change their name, so a name fails the uniqueness and stability requirements of a key.
Last verified on 27-11-2026
792 Why is an email address often a risky natural key?
A
Users may change their email address and an address can be reused later
B
Email addresses are case-sensitive only
C
Email addresses are too short
D
Email addresses cannot be stored in a database
Explanation
An email can change or be reassigned, so using it as a key risks broken links and duplicate identities over time.
Last verified on 27-11-2026
793 Which statement about natural keys is correct?
A
They are always generated by the system
B
They are formed from attributes with real-world meaning
C
They can never be used as a primary key
D
They are always numeric
Explanation
A natural key uses attributes that already have meaning in the real world, such as a CNIC or ISBN.
Last verified on 27-11-2026
794 A library uses ISBN as the primary key of its Book table. What type of key is this?
A
Surrogate key
B
Foreign key
C
Natural key
D
Composite key
Explanation
ISBN is a real-world identifier printed on every book, so it is a natural key rather than a system-generated one.
Last verified on 27-11-2026
795 A hospital replaces a patient’s national ID with an internal PatientID number. What has it done?
A
It has removed the primary key
B
It has normalised the table to 3NF
C
It has created a foreign key
D
It has replaced a natural key with a surrogate key
Explanation
An internal PatientID has no meaning outside the hospital system, so it is a surrogate key replacing the natural national ID.
Last verified on 27-11-2026
796 Which key is generally preferred when the natural key is long, such as a 20-character product code?
A
Surrogate key, because a short numeric key is faster to join and index
B
Natural key, because it is meaningful
C
Composite key, because it is more secure
D
Foreign key, because it links tables
Explanation
A short numeric surrogate key makes joins and indexes smaller and faster than a long text natural key, while the product code can remain a unique attribute.
Last verified on 27-11-2026
797 When should a natural key be preferred over a surrogate key?
A
When the key is likely to change frequently
B
When the natural value is short, stable and universally unique
C
When the table has no other attributes
D
When the database is very small
Explanation
A short, stable and truly unique natural value, such as a country code, is simple and meaningful and needs no extra column.
Last verified on 27-11-2026
798 What happens if a surrogate key is used but the natural identifier is not kept unique?
A
The table will have no primary key
B
The foreign key will fail automatically
C
Duplicate real-world entities can be entered without detection
D
The table cannot be indexed
Explanation
Without a UNIQUE constraint on the natural identifier, the same person or product can be inserted twice under different surrogate keys.
Last verified on 27-11-2026
799 What is a natural key in a database table?
A
A key made from data that already has meaning in the real world
B
A key generated by the system with no business meaning
C
A key that can contain null values in its main column
D
A key that is always made of two or more columns
Explanation
A natural key uses an existing meaningful attribute, such as a CNIC number or ISBN, to identify a row.
Last verified on 27-11-2026
800 If a foreign key is set to ON UPDATE CASCADE, what happens when a parent primary key value changes?
A
Child foreign keys become NULL
B
All matching child foreign key values change to the new value
C
The update is blocked
D
Child rows are deleted
Explanation
UPDATE CASCADE propagates a parent key change to every referencing child row.
Last verified on 27-11-2026