SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    May 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Many to Many SQL Questions

    Could someone help me answer these please. Thanks!

    2) TRUE or FALSE: You can create a database table with MM relationships.

    3) When you resolve a MM by creating an intersection entity, this new entity will always inherit:
    a) The attributes of both related entities.
    b) A 1-1 from original M-M.
    c) The UID's from the original 2 entities.
    d) Nothing is inherited from the original entities and relationship.

    4) Which of these terms does not describe the table that you created to resolve a MM?
    a) Intersection
    b) Junction
    c) Union
    d) Bridge
    e) All of these terms describe the table that you created to resolve a MM.

    5) If an intersection table has only 2 FK, each of which is related to the PK in each table, then
    a) You must include additional columns in the intersection that are duplicates from the other tables.
    b) You need another FK to normalize the intersection.
    c) You will use DDL to insert new data.
    d) None of the above.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    2) TRUE or FALSE: You can create a database table with MM relationships.

    this is false -- MM relationships melt in your hand, not in your mouth

    3) When you resolve a MM by creating an intersection entity, this new entity will always inherit:
    a) The attributes of both related entities.

    no, it inherits only from the father, the mother's attributes are recessive

    b) A 1-1 from original M-M.

    no, once you've gone M-M, you can never go 1-1

    c) The UID's from the original 2 entities.

    sorry, UID's are absolutely ineffective in preventing STD's

    d) Nothing is inherited from the original entities and relationship.

    that's not true either, you always inherit their predelictions (how can you tell a boy chromosome from a girl chromosome? pull down their genes)

    4) Which of these terms does not describe the table that you created to resolve a MM?
    a) Intersection

    yes, but the intersection had better have a traffic light

    b) Junction

    yes, you can always see a junction at Union Station

    c) Union

    no, you never see a union at Petticoat Junction

    d) Bridge

    sometimes, but bridges are very costly, partial dentures are a lot cheaper

    e) All of these terms describe the table that you created to resolve a MM.

    no, sorry, none of the above describe my table

    5) If an intersection table has only 2 FK, each of which is related to the PK in each table, then
    a) You must include additional columns in the intersection that are duplicates from the other tables.

    this is not true -- they don't have to be unique and you can include additional columns from elsewhere as well

    b) You need another FK to normalize the intersection.

    some intersections will never be normal, and will need constant care for the rest of their lives

    c) You will use DDL to insert new data.

    that's silly, everyone knows you have to use DIL (data insertion language) to insert data

    d) None of the above.

    no, some of the above


    good luck on your assignment, and remember, if you get an "A" you owe me a couple beer

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha

  4. #4
    SitePoint Member
    Join Date
    May 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I still need legit answers, please.

  5. #5
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perhaps a better way of asking people to do your homework for you would be to explain why you don't understand each question, or post the answers you've already got for each question and ask what's missing. Nobody on this forum is going to just answer your list of questions for you without you putting any of the work in yourself.

  6. #6
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SJH View Post
    Perhaps a better way of asking people to do your homework for you would be to explain why you don't understand each question, or post the answers you've already got for each question and ask what's missing. Nobody on this forum is going to just answer your list of questions for you without you putting any of the work in yourself.
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast

  7. #7
    SitePoint Enthusiast taichimaster's Avatar
    Join Date
    Jul 2007
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by questionaskeroct View Post
    Could someone help me answer these please. Thanks!

    2) TRUE or FALSE: You can create a database table with MM relationships.

    3) When you resolve a MM by creating an intersection entity, this new entity will always inherit:
    a) The attributes of both related entities.
    b) A 1-1 from original M-M.
    c) The UID's from the original 2 entities.
    d) Nothing is inherited from the original entities and relationship.

    4) Which of these terms does not describe the table that you created to resolve a MM?
    a) Intersection
    b) Junction
    c) Union
    d) Bridge
    e) All of these terms describe the table that you created to resolve a MM.

    5) If an intersection table has only 2 FK, each of which is related to the PK in each table, then
    a) You must include additional columns in the intersection that are duplicates from the other tables.
    b) You need another FK to normalize the intersection.
    c) You will use DDL to insert new data.
    d) None of the above.
    2) False. While you can join on a single table you need three tables - including an intersection table - to do a many to many relationship. The intersection table maintains the relationships. The new entity could simply be a count function, in which case it inherits nothing from the original entities. Or it could inherit the attributes of the corresponding tables.

    3) The intersection entity inherits the attributes of the columns in the related tables.

    4) Union

    5) D

    Hope this helps.

  8. #8
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by taichimaster View Post
    Hope this helps.
    Doing someone's homework for them is guaranteed to NOT help longterm since it means that they don't learn what the homework was intended to teach.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  9. #9
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by taichimaster View Post
    ... you need three tables - including an intersection table - to do a many to many relationship.
    no, this is not quite true

    i can build you a many-to-many relationship with only two tables

    and please don't do people's homework for them, thanks

    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
  •