Cse 1012 basic computer applications entity relationship diagram
This presentation is the property of its rightful owner.
Sponsored Links
1 / 28

CSE 1012 Basic Computer Applications Entity-relationship diagram PowerPoint PPT Presentation


  • 41 Views
  • Uploaded on
  • Presentation posted in: General

CSE 1012 Basic Computer Applications Entity-relationship diagram. Appavoo Paramasiven. Lesson Objectives. Learn about the components that make up an Entity Relationship Diagram (ERD) using the Chen’s notation Learn how to draw an ERD Learn how to transform an ER Model into a Relational Model.

Download Presentation

CSE 1012 Basic Computer Applications Entity-relationship diagram

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Cse 1012 basic computer applications entity relationship diagram

CSE 1012Basic Computer ApplicationsEntity-relationship diagram

Appavoo Paramasiven


Lesson objectives

Lesson Objectives

  • Learn about the components that make up an Entity Relationship Diagram (ERD) using the Chen’s notation

  • Learn how to draw an ERD

  • Learn how to transform an ER Model into a Relational Model


Content

Content

  • ER Model

    • Entities

    • Relationships

    • Attributes

  • Classes of Attributes

  • Cardinality Mapping

  • From entities to relations


Introduction

Introduction

  • What is a model?

    Representation of sth

  • Entity Relationship Model

    • Representation of relationships between data

    • Developed by Peter Chen (1976)


Er diagramming modelling a db

ER Diagramming - Modelling a DB

  • Data view of a system

  • Provides a high level, conceptual view of the DB structure

  • What data should be stored??

  • What relationship exists between data items??

DB

Student

marks

Student

details

File

Link


The er model

The ER Model

  • Used for:

    • Conceptual database design

  • Made up:

    • Entities

    • Attributes

    • Relationships

  • Benefits:

    • Pictorial representation (non-tech people)

    • Easily map to relations


Er model entity

ER Model - Entity

  • Entity

    • Group of ‘objects’

    • In real ‘world’

    • With same properties

      Each rectangle contains the name of the entity it represents

    • An entity can be uniquely identified

  • Examples:

    Car, University, Department, Person

EntityName

Car


Er model relationships

ER Model - Relationships

Relationship

Name

  • Relationships

    • Associations between entities

    • Corresponds to primary key-foreign key equivalencies in related tables

      Each diamond contains the name of the relationship it represents

  • Examples

    Own, register, employ

Own


Er model attributes

ER Model - Attributes

  • Attributes

    • “describe the entity’s characteristics”

    • Attributes are represented by an Ellipse/Ovalconnected to the Entity with a line

      Each oval contains the name of the attribute it represents

      Entity: Person

      Attributes:NID, Name, Address, LicenseNumber, height

AttributeName

NID


Er model

ER Model

EntitiesAttributesRelationships

NID

Name

Address

Age

License No

Owns

Plate No

Make

Model

Colour


Er diagram

ER Diagram

Make

Address

License No

Plate No

Name

Colour

NID

Model

Person

Own

Car

Since


Classes of attributes

Classes of Attributes

  • Simple Attribute

  • Composite Attribute

  • Derived Attributes

  • Single-valued

  • Multi-valued Attribute


Classes of attributes1

Classes of Attributes

  • Simple Attribute

    • cannot be subdivided

  • Composite Attribute

    • can be further subdivided to yield additional attributes.


Classes of attributes2

Classes of Attributes

  • Derived Attribute

    • is not physically stored within the database

    • is derived by using an algorithm


Classes of attributes3

Classes of Attributes

  • Single-valued

    • can have only a single value.

    • Examples:

      • A person can have only one social security number.

      • A manufactured part can have only one serial number.

    • A single-valued attribute is not necessarily a simple attribute.


Classes of attributes4

Classes of Attributes

  • Multivalued attributes

    • Can have many values

    • Examples:

      • A person may have several college degrees

      • A household may have several phones with different numbers


Cardinality mapping

Cardinality Mapping

  • It is the specification of the number of occurrences of one object that can be related to the number of occurrence of another object.

    • One to one (1:1)

    • One to many (1:N)

    • Many to many (M:N)


Examples

Examples

N

Give

birth

1

Mother

Child

N

employ

1

School

Teacher

N

guide

M

Lecturer

Student

Students can register for one course at a time.

N

register

1

Course

Student


Activity identify the entities and their relationships for the following

ACTIVITY – Identify the entities and their relationships for the following:

  • A department hires many employee. A employee is employed by one department.

  • A manager manages one department. A department is managed by one manager.

  • A person must have one and only one DNA pattern and that pattern must apply to one and only one person.

  • Each student takes many classes, and each class is taken by many students.

  • A team consists of many players. A player plays for only one team.


Steps for creating an erd

Steps for creating an ERD

  • Identify the entities

  • Identify the attributes

  • Identify the relationships

  • Identify cardinalities


Activity

ACTIVITY

Lecturers can lecture many courses and give lecture to many students. Each student can register for one course and at the same time and in each course there will be many students.

Draw the ERD of the above.

You are free to decide the attributes of the entities.


Cse 1012 basic computer applications entity relationship diagram

Age

name

DOB

Address

Phone #

Entities

Lecturer

Relationship

Attributes

lecture

register

StudentID

Student

Course

name

Course #

DOB

Title

Age

Address


Table design 1

Table Design (1)

Make

Address

License No

Plate No

Name

Colour

NID

Model

Person

Owns

Car

Since


Table design 11

Table Design (1)

Person( NID, Name, Address, LicenseNo )

Car( PlateNo, Colour, Make, Model )

Owns( NID, PlateNo )

From Entities to relation!!!

, DatePurchased )


Table design and normalisation

Table Design and Normalisation

  • Each entity in the Logical Design model, along with the associated attributes, corresponds to one or more tables in the system.

  • A table is the grouping of attributes to identify a physical entity.

  • The table name should ‘describe’ the entity name.

  • The unique attributes may become the unique key.

  • Base your table design on a normalized logical data model.


Table design and normalisation1

Table Design and Normalisation

  • Normalized data model avoids redundancies and inconsistencies in your data.

  • Tables in a database should be at least in the 3rd Normal Form.


Draw the erd of the above using the chen s model

Draw the ERD of the above using the CHEN’s model.

  • The Ministry of Fisheries wants to keep records of the existing fishing companies. Given the following:

    A fisherman can work for one fishing company at a time and each fishing company can have many fishermen. Training is provided to at most five trainee fishermen in each company who are guided by existing fishermen of that company. Fishing companies also own fishing boats. The Ministry wants to store the identity number, social security number, name, surname, address, date of birth and number of years of experience for each fisherman. The same information will be kept for the trainees. As for that of the fishing company, its name and address, the contact person and the telephone number will be stored (there can be more than one telephone number). Every boat has a name, a manufacturer, a capacity, and a date of purchase and is assigned to a particular fisherman.


Recap

Recap

  • ER Model

    • Entities

    • Relationships

    • Attributes

  • Classes of Attributes

  • Cardinality Mapping

  • From entities to relations


  • Login