Wednesday, February 24, 2010

vision of Scenario

^^^^^^^^^^^^^Scenario^^^^^^^^^^^^^^^^
The sales manager at a bookstore has been instructed by the top management to encourage high quantity purchasers to achieve the sales targets for the year. From the data on the sales made in the past, the manager has identified that the maximum quantity purchased by a customers who have bought 500 books in a single purchase. The manager also wants you to add the names of the books sold. The data required to generate the output is available in the customers, sales, and titles tables. Refer to the table structures in Appendix A for a description of the table columns.
^^^^^^^^^^^^^Topic D: ^^^^^^^^^^^^^^^^

SELECT partnum, bktitle, custname, address FROM titles, customers
WHERE 500 IN
(SELECT qty FROM sales
WHERE sales.partnum = titles.partnum
AND sales.custnum = customers.custnum)

No comments:

Post a Comment