Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Write a SQL statement to prepare a list with salesman name, customer name and

ID: 3607405 • Letter: 1

Question

1. Write a SQL statement to prepare a list with salesman name, customer name and their cities for the salesmen and customer who belongs to the same city Salesman salesman_id name city commission 5001 5002 5005 5006 5003 5007 James Hoog New York 0.15 Nail Knite Paris Pit Alex London Mc Lyon Lauson Hen Paul Adam Rome 0.13 0.11 0.14 0.12 0.13 Paris Customer customer_id cust_name city grade salesman_id 3002 Nick Rimando New York 100 5001 3005 Graham Zusi California 200 5002 3001 Brad Guzan London 3004 Fabian Johns Paris 300 5006 3007 Brad Davis New York 200 5001 3009 Geoff Camero Berlin 100 5003 3008 Julian Green London 300 5002 5005

Explanation / Answer

Solution:

SQL Statement:

SELECT Salesman.name, Customer.name, city FROM Salesman INNER JOIN Customer ON Salesman.salesma_id = Customer.salesman_id WHERE Salesman.city = Customer.city.

the above query will do the job, it will fetch the name of the customers and the salesmen who belong to the same city.

I hope this helps, if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote