Elda Backa February 2016

Difference between entities and relations in databases

I want to know if an entity is just a table in the database modelling context? And which is the difference between an entity and a relation? I know that the relation is the base concept of relational databases and has tabular presentation. Are the entity and the relation the same thing? Note: Do not confuse the relation with the relshionship.

Answers


Jacotdv February 2016

An entity is somting like an object, you can put a name to an entity. A relation is a "link" beetwen entity, you can put a verb to an entity, in your MCD of your databases. for exemple :

in your MCD DOG end are entity end part of is the relation

+-------+                +-----+
|DOG    |                |RACE |
|-------|                |-----|
|name   |---(part of)----|name |
|age    |                +-----+
+-------+   

in your MPD this MCD become :

+--------+                         +---------+
|tDog    |                         |tRace    |
|--------|                         |---------|
|id_tDog |                      +--|id_tRace |
|nameDog |  +--(tRace_to_tDog)--|  |nameRace |
|ageDog  |  |                      +---------+
|FK_tRace|<-+
+--------+

Post Status

Asked in February 2016
Viewed 2,843 times
Voted 6
Answered 1 times

Search




Leave an answer