Https://en.wikibooks.org/wiki/SQL_Exercises/The_computer_store
Two tables connected to each other
Manufactures: code, name
Products:code, name, Price, manufacturer
Yellow is an association.
Select the name and price of the cheapest product.
?? : Use nested structure, so that you can get all the cheapest prices of products, product prices if there is the same.
If you write only the code within the substructure, you can return only one row.
select price from products where price = ( select min ( price ) from products );
A. Select the name of each manufacturer along with the name and price of their most expensive product. Not very understanding; /c1>
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, the practice in Wikipedia: