programming-examples/sql/View/10. Write a query to create a view that shows the number of the salesman in each city.sql

5 lines
194 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*10. Write a query to create a view that shows the number of the salesman in each city.*/
CREATE VIEW citynum
AS SELECT city, COUNT (DISTINCT salesman_id)
FROM salesman
GROUP BY city;