Starting from:

$25

CSE111-Lab 4 Solved

Write SQL statements for the following queries on the TPCH database:

1.      Print the total amount of money (o totalprice) spent on orders by each customer from FRANCE.

2.      Return the number of suppliers in each country.

3.      How many orders are posted by customers in each country in EUROPE?

4.      How many parts with size below 20 does each supplier from BRAZIL sell?

5.      Find the number of orders posted by each customer from GERMANY in 1995.

6.      How many parts produced by each manufacturer (p mfgr) are ordered at each order priority?

7.      How many orders do customers in each country in ASIA have in each order status?

8.      Print the number of orders completed in 1995 by the suppliers in each country in AMERICA (see orders.orderstatus; F stands for complete).

9.      How many different clerks did the suppliers in RUSSIA work with?

10.   Find the maximum discount for each type of items having ECONOMY in their type name.

11.   Find the supplier(s) with the largest account balance in every region.

12.   What is the maximum account balance for the suppliers in each region?

13.   How many distinct orders are between suppliers in EUROPE and customers in CANADA?

14.   List the total value (l extendedprice) of all the lineitems sold between any two regions. Print the supplying region, the customer region, and the total value.

15.   How many orders involve a customer with negative balance and a supplier with positive balance?

More products