SQL exam question

  • Exam question looks like:

    Order (orderNumber, OrderDate, CustomerCode)

    Product(productNumber, Description, UnitPrice)

    OrderLine (orderNumber, ProductNumber, QuantityOrdered)

    Wrte SQL queries corresponding to the following user requirements:

    1. provide a list of product descriptions of those products on orderNumber 3.

    2. for the customer with customerCode 4, list all the orders for that customer along with all the product details.

    3.assuming it is possible for us to have an order in the system for no products, list the OrderNumbers for those orders in the system which are for no products.

    4. List the products that have not been ordered at all.

    5. For all orders, display the OrderNumber and the TotalQuantity of all products on the order.

    Please help

  • What do you have so far?

    p.s. this isn't a SQL certification exam question, is it?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • No its from a conversion course. Sorry I missed a lot so trying to catch up for the exam.

    I Have:

    Q1. SELECT Order

    FROM OrderNumber 3;

    Q2. SELECT Order, Product

    FROM CustomerCode, Description

    Where Customer 4;

  • I suggest you go and have a chat with the lecturer/teacher and get the material that you missed and work through it. Neither of those is at all correct. Topics to specifically ask about: Joining tables, Where clause filters.

    (No, I'm not going to give you the answers, I don't need the practice)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • rara007 (5/21/2014)


    No its from a conversion course. Sorry I missed a lot so trying to catch up for the exam.

    So how did you get a copy of this exam question?

    Supposedly, you need this course to pass whatever you've enrolled in. My recommendation would be to ask for an "out" on this course and retake it when you actually have the time to learn it properly.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I agree with Jeff and Gail. You either need to have a chat with your prof or you need to request to audit this course or drop it and try to take it at another time when you have the time to devote to learning it properly.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply