时间:2021-07-01 10:21:17 帮助过:19人阅读
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