Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can one to one,many-one mapping be using 1 table.only one-many,many-many requires multiple tables

 
Monica Shiralkar
Ranch Hand
Posts: 842
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please confirm whether my understanding is correct:

one to one mapping: No need for creating more than 1 table. Only in one table it can be shown.
E.g Customer ,Mobile number ........in customer table we can have mobile number.
---One table was involved.

many to one mapping: Again no need for separate tables.just create only 1 table
E.g Customer, Country--------in customer table we can have countryID entry.
---two tables were involved.


one to many: we need separate tables.
E.g Customer,Email.....In Email table we can have customer ID
---2 tables were involved.

many to many: we need separate tables.


So is my conclusion correct that one to one can be shown using just 1 table.but one to many and many to many and many to one can requires separate tables.

thanks

 
Volodymyr Lysenko
Ranch Hand
Posts: 511
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello !

In my understanding mapping is linking two or more tables via foreign and primary keys.
One-to-one means link one primary key in one table to one foreign key in another table.
One-to-many means link one primary key in one table to many foreign keys in another table.
Many-to-one link many foreign keys to one primary key.

To understand all this it is beter to see it once in action!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic