Sqlite3, the practice in Wikipedia:

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.