Can anybody help me? I want to set constraint to my database for example:
- First entity is
Triangle
(Triangle_Id, Name, Side_size) - Second entity is
Square
(Square_Id, Name, Side_size) - Third entity is
Area
(Area_Id, ObjectId, Area_value) - Fourth entity is
Circle
(Circle_Id, Name, Radius)
How can I add constraints from entities Triangle
and Square
to Area
that I am unable to write any other type of objects in ObjectId
column except triangle or square?
I tried to write come FK constraints, but have had an error.
- FK_Area_Triangle_ObjectId (area_ObjectId == triangle_Id)
- FK_Area_Square_ObjectId (area_ObjectId == square_Id)