Relational Databases

8 important questions on Relational Databases

How can a binary 1:1 relationship type be mapped?

Create two relations: one for each entity type participating. The connection can be made by including a foreign key in one of the relations to the primary of the other. In case of existence dependency declare the foreign key NOT NULL. The attribute types of the relation can be added to the relation with the foreign key.

How can a binary 1:N relationship type be mapped?

By including a foreign key in the relation corresponding to the participating entity type at the N-side of the relationship.
The foreign key refers to the primary at the 1 side. Depending upon the minimum cardinality, the foreign key can be declares as NOT NULL or NULL allowed. The attribute types of the relation can be added to the one with the foreign key

How can unary relationship types be mapped?

A recursive 1:1 or 1:N relationship can be implemented by adding a foreign key referring to the primary key of the same relation. For N:M recursive relationship type, a new relation R needs to be created with two NOT NULL foreign keys referring to the original relation
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart

How can n-ary relationship types be mapped?

We have to create relations for each participating entity type. Then define one additional relation R to represent the n-ary relationship type and add foreign keys referring to the primary keys of each of the relations corresponding to the participating entity types. The primary key of R is the combination of all foreign keys which are all NOT NULL. Attributes of the relationship can also be added to R.

How can multivalued attribute types be mapped?

For each multivalued type we create a new relation R. The multivalued attribute type in R together with a foreign key referring to the primary key of the original relation. Multivalued composite attribute types are decomposed into their components. Primary key can be set based upon the assumptions.

How can a weak entity type be mapped?

Should be mapped into a relation R with all its corresponding attribute types. Foreign key must be added referring to the primary key of the relation corresponding to the owner entity type. Foreign key is declared as NOT NULL bc of existence dependency. Primary key of R then the combination of the partial and the foreign key.

Overview ER vs Relational model?

Entity = Relation
Weak entity = Foreign key
1:1 or 1:N = Foreign key 
M:N = new relation with 2 foreigns
N-ary = new relation with N foreigns
Simple attribute = attribute
Composite attribute = component attribute
Multivalued attribute = Relation and foreign
Key attribute = primary or alternative

Add type or key at end of words :))

How can an EER specialization be mapped?

3 options
- create a relation for the superclass and each subclass and link them with foreign keys
- create a relation for each subclass and none for the superclass
- create one relation with all attribute types of the super and subclasses and add a special attribute type.   

LOOK AT SLIDES/VID FOR FURTHER EXPLANATION. Slides sucken a niffo

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo