From the following tables, write a SQL query to find those salespeople who generated orders for their customers but not located in the same city
- برمجة سي كيو ال sql
- 2021-09-01
- mhanasmh00489829403
الأجوبة
SELECT ord_no, cust_name, orders.customer_id, orders.salesman_id
FROM salesman, customer, orders
WHERE customer.city <> salesman.city
AND orders.customer_id = customer.customer_id
AND orders.salesman_id = salesman.salesman_id;
Output of the query:
ord_no cust_name customer_id salesman_id 70004 Geoff Cameron 3009 5003 70003 Geoff Cameron 3009 5003 70011 Jozy Altidor 3003 5007 70001 Graham Zusi 3005 5002 70007 Graham Zusi 3005 5002 70012 Julian Green 3008 5002
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال