学习
练习题1
创建出满足下述三个条件的视图(视图名称为 ViewPractice5_1)。
使用 product(商品)表作为参照表,假设表中包含初始状态的 8 行数据。
create view ViewPractice5_1 (product_name,sale_price,regist_date) as select product_name,sale_price,regist_date from product where sale_price >= 1000 and regist_date = '2009-09-20';
练习题2
向习题一中创建的视图 ViewPractice5_1 中插入如下数据,
会得到什么样的结果呢?
Field of view 'shop.ViewPractice5_1' underlying table doesn't have a default value
练习题3
请根据如下结果编写 SELECT 语句,其中 sale_price_all 列为全部商品的平均销售单价。
product_id | product_name | product_type | sale_price | sale_price_all
------------+-------------+--------------+------------+-----------------