programming-examples/sql/View/13. Write a query to create a view that shows all matches of customers with salesman.sql
2019-11-18 14:05:53 +01:00

6 lines
348 B
SQL

/*13. Write a query to create a view that shows all matches of customers with salesman such that at least one customer in the
city of customer served by a salesman in the city of the salesman.*/
CREATE VIEW citymatch(custcity, salescity)
AS SELECT DISTINCT a.city, b.city
FROM customer a, salesman b
WHERE a.salesman_id = b.salesman_id;