Database & Data Handling (NCCIA) MCQs
1999 MCQs is category mein available hain.
All MCQs in Database & Data Handling (NCCIA)
651 What is a dangling reference?
Explanation
A dangling reference is an orphan link left when a parent is removed without updating its children, which referential integrity prevents.
Last verified on 27-11-2026
652 Which design prevents dangling references?
Explanation
Enforced foreign keys with CASCADE, SET NULL or RESTRICT ensure a parent delete cannot leave child rows pointing nowhere.
Last verified on 27-11-2026
653 A company has a self-referencing Employee table. The CEO has ManagerID NULL. What does this show?
Explanation
In a self-referencing hierarchy, the top person has no manager, so a null ManagerID marks the root.
Last verified on 27-11-2026
654 How would you find all employees who report directly to manager 10?
Explanation
Direct reports are rows whose ManagerID equals the manager's EmployeeID, so filtering on ManagerID = 10 returns them.
Last verified on 27-11-2026
655 How would you find all managers in an Employee table?
Explanation
Managers are the employees whose IDs appear as a ManagerID, so distinct non-null ManagerID values list them.
Last verified on 27-11-2026
656 What is the main challenge of querying a deep self-referencing hierarchy, such as all levels below a manager?
Explanation
Each level is another self-join, so finding all descendants at unknown depth requires recursion, such as a recursive common table expression.
Last verified on 27-11-2026
657 What is a composite foreign key?
Explanation
When the parent key has several columns, the foreign key must have the same number of columns in the same order to match it.
Last verified on 27-11-2026
658 What must exist before a foreign key can be created?
Explanation
A foreign key can only reference a primary key or a unique key that already exists in the parent table.
Last verified on 27-11-2026
659 What data types must a foreign key and its referenced primary key have?
Explanation
A foreign key stores copies of primary key values, so its type and size must match the referenced key or the link cannot work reliably.
Last verified on 27-11-2026
660 Can a foreign key reference a UNIQUE column instead of a primary key?
Explanation
SQL allows a foreign key to reference any candidate key, which includes a UNIQUE column, because it still identifies one parent row.
Last verified on 27-11-2026