, 查询生产最高速度的计算机(PC或便携式电脑)厂商,查询结果按照厂商升序排列。
select distinct maker
from (
select maker,speed
from pc,product
where pc.model=product.model
union
select maker,speed
from laptop,product
where laptop.model=product.model
) a
where a.speed in (
select max(speed)
from (
select speed
from pc,product
where pc.model=product.model
union
select speed
from laptop,product
where laptop.model=product.model
) b
);
**询具有最低价格的的彩色打印机的制造商 **
本题目要求编写SQL语句, 查询具有最低价格的的彩色打印机的制造商。
select distinct maker
from product
where type='打印机' and model in (
select model
from printer
where color=1 and price<=all(
select price
from printer
where color=1
)
);
查询所有出售便携式电脑(而不出售PC机)的生产厂商
select distinct maker
from product,laptop
where product.model=laptop.model and maker not in (
select maker
from product,pc
where product.model=pc.model
);
查询净资产至少200万美元的所有行政长官
select MovieExec.name
from MovieExec
where netWorth>200 and certID in(select presCertID from Studio )