Passage from the E/R model to the relational model

We pass the data we have in the entity-relationship model to tables.

To pass all the data to tables without leaving anything and for the tables to make sense on their own we have to follow a few steps:

  • Every entity is transformed into a table
  • every attribute becomes a column within the table to which it belongs
  • The entity identifier becomes the primary key of the table
  • Every N:M relationship becomes a table that will have as primary key the two primary keys of the entities that are associated
  • In 1:N relationships, the primary key of the entity with cardinality 1 is passed to the table of the entity whose cardinality is N
  • In N:M relationships there are three possibilities: If the cardinality is (0,1) in both entities, a table is created. While if the cardinality of one is (0,1) and the other is (1,1) the primary key of (1,1) is usually passed to that of (0,1). If the cardinality of both is (1,1), the key of either of them is passed to the other.

For this entity-relationship model, the step to tables would be as follows:

I recommend that you practice going to tables, since it is an extremely important factor when it comes to building your database for the web.

See also  Map types in Google Maps
Loading Facebook Comments ...
Loading Disqus Comments ...