Last post Sep 19, 2016 09:24 AM by balu.devara
Sep 16, 2016 01:58 PM|sudip_inn|LINK
if possible to establish Many-to-many relation between two table without 3rd table then please show with example. thanks
Sep 19, 2016 08:22 AM|Chris Zhao|LINK
A many-to-many relationship consists of three tables. Below is a schematic view of the many-to-many relationship.
In some cases, you may need multiple instances on both sides of the relationship. For example, each order can contain multiple items. And each item can also be in multiple orders.
For these relationships, we need to create an extra table:
The Items_Orders table has only one purpose, and that is to create a "Many to Many" relationship between the items and the orders.
Sep 19, 2016 08:26 AM|Mikesdotnetting|LINK
if possible to establish Many-to-many relation between two table without 3rd table
Sep 19, 2016 09:24 AM|balu.devara|LINK
you can create structure many to many relation using 2 tables but, you can not insert data into those tables.
create table table1(col1 int primary key,col2 int unique);
create table table2(col2 int primary key,col1 int unique references table1(col1));
alter table table1 ADD FOREIGN KEY(col2) references table2(col2)