10 Sqlqueries
10 Sqlqueries
___________________________________________________________________________________
________
4) Find the names of the clients who have purchased 'Trousers'.
mysql> SELECT DISTINCT SO.CLIENT_NO, CM.NAME FROM SALES_ORDER_DETAILS SOD,
SALES_ORDER SO, PRODUCT_MASTER PM, CLIENT_MASTER CM WHERE PM.PRODUCT_NO =
SOD.PRODUCT_NO AND SO.ORDER_NO = SOD.ORDER_NO AND CM.CLIENT_NO =
SO.CLIENT_NO AND DESCRIPTION ='TROUSERS';
+-----------+---------------+
| CLIENT_NO | NAME |
+-----------+---------------+
| C00003 | CHHAYA BANKER |
+-----------+---------------+
1 row in set (0.00 sec)
___________________________________________________________________________________
___
__________
5) List the products and orders from customers who have orderd less than 5 units of
'Pull
Overs'