MCQs > IT & Programming > SQL >

Assuming there are multiple rows in the 'Commission_Agents' table with entries for commission agents from different departments, what is the error in the following query:

SELECT name, department_id, commission_percentage from Commision_Agents 

WHERE commission_percentage = (SELECT min(commission_percentage)  FROM Commision_Agents GROUP BY department_id);

SQL MCQs

Assuming there are multiple rows in the 'Commission_Agents' table with entries for commission agents from different departments, what is the error in the following query:

SELECT name, department_id, commission_percentage from Commision_Agents 

WHERE commission_percentage = (SELECT min(commission_percentage)  FROM Commision_Agents GROUP BY department_id);

Answer

Correct Answer:

You cannot use '=' operator as the sub-query is returning multiple results 

Explanation:

Note: This Question is unanswered, help us to find answer for this one

SQL Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

SQL Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it