CBSE Class 12 Informatics Practices Question 82 of 91

JOINS and SET Operations — Question 18

Back to all questions
18
Question

Question 18

Consider following tables to answer below question :

Salesman (salesman_id, name, city, commission ) and

Customer (customer_id, cust_name, city, grade, salesman_id )

Write an SQL query to list all the salesmen who have customers with grade 200 or higher.

Answer
SELECT s.name
FROM Salesman s, Customer c  
WHERE s.salesman_id = c.salesman_id AND c.grade >= 200;