Subject / 929 questions

Programming MCQs

Page 33 of Programming multiple-choice questions with answers. Tap an option to check yourself.

Page 33 of 47

Advertisement
Question 648 DBMS and SQL

What makes a subquery a correlated subquery?

Correct answer D. It refers to a column of the outer query, so it is evaluated for each outer row

Open question
Advertisement
Question 653 DBMS and SQL

Table Dept(id, name) has rows (10,’HR’), (20,’IT’), (30,’Ops’). Table Emp(id, name, dept_id) has rows (1,’Ali’,10), (2,’Sara’,20), (3,’Omar’,20), (4,’Zara’,NULL). SELECT d.name, COUNT(e.id) FROM Dept d LEFT JOIN Emp e ON e.dept_id = d.id GROUP BY d.name ORDER BY d.name; Which result is produced?

Correct answer C. (HR, 1), (IT, 2), (Ops, 0)

Open question
Advertisement