CBSE Class 12 Informatics Practices Question 79 of 91

JOINS and SET Operations — Question 15

Back to all questions
15
Question

Question 15

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 display all salesmen and customer located in Chennai.

Answer
SELECT s.name, s.city, c.cust_name, c.city
FROM Salesman s, Customer c 
WHERE s.salesman_id = c.salesman_id AND 
(s.city = 'Chennai' AND c.city = 'Chennai');