You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
programming-examples/sql/View/8. Write a query to create ...

9 lines
330 B
SQL

/*8. Write a query to create a view that finds the salesman who has the customer with the highest order at least 3 times
on a day.*/
CREATE VIEW incentive
AS SELECT DISTINCT salesman_id, name
FROM elitsalesman a
WHERE 3 <=
(SELECT COUNT (*)
FROM elitsalesman b
WHERE a.salesman_id = b.salesman_id);