0% found this document useful (0 votes)
14 views40 pages

Data Secu

Data modeling is the process of creating a visual representation of a software system's data elements and their flow, which aids in database design and reengineering. Key components of data models include entities, attributes, and relationships, with specific naming conventions and cardinality definitions. The Entity-Relationship Model (ER Model) is a systematic approach to visually represent these components, facilitating effective data management and organization.

Uploaded by

artkaine lopero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views40 pages

Data Secu

Data modeling is the process of creating a visual representation of a software system's data elements and their flow, which aids in database design and reengineering. Key components of data models include entities, attributes, and relationships, with specific naming conventions and cardinality definitions. The Entity-Relationship Model (ER Model) is a systematic approach to visually represent these components, facilitating effective data management and organization.

Uploaded by

artkaine lopero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 40

Data

Modeling
What is data modeling?

Data modeling is the process of creating a simplified


diagram of a software system and the data elements
it contains, using text and symbols to represent the
data and how it flows. Data models provide a
blueprint for designing a new database or
reengineering a legacy application. Overall, data
modeling helps an organization use its data
effectively to meet business needs for information.
A Good Data Name Is:
Related to business, not technical, characteristics
Meaningful and self-documenting
Unique
Readable
Composed of words from an approved list
Repeatable
Written in standard syntax
Consistent naming convention case

Camel Case (camelCase)


This involves capitalizing all words except the
first word and removing the space in between
them. For instance, public domain software can
be written as publicDomainSoftware
Pascal Case (PascalCase)
This involves capitalizing all words in the name,
including the first, and removing the space in
between them. For instance, public domain
software can be written as PublicDomainSoftware
Consistent naming convention case

Snake Case (snake_case)


This type of naming combines words simply by replacing
the space with an underscore (_). The same example used
above can be written as public_domain_software.

Kebab Case (kebab-case)


This is similar to the snake case except the underscore is
replaced with a dash (-). For the file name used above, the
Kebab case name can be written as public-domain-software
Consistent naming convention case
ER MODEL
• The Entity Relationship Model is a model for identifying
entities (like student, car or company) to be represented in
the database and representation of how those entities are
related. The ER data model specifies enterprise schema that
represents the overall logical structure of a database
graphically.

• An Entity-Relationship Model represents the structure of the


database with the help of a diagram. ER Modelling is a
systematic process to design a database as it would require
you to analyze all data requirements before implementing
your database.
Why Use ER Diagrams In DBMS?
• ER diagrams represent the E-R model in a database,
making them easy to convert into relations (tables).

• ER diagrams provide the purpose of real-world modeling


of objects which makes them intently useful.

• ER diagrams require no technical knowledge of the


underlying DBMS used.

• It gives a standard solution for visualizing the data


logically.
Symbols Used in ER Model
ER Model is used to model the logical view of the system from
a data perspective which consists of these symbols:
• Rectangles: Rectangles represent Entities in the ER Model.

• Ellipses: Ellipses represent Attributes in the ER Model.

• Diamond: Diamonds represent Relationships among Entities.

• Lines: Lines represent attributes to entities and entity sets with


other relationship types.

• Double Ellipse: Double Ellipses represent Multi-Valued Attributes.

• Double Rectangle: Double Rectangle represents a Weak Entity.


For example,
Suppose we design a school
database. In this database, the
student will be an entity with
attributes like address, name, id,
age, etc. The address can be
another entity with attributes like
city, street name, pin code, etc
and there will be a relationship
between them.
Components of ER Diagram
ER Model consists of Entities, Attributes, and
Relationships among Entities in a Database System.
What Are the Key Data Model Components?
What Are the Key Data Model Components?
A data model contains some key components;
when creating a data model you will bump into
the following terms:

•Entities are the objects we want


to represent in our data model
and are usually represented by a
table. Examples of entities
include customers, orders,
products, or categories.
What is a Strong Entity?
 A strong entity is an entity that is not dependent on any
other entity. It has a primary key, or a table includes a
primary key.
What is a Weak Entity?
 Unlike a strong entity, a weak entity is not independent as it is
reliant on another strong entity. It has to rely on other entities
to ensure its existence.
What Are the Key Data Model Components?

•Attributes are the properties that


define the entity type. Examples
include product identifier and
product name (for the Product)
category identifier and category
name (for the Category).
•(PROPERTY THAT DESCRIBE
ENTITIES)
Attributes Entities
What Are the Key Data Model Components?

Entities
Attributes
Composite Attributes Simple Attributes

• Can be divided into further parts • attribute that cannot be further

Example: The address can be


further split into house number, Example: The roll
street number, city, state, number of a student,
country, and pin code, the name the id number of an
can also be split into first name employee.
middle name, and last name. Weight- cannot further
divided
Single-Valued Attributes Multivalued Attributes

• attribute which takes up • attribute which takes up more than


only a single value for each a single value for each entity
entity
Example:
Example: AGE- Phone number of a student:
Single Valued Landline and mobile.
Attribute of a
person (a person College Degree,
has only one age) Language
A attribute of person
may have a multi
College degree and
Derived attribute Stored Attributes
• An attribute that can be derived • stored attribute are those attribute
from other attributes which doesn’t require any type of
further update since they are
stored in the database.
Example: AGE- can
be derive from date
of birth Example: DOB(Date of birth)
Example: Total and is the stored attribute.
average marks of a
student.
Derived attribute Null Values
• Complex attributes are the
• Something which is not
nesting of two or more
applicable or unknown
composite and multi-valued
attributes.
• Multivalued Attribute = ‘{}’
• Composite Attributes = ‘()’

Example:
{College Degree(College,year,degree,field)}
What Are the Key Data Model Components?

•Records are shown in


rows in each table. A good
example of a record is the
data of a specific product
(identifier, product name,
category) stored in a table
called Products.
What Are the Key Data Model Components?

•Relationships define
the associations
between entities. This
may be 1:1, 1:N or
M:N. For example, one
product could be
related to another by a
specific product
What Are the Key Data Model
Components?
•Degree of Relationship

Denotes the number of entity


types that participate in a relationship

• Unary Relationship
- Exists when there is an
association with only one entity
•Degree of Relationship
What Are the
Key Data Model Binary Relationship
Components? - exists when there is an association among
two entities
What Are the Key Data Model
Components?
•Degree of Relationship

Ternary Relationship
- exists when there is an
association among three entities
What Are the Key Data Model Components?

•Cardinality refers to the


numerical relationship (1:1,
1:N and N:M) between two
entities in a database. For
example, the relationship
between a specific product
and category can be
described with a 1:N
relationship — one category
can be relevant for multiple
products, but one specific
product is related by a specific
What Are the
Key Data
Model
Components?

• Cardinality Ratio
• Maximum number of
relationship
instances that an
entity can participate
in.
• Possible cardinality
ratios for binary
relationship
• 1:1, 1:N, N:1,
M:N
What Are the Key Data Model Components?
What is Cardinality?
1. One-to-One: When each entity in each entity set can
take part only once in the relationship, the cardinality
is one-to-one.
Let us assume that a male can marry one female
and a female can marry one male. So the relationship will
be one-to-one.
What is Cardinality?
2. One-to-Many: In one-to-many mapping as well where
each entity can be related to more than one entity and
the total number of tables that can be used in this is 2.
Let us assume that one surgeon department can
accommodate many doctors. So the Cardinality will be 1
to M. It means one department has many Doctors.
What is Cardinality?
3. Many-to-One: When entities in one entity set can take
part only once in the relationship set and entities in other
entity sets can take part more than once in the relationship
set, cardinality is many to one.
Let us assume that a student can take only one course
but one course can be taken by many students. So the
cardinality will be n to 1. It means that for one course there
can be n students but for one student, there will be only one
course.
What is
Cardinality
?
What Are the Key Data Model Components?

•Primary key is a unique


identifier of each record in a
current table. It refers to a
column or a combination of
columns that has a unique
value for each row. For
the Product table the
primary key is product_id,
and for the Category table it
is category_id.
What Are the Key Data Model Components?

•Foreign key is a column or a


group of columns that points
towards a primary key in a
different table
— product_id and category_id. It
creates an association between
two tables
(Product and Category) that
enables information from one
table (Product) to be linked and
related to information from
another (Category
What Are the Key Data Model Components?

•Foreign key is a column or a


group of columns that points
towards a primary key in a
different table
— product_id and category_id. It
creates an association between
two tables
(Product and Category) that
enables information from one
table (Product) to be linked and
related to information from
another (Category
Identify the Entities (weak entity/ Strong Entity)
1. Department
2. Course
3. Instructor
4. Student
5. Customer
Create your own data model using ER modeling
Process with 3 minimum entities observe proper
naming convention entity, cardinality and
relationship

You might also like