Experiment 16-09 in TestDB: Query order "16M DRAM" goods ...

Source: Internet
Author: User

TestDB is the product sales database, please in the TestDB: the query ordered both "16M DRAM" goods, but also ordered "1.2GB HDD" commodity customer number, order number and order amount.

Select DISTINCT Cust_id,b.order_no,tot_amtfrom sales b,product a,sale_item cwhere a.prod_id=c.prod_id and b.order_no = c. Order_no and prod_name = ' 16M DRAM ' andb.  Order_no in (select B.order_no from Product a,sales b,sale_item c where  b.order_no = C.order_no and a.prod_id=c.prod_id and prod_name = ' 1.2GB hdd ')

  

Experiment 16-09 in TestDB: Query order "16M DRAM" goods ...

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.