List of salesmen who have at least one customer with a purch

List of salesmen who have at least one customer with a purchase amount over $10,000 along with the maximum purchase amount of their customers.

Sample table: salesmar sale sman id name city commi83ion 5001 5002 5005 5006 5003 5007 ame 3 Hoog Nail Knite pit Alex Mc Lyon Lauson Hen Paul Adam New York Paris London Paris Rome Sample table: customer customer id customer name citv arade salesman id 3002 3005 3001 3004 3007 3009 3008 3003 Nick Rimando New York Graham Zusi Brad Guzarn Fabian Johns Brad Davis Geoff Camero Berlin Julian Green London Jozy Altidor Moncow 5001 5002 California 200 London Paris New York 300 5006 5002 5007 200 Sample table: oraer order no purch amt order datecustomer idsalesman ia 70001 70009 70002 70004 70007 5002 2016-10-05 2016-09-10 2016-10-05 2016-08-17 2016-09-10 2016-07-27 2016-09-1O 2016-10-10 2016-10-10 2016-06-27 2016-08-17 2016-04-25 3005 3001 3002 3009 3005 3007 3002 3004 3009 3008 3003 3002 270. 65 5001 70008 70010 70003 70012 70011 70013 2400. 6 5760 1983. 43 2480. 4 250.45 5002 5001 5001 5006 5002 5007 5001 3045. 6

Solution

Select salesman.name,Max(order.purch_amt) from salesman inner join customer on salesman.salesman_id= customer.salesman_id inner join order on customer.customer_id = order.customer_id where order.purch_amt>10000;

List of salesmen who have at least one customer with a purchase amount over $10,000 along with the maximum purchase amount of their customers. Sample table: sal

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site