视图
视图的作用
select cust_nam.id e,cust_contact from customers c join order o on c.cust_id=o.cust join on o.order_num=oi.order_num where prod_id='TNT2';
视图的规则和限制
使用视图
创建视图
create view view_productcustomer as select cust_nam.id e,cust_contact from customers c join order o on c.cust_id=o.cust join on o.order_num=oi.order_num where prod_id='TNT2';
使用视图
select * from view_productcustomer ;
更新视图
create view view_orderitemexpandec as select product_id,quantity,item_price,quantity * item_price as expanded_price from orderitems;