I have a product table:
ProdId(PK)
Prod1
Prod2
Prod3
Prod4
and Certification table:
Certification(PK):
Cert1
Cert2
Cert3
How do I Model the following relation (pseudo table):
ProdwithCertId(PK) ProdwithCert
ProdwithCert1 "Prod1 with Cert1"
ProdwithCert2 "Prod1 with Cert1, Cert2"
ProdwithCert3 "Prod1 with Cert1, Cert2, Cert3"
ProdwithCert4 "Prod2 with Cert1, Cert2"
ProdwithCert5 "Prod2 with Cert1, Cert2, Cert3"
Cannot have duplicates, e.g. in above table, ProdwithCert6 - "Prod2 with Cert1, Cert2, Cert3" is not allowed
This is the schema.
Now, let’s assume we took the
Prod2in your example above, in this schema it looks like this.