130 likes | 218 Views
Databases and E-R Diagrams. Access/IPS Walsall College of Arts & Technology. What we are going to cover:. What is a database and why do we use them? What are Entities, Attributes & Relationships (in terms of databases)? What is an Entity-Relationship diagram and why are they used?
E N D
Databases and E-R Diagrams Access/IPS Walsall College of Arts & Technology
What we are going to cover: • What is a database and why do we use them? • What are Entities, Attributes & Relationships (in terms of databases)? • What is an Entity-Relationship diagram and why are they used? • Anything else we feel like discussing Walsall College of Arts & Technology
What is a database? • Technical version: • “A collection of persistent data in a fixed store” • What? • English version: • Information held about something that can be looked at more than once • Clear as mud, eh? Walsall College of Arts & Technology
What makes up a database? • A database is made up of: • Tables • Attributes • Relationships • More about these in a bit Walsall College of Arts & Technology
Why use Databases? • Quicker reference • Take up less space – no filing cabinets • Hold more information in a smaller space • Information remains indexed with new entries • Less paper = less risk of fire! • And finally….. • Because they’re really good! Walsall College of Arts & Technology
What are Entities, Attributes and Relationships? • Entities are things we hold information about • Eg. A Student or a Course • Attributes are the different categories of information for each entity, also known as Fields. • Eg. Student Name, Number, etc • A collection of Attributes is known as a Record • Relationships are the connections between Entities • Eg. A Student enrols in a Course Walsall College of Arts & Technology
E-R Diagrams • Entity-Relationship Diagrams • What are they? • Diagrams to show how Entities are related to each other • This may seem too easy, but it really is that simple! • What does one look like? • We’ll see in a moment Walsall College of Arts & Technology
3 of a kind • There are 3 kinds of Relationship • One to One • One to Many • Many to Many • More explanation is required….. • The best way to explain these, is through examples Walsall College of Arts & Technology
One to One • We’ll use Husbands and Wives • If we have an entity “Husband” and an entity “Wife” • In English Law, One Husband can have One Wife and vice-versa HUSBAND WIFE Walsall College of Arts & Technology
One to Many • We’ll use Football Teams and Players • If we have an Entity “Team” and an Entity “Player” • A Team can have many Players, but a Player can only play for one Team TEAM PLAYER Walsall College of Arts & Technology
Many to Many • We’ll use Films and Filmstars • If we have an entity “Film” and an entity “Filmstar” • A Film has many Filmstars and a Filmstar can be in many Films. FILM FILMSTAR Walsall College of Arts & Technology
Exercise • Work out the relationships between, and draw a diagram for the following entities • Computer and Computer Game • Company and Branch Office • Veterinary Surgeon & Practice • Customer Car & Registered Owner Walsall College of Arts & Technology
Acknowledgement • Some of the material in this presentation was taken from a presentation by Janet Hardy, Lecturer in Computer Science dept, University of Wales, Aberystwyth • Thanks Janet! Walsall College of Arts & Technology