From the following tables, create a view to get the salesperson and customer by name
- برمجة سي كيو ال sql
- 2021-09-02
- mhanasmh00489829403
الأجوبة
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;
output:
sqlpractice=# SELECT * sqlpractice-# FROM nameorders sqlpractice-# WHERE name = 'Mc Lyon'; ord_no | purch_amt | salesman_id | name | cust_name --------+-----------+-------------+---------+---------------- 70010 | 1983.43 | 5006 | Mc Lyon | Fabian Johnson 70015 | 322.00 | 5006 | Mc Lyon | Varun (2 rows)
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال