Loading…
CS Fundamentals · short notes, key points and practice questions.
ER modelling, keys, functional dependencies and normal forms up to BCNF, transactions, ACID, isolation levels, concurrency control, indexing and recovery, together with SQL joins, grouping, subqueries, NULL semantics and window functions. Placement tests ask it as concept questions and as 'what does this query return' on a small table.
x NOT IN (1, NULL) is never TRUE, so it returns no rows – use NOT EXISTSAnswer: A. Unique and NOT NULL
SELECT COUNT(*), COUNT(dept), COUNT(DISTINCT dept) FROM Emp;
Answer: C. 7, 6, 3
SELECT name FROM Emp WHERE dept NOT IN (SELECT dname FROM Dept);
Answer: C. John, Lata
SELECT DISTINCT sid FROM Enroll e
WHERE NOT EXISTS (
SELECT * FROM Course c
WHERE NOT EXISTS (
SELECT * FROM Enroll x
WHERE x.sid = e.sid AND x.cid = c.cid));Answer: D. 3
Answer: B. Atomicity