products: code, name, price, manufacturer
//黄色是关联。
15. Select the name and price of the cheapest product.
?? :使用嵌套结构,这样能得到所有最便宜的价格的产品,产品价格如果有相同的话。
如果只是写子结构内的代码,只能返回一行。
SELECT Name, Price
FROM Products
WHERE Price = (SELECT MIN(Price) FROM Products);16. Select the name of each manufacturer along with the name and price of its most expensive product.不是非常理解;
SELECT A.Name, A.Price, F.Name FROM Products A INNER JOIN Manufacturers F ON A.Manufacturer = F.Code AND A.Price = ( SELECT MAX(A.Price) FROM Products A WHERE A.Manufacturer = F.Code );
Sqlite3,维基百科中的练习:
标签:family tps man 便宜 san style sqli round sqlite
本文系统来源:https://www.cnblogs.com/chentianwei/p/8158005.html
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!