1.查询所有speed大于2.8的PC信息
select *
from pcs
where speed > 2.8
2.查询购买model为1007的购买记录信息
select *
from sales
where model = 1007
3.统计2013-12-20购买记录的数量(count)
select count(*)
from sales
where sday=to_date('2013-12-20', 'yyyy-mm-dd')
4.统计2013-12-20购买的总数量(sum)
select sum(quantity)
from sales
where sday = to_date('2013-12-20', 'yyyy-mm-dd')
5.查询硬盘大小出现在两种以上PC电脑上的硬盘大小
select hd
from pcs
group by hd
having count(*) >= 2;
6.查询速度至少3.00以上的PC models信息
select model
from pcs
where speed >= 3.00;
7.查询哪个供应商供应laptops硬盘至少100GB以上的供应商信息
(1)等值连接
select products.*
from products, laptops
where products.model=laptops.model and laptops.hd >= 100;
(2)自然连接(natural join)
sele