Entity relationship diagrams

Slides:



Advertisements
Similar presentations
Banking Business Scenario
Advertisements

GCSE Computing#BristolMet Session Objectives# 21 MUST describe methods of validating data as it is input. SHOULD explain the use of key fields to connect.
Normalisation Ensuring data integrity in database design 1.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Normalization A337. A337 - Reed Smith2 Structure What is a database? ◦ Tables of information  Rows are referred to as records  Columns are referred.
Bad DB Design Duplicate of data Duplicate of data Updating Updating Deleting Deleting.
Database – Part 2a Dr. V.T. Raja Oregon State University.
Normalization. Introduction Badly structured tables, that contains redundant data, may suffer from Update anomalies : Insertions Deletions Modification.
Modelling Techniques - Normalisation Description and exemplification of normalisation.Description and exemplification of normalisation. Creation of un-normalised.
CREATE THE DIFFERENCE Normalisation (special thanks to Janet Francis for this presentation)
Cambridge TEC - Level 3 Certificate/Diploma IT. ICT Dept ScenarioLO1LO2LO3.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
CTFS Workshop Shameema Esufali Suzanne Lao Data coordinators and technical resources for the network
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
CORE 2: Information systems and Databases NORMALISING DATABASES.
Customer Order Order Number Date Cust ID Last Name First Name State Amount Tax Rate Product 1 ID Product 1 Description Product 1 Quantity Product 2 ID.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
1 Entity-Relationship Diagram. 2 Components of ERD: –Entity –Relationship –Cardinality –Attributes.
Description and exemplification of entity-relationship modelling.
Btec National - Advanced Databases 1 Advanced Databases Entity Relationship Diagrams.
Database Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
CTFS Workshop Shameema Esufali Asian data coordinator and technical resource for the network
Normalisation RELATIONAL DATABASES.  Last week we looked at elements of designing a database and the generation of an ERD  As part of the design and.
Data modeling Process. Copyright © CIST 2 Definition What is data modeling? –Identify the real world data that must be stored on the database –Design.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
Logical Database Design and the Relational Model.
Sample Table Standard Notation Entity name in uppercase
Btec National - IT SYSTEMS ANALYSIS AND DESIGN 1 IT Systems Analysis and Design Entity Relationship Diagrams.
IE 423 – Design of Decision Support Systems Data modeling and database development.
Lecture 4: Logical Database Design and the Relational Model 1.
Lecture # 17 Chapter # 10 Normalization Database Systems.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Chapter 3: Modeling Data in the Organization
Database Development Lifecycle
Understanding Data Storage
Databases Chapter 9 Asfia Rahman.
Database, tables and normal forms
SEEM3430: Information Systems Analysis and Design
MIS2502: Data Analytics Relational Data Modeling
Database Normalization
Chapter 5: Logical Database Design and the Relational Model
CSCI-100 Introduction to Computing
Payroll Management System
Introduction to MS Access: creating tables, keys, and relationships
Example Question–Is this relation Well Structured? Student
CTFS Asia Region Workshop 2014
Entity-Relationship Model and Diagrams (continued)
Relational Model and ER Model: in a Nutshell
Basic Concepts in Data Management
Order Database – ER Diagram
Relational Database.
Normalization By Jason Park Fall 2005 CS157A.
Normalization A337.
Chapter 4.1 V3.0 Napier University Dr Gordon Russell
Rob Gleasure IS6125 Database Analysis and Design Lecture 11: Normalization of Data Tables Rob Gleasure
MIS2502: Data Analytics Relational Data Modeling
Database Normalisation
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
DBMS ER-Relational Mapping
Lesson Objectives Aims You should know about: 1.3.2:
CSIS 254 Oracle Normalization
MIS2502: Data Analytics Relational Data Modeling 2
Normalization By Jason Park Fall 2005 CS157A.
BTEC ICT – Unit 18 With Mr Griffiths.
Normalisation 1 Unit 3.1 Dr Gordon Russell, Napier University
Presentation transcript:

Entity relationship diagrams Mr Hall What is an Entity Relationship Diagram (ERD)? An entity relationship diagram (ERD) shows the relationships of entity sets stored in a database. An entity in this context is a component of data. In other words, ER diagrams illustrate the logical structure of databases

Starter what is a primary key

Before building any database you should know: The entities Relationships Attributes

What is an entity? Entities: Each database table is about an object, person or thing: E.g. Customers Videos Products Teachers

Attributes Attributes relate to the thing….. E.g. A DVD is the entity The attributes of the DVD are:…………………….. Relationships are how the data links together.

If a key is not a PK what is it ?

Three types of entity relationship in DBMS software One to one One to many Many to many

Cardinality –line design between entities!

Student ERD task 1 Using the attributes and the entities in the image below place the correct cardinality on the ERD diagrams

Answer to student task 1 One to many relationship

why does order number have a pk next to it ? What does Key mean?

Student task 2 You are charge of setting up a new database for the school system. You know that there are 5 major Entities in the model. These are: Classes Teachers Students Grades Rooms Draw the ERD for this model, detailing the Primary and Foreign keys for each table

Example of Entity Relation Diagrams

What are keys and why do you need to know them for creating an ERD Primary Keys are unique in that table, they cannot be duplicated Foreign Keys are linking the Primary key to another table Before building any database you should know: The entities Relationships Attributes

Different keys within a database design

What would be suitable primary keys for product and customer entities ?

Answer ? PK PK

Database task Activity 1: Entity relationship diagram-Produce an entity relationship diagram (ERD) for the database by normalizing the given data to third normal form. Now we know what ERD diagrams are and how relationships are created we now need to know how to normalize data to achieve this

Firstly what is normalization-1nf the idea is is put very simply, that you reduce data down to its atomic level. The technical word is atomicity .A good way of doing that would be for example making changes to a entity so that it did not contain duplicate values So I hear you ask . What is the issue with this set of data structures we are planning to start our design off with ?

Part 1 what is the problem ? Table one has an address entity that has multiple data sets in Address should be split into separate sections ,possibly in a new entity table all of its own .IT IS NOT ATOMIC It cannot have more than one value to be 1st normal form The column is the issue here as it should not be all in one Part 2-what is the problem ? Two emails have been entered for 1 requested value .This means it cant be atomic and so is not 1st normal form **data integrity issue** Part 3-What is the problem ? Primary key should be in here only once .As it is a primary key it should be a unique identifier .If it was a foreign key it would be no problem. **data integrity issue here with two email addresses**

Solution part 1 Solution part 2 We have split all aspects of address down to atomic level Solution part 2 Email _id is a primary key and holds the individual atomic data User_id is a foreign key hence it is allowed to have duplicate data User_id references the primary key in table 1

Firstly what is normalization-2nf The idea of 2nf is that you must first be in 1st normal form and then you need to remove all partial dependencies. There must be complete dependencies in each entity. Isbn can only be in book entity table as it is dependent or fully related to book_author. Isbn would not go in book_author as it is only partially dependent on book_author

Firstly what is normalization-3nf To get to 3nf you need to have completed 1nf and 2nf. 3nf is about removing what are called transitive dependencies Look at the following table What is the issue and what is the solution

3nf what is wrong with table This table is a good example of transitive dependency The star meaning depends upon the star That is bad. The star then depends upon the review_id Solution :split off the attributes into different tables to end transitive dependency All of the transitive dependencies have now been removed

Task 1:Produce an entity relationship diagram (ERD) for the database by normalizing the given data to third normal form.