ER diagram for a database of company

Draw an entity-relationship diagram for a database with companies, people, and professionals (people who work for companies).

My initial thoughts:

  • Entities:
    1. Company: companyID, companyName, companyLocation, ect
    2. People: peopleID, name, gender, age, etc
    3. Professional: professionalID
  • Relations:
    1. People ISA Professionl: 1:1
    2. Professional WORKS Company: N:1

Solution:
People who work for companies are Professionals. So there is an ISA (is a) relationship between People and Professionals (or we could say that a Professional is derived from People).
Each Professional has additional information such as degree, work experiences, etc, in addition to the properties derived from People.
A Professional works for one company at a time, but Companies can hire many Professionals, so there is a Many to One relationship between Professionals and Companies. This “Works For” relationship can store attributes such as date of joining the company, salary, etc. These attributes are only defined when we relate a Professional with a Company.
A Person can have multiple phone numbers, which is why Phone is a multi-valued attribute.
ER diagram for a company

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: