【数据库查询--计算机、电脑系列】--查询由生产厂商B生产的所有产品的型号(model) 和价格(price)。
分析:这道题将四个表全部涉及到了,所以这时应想到一个方法:union的使用提示:查询按照pc、laptop和printer的顺序进行。上代码:select model,pricefrom (select model,pricefrom pcunionselect model,pricefrom laptopunionse...
·
分析:这道题将四个表全部涉及到了,所以这时应想到一个方法:union的使用
提示:查询按照pc、laptop和printer的顺序进行。
上代码:
select model,price
from (
select model,price
from pc
union
select model,price
from laptop
union
select model,price
from printer
)as a
where model in (
select model
from product
where maker='B'
);

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐
所有评论(0)