CS FundamentalsHardCapgemini · Cognizant GenC
A(k) holds 1, 2, 3 and B(k, v) holds (1, NULL), (2, 5). How many rows does SELECT * FROM A LEFT JOIN B ON A.k = B.k WHERE B.v IS NULL return?
- A. 1
- B. 3
- C. 0
- D. 2
Correct answer: D. 2
Key 1 matches B but its v is NULL, so it passes the filter; key 3 has no match, so its v is NULL as well. Key 2 fails. Total 2 rows.
More DBMS and SQL questions
- E(n, sal) holds (a, 10), (b, 20), (c, 30), (d, 40). After UPDATE E SET sal = sal + 10 WHERE sal < (SELECT AVG(sal) FROM E), what is…
- An ER diagram has entities Student, Course and Prof. Student and Course are related by Enrols (many-to-many, with attribute grade). Each…
- T(g, x) holds (a, 1), (NULL, 2), (a, 3), (NULL, 4), (b, 5). How many rows does SELECT g, COUNT() FROM T GROUP BY g return?
- Ed(a, b) holds the edges (1, 2), (2, 3), (3, 1), (3, 4). How many rows does the following return? WITH RECURSIVE p(n, d) AS (SELECT 1, 0…
- The set F = {A -> BC, B -> C, A -> B, AB -> C} on R(A, B, C) is given. How many functional dependencies are there in a minimal (canonical)…
- Basic timestamp ordering is used with timestamps TS(T1) = 1, TS(T2) = 2, TS(T3) = 3. The schedule on one item A is R2(A), W3(A), R1(A)…