Hi @lakshmipravallika ,
To create a many to many relationship between table's (schema's) in adobe campaign you need to create an relationship (intermediate) table where you can store the relationship.
A relationship table will be linked 1:N with each table and this will let you link two tables with cardinality N-N.
The best example of such linking is between OOTB tables "Groups" (nms:group) and "Recipients" (nms:recipient) where "Recipient list contents" (nms:rcpGrpRel) is the relationship table.
Source schema of the nms:rcpGrpRel table:
<srcSchema entitySchema="xtk:srcSchema" genAccessors="false" img="nms:rcpgroup.png"
implements="xtk:persist" label="Recipient list contents" labelSingular="Recipient lists content"
md5="B44333B9AA70F65A87AD3BE34FC9AC9B" name="rcpGrpRel" namespace="nms"
xtkschema="xtk:srcSchema">
<element img="nms:rcpgroup.png" name="rcpGrpRel" pkgStatus="never">
<!-- The index starts by iGroupId since we execute often SELECT iRecipientId ... WHERE iGroupId= -->
<key internal="true" name="id">
<keyfield xlink="rcpGroup"/>
<keyfield xlink="recipient"/>
</key>
<dbindex name="recipientId">
<keyfield xpath="@recipient-id"/>
</dbindex>
<element integrity="neutral" label="Recipient" name="recipient" revDesc="Lists to which the recipient belongs"
revIntegrity="own" revLabel="Lists" target="nms:recipient" type="link"/>
<element integrity="neutral" label="List" name="rcpGroup" revDesc="Recipients in the list"
revIntegrity="own" revLabel="Recipients" revLink="rcpGrpRel" target="nms:group"
type="link">
<join xpath-dst="@id" xpath-src="@group-id"/>
</element>
<attribute label="Foreign key of link 'List' (field 'id')" name="group-id" type="long"/>
</element>
</srcSchema>
Br,
Shubham