CBSE Class 12 Informatics Practices Question 83 of 91

JOINS and SET Operations — Question 19

Back to all questions
19
Question

Question 19

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 from city 'JAMMU'.

Answer
SELECT s.name
FROM Salesman s, Customer c  
WHERE s.salesman_id = c.salesman_id AND (c.grade = 200 AND c.city = 'JAMMU');