October 21st, 2003, 11:26 PM
I need help on SQL queries pleaseee
I am writing some queries based on the “PUBS” database that come shipped with the MS SQL Server and I think I have just about fully stretched the limits of my two week old knowledge in SQL. I will list the questions below. I will really appreciate any help.
1) List the title, publisher name and price for all titles that have a price higher than the average price of all titles from that publisher.
(I know this requires correlated queries but I don’t fully understand it yet)
2) List the title ID and number of sales involving each title. If a title has not had any sales yet, the number of sales should be shown as zero.
(I think an outer join will do the trick, but I’m just not getting the right results)
3) List the title ID, title of all titles along with the order number and order date of any sales that involve each title. Your results MUST include titles that do not have any sales yet. Put the list in order of title, and then order date.
October 22nd, 2003, 01:06 AM
October 22nd, 2003, 06:59 PM