SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    May 2004
    Location
    Melbourne
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy need help with a query please!

    Supplier table
    Table Name: S

    S# SNAME STATUS CITY
    --- ------------ ---------- ------------
    s1 Smith 20 London
    s2 Jones 10 Paris
    s3 Blake 30 Paris
    s4 Clark 20 London
    s5 Adams 30 Athens

    Parts table
    Table Name: P

    P# PNAME COLOR WEIGHT CITY
    --- ------------ ------ ---------- ------------
    p1 Nut Red 12 London
    p2 Bolt Green 17 Paris
    p3 Screw Blue 17 Rome
    p4 Screw Red 14 London
    p5 Cam Blue 12 Paris
    p6 Cog Red 19 London

    Project table
    Table Name: J

    J# JNAME CITY
    --- ------------ ------------
    j1 Sorter Paris
    j2 Punch Rome
    j3 Reader Athens
    j4 Console Athens
    j5 Collator London
    j6 Terminal Oslo
    j7 Tape London

    Shipment table
    Table Name: SPJ

    S# P# J# QTY
    --- --- --- ----------
    s1 p1 j1 200
    s1 p1 j4 700
    s2 p3 j1 400
    s2 p3 j2 200
    s2 p3 j3 200
    s2 p3 j4 500
    s2 p3 j5 600
    s2 p3 j6 400
    s2 p3 j7 800
    s2 p5 j2 100
    s3 p3 j1 200
    s3 p4 j2 500
    s4 p6 j3 300
    s4 p6 j7 300
    s5 p2 j2 200
    s5 p2 j4 100
    s5 p5 j5 500
    s5 p5 j7 100
    s5 p6 j2 200
    s5 p1 j4 100
    s5 p3 j4 200
    s5 p4 j4 800
    s5 p5 j4 400
    s5 p6 j4 500

    Those are my 3 tables.

    The question is:

    Get P#'s for parts supplied by more than one supplier or to more than one project.

    could someone please help me create a query for the question above???

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    sounds like homework

    what have you tried, what was your thinking process, what did your query produce?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    May 2004
    Location
    Melbourne
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    sounds like homework

    what have you tried, what was your thinking process, what did your query produce?
    Yes i tried a few SQL statements but nothing seems to work at all.

    am a beginniner to sql, i dunno how to use joins or any special stuff.

    help pls?

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    several excellent SQL tutorials here: SQL Links
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •