Week 2 Revision Flashcards
What is inheritance?
The process by which a lower level entity set inherits all the attributes and relationship participation of the higher level entity set to whcih it is linked
What are some benefits of inheritance?
<ul>
<li>Avoids duplication of data</li>
<li>Allows relationships between similar types of entities to be represented</li>
</ul>
What does the completeness constraint specify?
Whether an entity in the superclass entity set must belong to at least one of the entity sets within a generalization
What are the two types of constraint inheritance?
Total
Partial
Describe total inheritance
An entity MUST belong to one of the subclass entity sets
Describe partial inheritance
An entity need not belong to one of the subclass entity sets, can be a member of the superclass
What does the inheritance constraint specify?
Constrinat on whether or not entities may belong to more than one subclass entity set within a single generalization
What are the two types of inheritance?
Overlapping
Disjoint
What is overlapping inheritance?
An entity can belong to more than one subclass
What is disjoint inheritance?
An entity can belong to at most one suclass
What are some ER design decisions that need to be made at the modelling stage?
<ul> <li>Entity set vs attribute</li> <li>Etity set vs relationship set</li> <li>Placement of attribute on entity set or relationship set</li> <li>Use of n-ary relationship set vs multiple binary</li> <li>Strong vs weak entity set</li> <li>Specalisation</li> </ul>
When would you use an entity set over an attribute?
When you want/need to store additional information aboyt that field i.e. mobile number
When would you use a relationship set over an entity set?
If all the relationships leading from an entity set are complete (have to participate) and are described using generic verbs such as ‘has’
Where is an attribute of a many to many relationship placed?
On the relationship set
Where is an attribute of a one to many relationship set placed?
On the relationship set or the many side entity set
Where is an attribute of a one to one relationship set placed?
On the relationship set or in either entity set
Even though it’s possible, what is a reason for not replacing any n-ary relationship set with binary relationship sets?
An n-ary relationship set shows more clearly that several entities participate in a single relationship
What are some alternatives to subclasses?
<ul>
<li>Use an attribute to distinguish between groups</li>
<li>Use relationships and roles to distinguish between groups</li>
</ul>
When could you use an attribute instead of subclasses?
When subclasses have no attributes or relationships (fiction vs non fiction)
When could you use roles instead of subclasses?
<ul>
<li>Potential subclasses have the same attributes</li>
<li>Specalisation would be overlapping</li>
<li>Relationships with potential subclasses are optional</li>
</ul>
What are the four steps in the simple modelling methodology?
<ol>
<li>Decide what entity sets are required</li>
<li>For each entity set, decide on attributes</li>
<li>Decide on relationships between entity sets</li>
<li>Decide on generalisation/specialisation</li>
</ol>
What does cardinality deal with?
Maximum times they can participate
What does participation deal with?
Minimum times they can participate