03 - Conceptual Data Model

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 29

Conceptual Data Model

Pemodelan Data
Rizka Wakhidatus Sholikah
Outline

• Stage of data modeling


• Conceptual data modeling
• ER diagram
• How to create ER diagram

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Stages in data modeling

Conceptual Logical Physical


data model data model data model

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Stages in data modeling

• Each data model has a specific purpose and distinct role in data
modeling
• Organization usually take linear approach that use three type of
data model
• Increase the understanding of company data resources
• The use of three data types can cover the different perspective of
stakeholders

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Conceptual data model

• The first stage of data modeling


• Communicate business level structures at high level
• Do not take system constrain
• Omit finer detail
• The target stakeholders  non-technical
• The goals  show the data of the organization and the relation between
them
• Why?
• To create big picture of the data and their relation in an organization
• can see potential relationships between entities before entering the development
stage in more detail
INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia
www.its.ac.id
Logical data model

• The second stage of data modeling


• Help organizations understand the information they must process to
complete a specific task
• Design independently from DBMS
• Data attribute will have datatype
• The target stakeholder  database analysts and designer
• The goals  visualize data elements and how they relate to one another
• Why?
• Prevent poor database design and application
• Provide the foundations necessary for productive database design
INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia
www.its.ac.id
Physical data model

• The third stage of data modeling


• Considered the database-specific context, specify the DBMS that will use
• Represents the tables, columns, datatypes, views, constrains, indices, and
procedures within the database
• Sometimes need to denormalization logical model
• The target stakeholder  database designer
• The goals  describe how the database will be created within a specific
DBMS
• Why?
• Ensure the better data quality, easier implementation and maintenance, and more
scalability
INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia
www.its.ac.id
Example

• Example of conceptual data modeling

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Example

• Example of logical data modeling

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Example

• Example of logical data modeling

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
ERD

• ERD (Entity Relationship Diagram)


• Commonly used to show the data
organization
• ERD can show the interrelationship between
data
• ERD in conceptual stage showing only the
relation between entity without much detail
in data type and the context

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Why use ERD?

• Provide an overview about how all entity


connect with each other
• Get a better understanding about the
information that should be contained in the
database
• Help define the entities, attributes, and
relationsships

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
How to create ERD?

Entity Relationship Cardinality Attribute


ERD
identification identification identification identification

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Entity identification

• Entity is a representation of real-world thing


• Place
• Person
• Object
• Event
• Concept
• Example:
• University
• Student
• Sale
• Product
INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia
www.its.ac.id
Entity identification

• Entity can be categorized as


• Strong entity
• Weak entity
• Strong entity
• The existence does not depend on the other entity
• Weak entity
• Only exist when another entity exist
• Example:
• Entity room only exist when there is entity building

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Relationship identification

• Relationship is an association between two entities


• Relationship can be identify by the verb in a business rules
• Example:
• Students are choosing courses

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Cardinality identification

• Defines the type of relationship by using numerical attributes


• Cardinality refers to the maximum number of times an instance in
one entity can relate to another entity
• Ordinality is the minimum number of times an instance in one
entity can be associated with instance in another entity
• Type of relationship:
• One to one
• One to many
• Many to many

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Cardinality identification cont.

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Attributes identification

• Attributes defines the property or characteristic of an entity


• Example:
• In student entity, there are attribute:
• Student_id
• Student_first_name
• Student_last_name
• Student_date_of_birth

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Attributes identification cont.

• Types of attributes:
• Simple attribute
• Composite attribute
• Derived attribute
• Multivalued attribute
• Simple attribute
• Cannot be divided any further
• Example: phone_numbers
• Composite attribute
• Can be broken down into simple attribute
• Example: student_name  student_first_name, student_last_name
INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia
www.its.ac.id
Attributes identification cont.

• Derived attributes:
• An attribute that can be extracted from another attribute
• Example: attribute age can be derived from date_of_birth
• Multivalued attribute:
• An attribute that can have more than one values
• Example: student can have more than one email

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Symbols

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Case study

• In a supermarket, a customer can have more than one invoice. An invoice only
create for one customer. One invoice can be contained more than one
product. A product variant can appear in more than one invoice

• Entity: customer, invoice, product

customer invoice product

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Case study
• In a supermarket, a customer can have more than one invoice. An invoice only
create for one customer. One invoice can be contained more than one product. A
product variant can appear in more than one invoice

• Relation:
• customer has invoice
• invoice is contained products

customer has invoice contained product

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Case study
• In a supermarket, a customer can have more than one invoice. An invoice only create for one
customer. One invoice can be contained more than one product. A product variant can appear in
more than one invoice

• cardinality:
• customer 1..* invoice
• invoice *..* product

customer has invoice contained product

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Case study

• Attribute:
• customer: id, name, contact
• invoice: id, date
• product: id, name

id id id

customer has invoice contained product

name contact date name

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Case study

• ERD

customer invoice product


customer_id
customer_name invoice_id product_id
customer_contact invoice_date product_name

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Exercise

• Discuss with your friends about the case studies below


• Identify the entity, relationship, cardinality an possible attribute for each entity
• Build ERD-conceptual from your identification

• Suppose in ITS, you have to create a database for exam


Consider a database used to record the marks that students get in different exams
of different course offerings
• Remember:
• Students can take more than one courses
• Each course can have more than one exam
• Each exam can only record one mark (score), because each student can only take the exam
once

INSTITUT TEKNOLOGI SEPULUH NOPEMBER, Surabaya - Indonesia


www.its.ac.id
Thank you

You might also like