用sql完成如下操作: a. 检索面板类型为“MVA”的显示器的型号、屏幕尺寸和报价。 b. 检索只有一个经销商报价的显示器型号。 c. 在product表中插入一条显示器信息:型号为“三星 S22B360HW”,屏幕尺寸为“22”,面板类型为“TN” d. 从表distributor中删除没有任何报价的经销商信息。 e. 检索 “世纪蓝博”和“华人方创”都有报价的显示器型号 f. 检索对飞利浦的所有型号都有报价的经销商
时间: 2024-04-04 16:35:27 浏览: 93
a. SELECT model, screen_size, price FROM product WHERE panel_type='MVA';
b. SELECT model FROM price GROUP BY model HAVING COUNT(*)=1;
c. INSERT INTO product (model, screen_size, panel_type) VALUES ('三星 S22B360HW', '22', 'TN');
d. DELETE FROM distributor WHERE name NOT IN (SELECT DISTINCT distributor FROM price);
e. SELECT model FROM price WHERE distributor IN ('世纪蓝博', '华人方创') GROUP BY model HAVING COUNT(*)=2;
f. SELECT distributor FROM price WHERE model IN (SELECT model FROM product WHERE manufacturer='飞利浦') GROUP BY distributor HAVING COUNT(*)=(SELECT COUNT(DISTINCT model) FROM product WHERE manufacturer='飞利浦');
阅读全文