Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL 1. List the customers with the two smallest discounts Use Not Exists 2. List customers that didn' t have any orders (Hint: use NOT

image text in transcribed

SQL

1. List the customers with the two smallest discounts Use Not Exists

2. List customers that didn' t have any orders (Hint: use NOT IN).

3. List the name each customers and the total amount ordered by the customers

If the customers didnt place an order, list them also. (see Functions, Group By and Outer Join)

4. List name of customers that ordered all the products. (Animating SQL through Procedural Code Basic, Division)

5. List all pair of products that are in the same city (Join with 1 table)

PRODUCTS CUSTOMERS cid cecity c01 TipTop Duluth 10.00 002 Basics Dalla12.00 e003 Allied Dalas 8.00 004 ACME Duluch 8.00 c006 ACME Kyoto 0.00 pnanecity quantity price disent p01cmbDallas400 0.50 p02 | brush | Newark | 203000 0.50 p03 azor Duluth 150600 100 p04 | pen | Duluth | 125300 1.00 pOS pencil Dallas 221400 1.00 p06 folder Dalias 123100 2.00 p07 case Newark 100500 1.00 ORDERS AGENTS 1011 0001 0 40.00 1012 an c0 p01100045000 1019 | feb e001. | a02 P02 400 180.00 1017 feb 006p03600540.00 1018 eb 00103 600 40.00 1023 m 001 04 500 450.00 1022 marp6720.00 1025 | apr | c001 | a05 | p07 |.800 | 720.00 | 1013. | jan | c002 | .03 | p03 1000 | 880.00 1026mayp3 704.00 1015 an c003.03 pOS 1200 1104.00 1014 jan 03pOS 12001104.00 1021 eb00406 p1 1000 460.00 1016 | jan | c006 a011 pol 1000 500.00 1020feb00603 600600.00 1024 mar c006 06 p 800400.00 percent 01 Smith New York 6 02 Jones Newark 03 rown Tokyo 04 Gray New York a06 Smith Dallas

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions