We were given a lecture about the Entity Relation Model (EDR). This is a visual representation of relationships between entities in order to create Databases .

Above I have created an EDR for a database that would be used for an online recipe book. 

The database contains three categories,members, photos and the recipe. 

Each categories contain entities within them.

Members

The members categories contains the most amount of entities, as this will contain all the information about the user using the website. Information includes their full name, date of birth and a datestamp. It also includes a username and avatar to identify themselves to other users, and also a password so they can post to the recipe book. These all includes primary keys which are individual entities. 

Photo

This categories contain entities in relation to photos that would be included within the recipe. This includes a unique ID photo to identify it, a filename and a description about the photo. These are all primary keys. It also uses a foreign key, which is a link from an other entity. This is the photo_member_ID so it tells us which user is associated with that photo.

Recipe

This is where information about actual recipe is kept. This includes primary keys such as the unique ID, the title and the text of what the actual recipe is. It also contains two foreign keys, the member ID and photo ID to link between the members and the photo that they posted. 

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