DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Database Relationships

  1. #1
    Join Date
    Jun 2005
    Posts
    2

    Database Relationships

    Why are one-to-many and many-to-many relationships difficult to represent using relational databases as compared to one-to-one or many-to-one relationships. This is something something mentioned in Oracle's TopLink documentation. Just need to know why is this so.

    Thanx & Regards
    Awais.

  2. #2
    Join Date
    Nov 2004
    Location
    Huddinge, Sweden
    Posts
    283
    There's no difference between one-to-many and many-to-one, except perception. It's a matter of from which direction you're looking. Many-to-many are somewhat more difficult to represent simply because relationships are represented by a foreign key in the "many" table that corresponds to a specific primary key of the "one" table. This is usually resolved using an intermediary table that represents two many-to-one relationships.
    One could conceivably model this with a common key between the tables that isn't the primary key, but that would be less flexible.

    Rune
    If you hit a brick wall, you didn't jump high enough!

  3. #3
    Join Date
    Jun 2005
    Posts
    2
    Thanx, that was helpful!

    Cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center