Presentation is loading. Please wait.

Presentation is loading. Please wait.

WJEC Applied ICT Databases – Attributes & Entities Entities A database contains one or more related tables. Each table holds all of the information.

Similar presentations


Presentation on theme: "WJEC Applied ICT Databases – Attributes & Entities Entities A database contains one or more related tables. Each table holds all of the information."— Presentation transcript:

1 ICT@ WJEC Applied ICT Databases – Attributes & Entities Entities A database contains one or more related tables. Each table holds all of the information about an object, person or thing. Some examples of database tables might be: - a customer table - an appointments table - an exam sessions table - a teachers' names table - a concert venue table

2 ICT@ WJEC Applied ICT Databases – Attributes & Entities

3 ICT@ WJEC Applied ICT Databases – Attributes & Entities Attributes Remember that an entity is a person, place, thing or concept about which data can be collected. Each entity is made up of a number of 'attributes' which represent that entity. Let us explain this a little bit more clearly by using a couple of examples.

4 ICT@ WJEC Applied ICT Databases – Attributes & Entities Database relationships

5 ICT@ WJEC Applied ICT Databases – Attributes & Entities Entity Relationship Diagrams These relationships can be shown in the form of a diagram. This diagram is known as an 'entity relationship diagram', E-R diagram or ERD The different types of relationships you can have between entities are: - one-to-one - one-to-many - many-to-many We will look at each of these relationships in turn over the next few slides

6 ICT@ WJEC Applied ICT Databases – Attributes & Entities One-to-one relationships For the purposes of ERD, we ignore history or what might happen in the future and we concentrate only with the now. Example of one-to-one relationship Think about a husband and wife. A husband can only have one wife. A wife can only have one husband. This would be known as a 'one-to-one relationship. This relationship can be portrayed diagramatically as:

7 ICT@ WJEC Applied ICT Databases – Attributes & Entities One-to-many (or many-to-one) relationships Example of a one-to-many relationship Think about a mother and her children. A mother can have many children. A child can have only one mother, this would be known as a 'one-to-many relationship. This relationship can be portrayed diagramatically as:

8 ICT@ WJEC Applied ICT Databases – Attributes & Entities Many-to-many relationships Example of a many-to-many relationship Think about videos in a video hire shop and the shop's customers. A video can be hired by many customers. Customers can hire many videos, this would be known as a 'many-to-many relationship. This relationship can be portrayed diagramatically as:

9 ICT@ WJEC Applied ICT Databases – Attributes & Entities 9. Changing a many-to-many into a one-to-many relationship A many-to-many relationship is not a good idea when designing database relationships as this breaks the normalisation rules. To overcome this, an extra entity is usually added to the database design which then allows the relationship to become a many-to-one or a one-to-many relationship.

10 ICT@ WJEC Applied ICT Databases – Attributes & Entities 10. Designing relationships When designing or solving relationships for an E-R diagram, it is helpful to remember the following information: The 'Many' side is usually the foreign key The 'One' side is usually the primary key Before you design or set up a database, you should work out: - the entities - the attributes - the entity relationships This process is called 'data modelling'


Download ppt "WJEC Applied ICT Databases – Attributes & Entities Entities A database contains one or more related tables. Each table holds all of the information."

Similar presentations


Ads by Google