7-1 表的加减法
什么是集合运算
集合在数据库领域表示记录的集合(表、视图和查询的执行结果)
集合运算就是对满足同一规则的记录进行的加减等四则运算
表的加法——UNION(并集)
create table product2(
product_id char(4) primary key,
product_name varchar(100) not null,
product_type varchar(32) not null,
sale_price int,
purchase_price int,
regist_date date
);
insert into product2
values
('0001','T恤','衣服',1000,500,'2008-09-20'),
('0002','打孔器','办公用品',500,320,'2009-9-11'),
('0003','运动T恤','衣服',4000,2800,null),
('0009','手套','衣服'