LAB 4:    Using SQL - Advanced Queries


1.    Display the stock name of all stock in portfolios managed by manager M2
    a)    using a join
    b)    using a subquery

2.    Display the stock name of all stock purchased during September of 1998
    a)    using a join
    b)    using a subquery

3.    Display the portfolio number of the portfolio that has the holding with the largest number of shares in it

4.    Display the portfolio number of the portfolio that has the holding with the largest current value (number shares x current price)

5.    Display the stock name of all stock that is in portfolio P001 but not in portfolio P005
        a)    using IN/NOT IN
        b)    using MINUS

6.    List all stock (stock symbol, name and current price) of all stock not included in any portfolio
        a)    using NOT IN
        b)    using an outer join

7.    For all stock in the Stock table, list the stock symbol, stock name and the total value (current price x number shares) of the stock in all holdings

8.    For each portfolio in the Portfolio table, list the portfolio number and total shares held in that portfolio;  only include portfolios with more than two holdings