joins

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gazeatvara
    New Member
    • Mar 2007
    • 6

    #1

    joins

    Hi every one

    Pl look into the situation

    Tables
    Product(maker, model, type)
    PC(code, model, speed, ram, hd, cd, price)
    Laptop(code, model, speed, ram, hd, screen, price)
    Printer(code, model, color, type, price)


    requirement:

    Define the maximal price of PC produced by each maker.
    Result set: maker, maximal price.

    thanks in advance
  • michaelb
    Recognized Expert Contributor
    • Nov 2006
    • 534

    #2
    The two links below should give you everything you need to write this query.

    Table Expressions

    Joins between Tables

    Comment

    • gazeatvara
      New Member
      • Mar 2007
      • 6

      #3
      Originally posted by michaelb
      The two links below should give you everything you need to write this query.

      Table Expressions

      Joins between Tables
      Hi michale

      wats wrong with this

      select maker,max(price ) from product natural join pc group by 1;

      Comment

      • michaelb
        Recognized Expert Contributor
        • Nov 2006
        • 534

        #4
        Your requiremens says:
        Define the maximal price of PC produced by each maker.
        but you are joining tables on model.

        It seems you need to work on your schema....
        Table PC, for example has no field that can be used to identify a maker.

        Comment

        Working...