Database & Data Handling (NCCIA) MCQs
1999 MCQs is category mein available hain.
All MCQs in Database & Data Handling (NCCIA)
281 What does AVG(Salary) do with NULL salaries?
Explanation
- AVG ignores NULL values entirely.
- If NULLs were counted as zero the average would be wrongly lowered.
Last verified on 27-11-2026
282 If all values in a column are NULL, what does SUM(column) return?
Explanation
- SUM of only NULL values returns NULL because there is no value to add.
- COUNT(column) in that case returns 0.
Last verified on 27-11-2026
283 Which statement about NULL in a FOREIGN KEY column is correct?
Explanation
- A NULL foreign key is usually allowed and means no parent is linked yet.
- Only a non-NULL foreign key must match an existing parent.
Last verified on 27-11-2026
284 What does the expression ‘Aadi’ || NULL return in standard SQL string concatenation?
Explanation
- Concatenating any string with NULL yields NULL in standard SQL.
- Some systems differ, so use COALESCE to guard the value.
Last verified on 27-11-2026
285 Which function in SQL Server returns a replacement when a value is NULL?
Explanation
- SQL Server provides ISNULL(value, replacement) for this purpose.
- COALESCE is the standard portable equivalent.
Last verified on 27-11-2026
286 What does NULLIF(10, 10) return?
Explanation
- NULLIF returns NULL when its two arguments are equal.
- NULLIF(10, 20) would return 10.
Last verified on 27-11-2026
287 Why should NULL not be used to mean ‘not applicable’ and ‘unknown’ interchangeably?
Explanation
- NULL carries only one meaning in SQL, so mixing meanings makes queries ambiguous.
- Use a separate status column if the distinction matters.
Last verified on 27-11-2026
288 In three-valued logic, how many truth values does SQL use?
Explanation
- SQL uses three-valued logic: TRUE, FALSE and UNKNOWN.
- NULL comparisons produce UNKNOWN.
Last verified on 27-11-2026
289 Which constraint ensures that an employee’s department ID exists in the Department table?
Explanation
- A foreign key on DepartmentID referencing Department ensures the department exists.
- UNIQUE alone does not check another table.
Last verified on 27-11-2026
290 Which attribute can NEVER be a candidate key?
Explanation
A candidate key must uniquely identify each row, so an attribute that allows NULLs and duplicates can never be one.
Last verified on 27-11-2026