Informatics Practices
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 do not have customers in 'DELHI' and 'JAMMU'.
SQL Joins & Grouping
1 Like
Answer
SELECT s.name
FROM Salesman s
WHERE s.salesman_id NOT IN (
SELECT DISTINCT c.salesman_id
FROM Customer c
WHERE c.city IN ('DELHI', 'JAMMU')
);
Answered By
1 Like
Related Questions
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.
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 distinct salesman and their cities.
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.
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'.