TechVani
EXAM TRAPS

5 DBMS traps that cost marks

Each one looks right in the exam hall. Each one is wrong. Swipe to check all five.

TRAP 1 / 5

Does marks = NULL find rows where marks is unknown?

NO
NULL is not a value, so comparing anything with = is never true. Write marks IS NULL instead.
TRAP 2 / 5

Does a NATURAL JOIN follow your foreign keys?

NO
It matches only same-named columns. If no names match, you silently get every row pair. Prefer an explicit JOIN ... ON.
TRAP 3 / 5

Can WHERE filter groups after GROUP BY?

NO
WHERE filters rows before grouping. To filter the grouped result - for example departments with COUNT(*) > 5 - use HAVING.
TRAP 4 / 5

Is a non-key column depending on another non-key column a 2NF violation?

NO
That is a 3NF (transitive dependency) problem. 2NF fails only when a non-key column depends on part of a composite key.
TRAP 5 / 5

Does UNION keep duplicate rows?

NO
UNION removes duplicates; only UNION ALL keeps them. If an exam answer needs every row, the keyword is UNION ALL.
TechVani

Want the full worked notes?

Keys, ER diagrams, SQL queries, relational algebra and normalization, explained with tested examples.

Read the free DBMS notes
techvaniai.blogspot.com