Hello,
I have 3 tables: Packages, Products and Services:
create table dbo.Packages (
Id int identity not null
Name nvarchar (80) not null
)
create table dbo.Products (
Id int identity not null
Name nvarchar (80) not null
)
create table dbo.Services (
Id int identity not null
Name nvarchar (80) not null
)
I need to relate the 3 tables to fulfill the following requirements:
- A package consists of a mix of products and services;
- All products can be included in a package;
- Not all services can be included in a package;
- A product or service can be included in many packages;
- A product or a service cannot appear twice in the same package.
I am not sure how to build this scheme specially because of (3) and (5).
Probably I will need Table inheritance, Many to Many relationship and some kind of Index for (5)?
Could someone, please, advice me on this?
Thank You,
Miguel