Company: Q2 Software
Difficulty: medium
Enrolled Students: The Query That Fails DBMS - SQL Query Formulation The following item is from the technical (DBMS / SQL) section of the Q2 SDE on-campus online assessment. Choose the single best option. Question 1 Consider the schemas Students(rollno, name) and Enrolled(rollno, courseno). You want to find the names of all students who are enrolled in courseno = 1470. Which of the following SQL query formulations will produce a different result from the others, or fail to execute correctly due to syntax / structural constraints? A. SELECT s.name FROM Students s WHERE SIZEOF (SELECT * FROM Enrolled e WHERE e.courseno = 1470 AND e.rollno = s.rollno) > 0 B. SELECT s.name FROM Students s NATURAL JOIN Enrolled E WHERE E.courseno = 1470 C. SELECT s.name FROM Students s WHERE EXISTS (SELECT * FROM Enrolled E WHERE E.courseno = 1470 AND E.rollno = s.rollno) D. SELECT s.name FROM Students s WHERE 0 < (SELECT COUNT(*) FROM Enrolled E WHERE E.courseno = 1470 AND E.rollno = s.rollno) Option