programming-examples/sql/View/6. Write a query to create a view that shows for each order the salesman and customer by name.sql
2019-11-18 14:05:53 +01:00

6 lines
303 B
SQL

/*6. Write a query to create a view that shows for each order the salesman and customer by name.*/
CREATE VIEW nameorders
AS SELECT ord_no, purch_amt, a.salesman_id, name, cust_name
FROM orders a, customer b, salesman c
WHERE a.customer_id = b.customer_id
AND a.salesman_id = c.salesman_id;