0% found this document useful (0 votes)
12 views49 pages

Lec 04

The document outlines the concepts of Data Warehousing and Data Mining, focusing on the Entity-Relationship (ER) model used for data organization in databases. It details various components of the ER model, including entities, attributes, relationships, and types of data modeling such as conceptual, logical, and physical models. Additionally, it introduces Dimensional Modeling, emphasizing its role in high-performance data access and analysis.
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)
12 views49 pages

Lec 04

The document outlines the concepts of Data Warehousing and Data Mining, focusing on the Entity-Relationship (ER) model used for data organization in databases. It details various components of the ER model, including entities, attributes, relationships, and types of data modeling such as conceptual, logical, and physical models. Additionally, it introduces Dimensional Modeling, emphasizing its role in high-performance data access and analysis.
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/ 49

CS-423

DATA WAREHOUSING AND DATA


MINING

Lecture

Course Instructor:
Aisha Shabbir Institute of Geographical Information Systems
Road Map for
• ER Model Today
• Components of ER Model
• Attribute and Relation types
• Data Modeling
• Conceptual Modeling
• Logical Modeling
• Physical Modeling
• Dimensional Modeling
Entity
• An entity is an object, concept or component of data.
An entity might be
1. Object with physical existence. E.g. a lecturer, a student, a car
2. Object with conceptual existence. E.g. a course, a job, a position
ER model
• ER model stands for an Entity-Relationship model.
• This model is used to define the data elements and relationship for a
specified system.
• It is also used in computing in regard to the organization of data
within databases or information systems.
An ER diagram has three main components:
1. Entity
2. Attribute
3. Relationship
Entity
• An entity is an object, concept or component of data.
An entity might be
1. Object with physical existence. E.g. a lecturer, a student, a car
2. Object with conceptual existence. E.g. a course, a job, a position
• An entity is represented as rectangle in an ER diagram.
Examples of entities:
• Person: Employee, Student, Patient
• Place: Store, Building
• Object: Machine, product, and Car
• Event: Sale, Registration, Renewal
• Concept: Account, Course
Attribute
• An attribute describes the property of an entity. An attribute is
represented as Oval in an ER diagram.
Relationship
• Relationship is nothing but an association among two or more
entities.
• A relationship is represented by diamond shape in ER diagram, it
shows the relationship among entities.
Weak entity
• An entity that cannot be uniquely identified by its own attributes is called weak
entity.
• Weak entity depends on another entity
• The weak entity doesn't contain any key attribute of its own.
• The weak entity is represented by a double rectangle.
Strong Entity Set Weak Entity Set
It does not have enough attributes to build a
Strong entity set always has a primary key. primary key.
It is represented by a rectangle symbol. It is represented by a double rectangle symbol
It contains a Primary key represented by the It contains a Partial Key which is represented
underline symbol. by a dashed underline symbol.
The member of a strong entity set is called as The member of a weak entity set called as a
dominant entity set. subordinate entity set.
In the ER diagram the relationship between The relationship between one strong and a
two strong entity set shown by using a weak entity set shown by using the double
diamond symbol. diamond symbol.
The connecting line of the strong entity set The line connecting the weak entity set for
with the relationship is single. identifying relationship is double.
Key attribute
• A key attribute can uniquely identify an entity from an entity set. For example,
student roll number can uniquely identify a student from a set of students.
• Key attribute is represented by oval same as other attributes however the text of
key attribute is underlined.
Composite attribute
• Composite attributes are made of more than one simple attribute. For example, a
student's complete name may have first_name and last_name.
• The composite attribute is represented by an ellipse/oval, and those ellipses are
connected with an ellipse.
Derived attribute
• Derived attribute − Derived attributes are the attributes that do not exist in the
physical database, but their values are derived from other attributes present in
the database. It is represented by dashed oval in an ER Diagram.
• For example, age can be derived from data_of_birth.
Multi-value attribute
• Multi-value attribute − Multi-value attributes may contain more than
one values. For example, a person can have more than one phone
number, email_address, etc. It is represented by double oval in an ER
Diagram.
Types of Relations
There are four types of relationships:
1. One to One
2. One to Many
3. Many to One
4. Many to Many
Cardinality Identification
Example
• In a university, a Student enrolls in Courses. A student must be
assigned to at least one or more Courses. Each course is taught by a
single Professor. To maintain instruction quality, a Professor can
deliver only one course.
Solution
Step 1) Entity Identification
Step 2) Relationship Identification
Step 3) Cardinality Identification
Step 4) Identify Attributes
Step 5) Create the ERD Diagram
Entity Identification
We have three entities
• Student
• Course
• Professor
Step 2) Relationship
Identification
We have the following two relationships
• The student is assigned a course
• Professor delivers a course
Step 3) Cardinality
Identification
• A student can be assigned multiple courses
• A Professor can deliver only one course
Step 4) Identify Attributes

Entity Primary Key Attribute

Student Student_ID StudentName

Professor Employee_ID ProfessorName

Course Course_ID CourseName


• For Course Entity, attributes could be Duration, Credits, Assignments,
etc. For the sake of ease we have considered just one attribute.
Step 5) Create the ERD Diagram
Conceptual Data Model
A conceptual data model identifies the highest-level relationships
between the different entities. Features of conceptual data model
include:
• Includes the important entities and the relationships among them.
• No attribute is specified.
• No primary key is specified
Conceptual Data Model
Logical Data Model
A logical data model describes the data in as much detail as possible,
without knowing that how it will be physical implemented in the
database.
• Includes all entities and relationships among them.
• Normalization occurs at this level.
Logical Data Model
The steps for designing the logical data model are as follows:
• Specify primary keys for all entities.
• Find the relationships between different entities.
• Find all attributes for each entity.
• Resolve many-to-many relationships.
Logical Data Model
Differences Between Logical Data
Model & Conceptual Data Model
• In a logical data model, primary keys are present, whereas in a
conceptual data model, no primary key is present.
• In a logical data model, all attributes are specified within an entity. No
attributes are specified in a conceptual data model.
• Relationships between entities are specified using primary keys and
foreign keys in a logical data model. In a conceptual data model, the
relationships are simply stated, not specified.
Physical Data Model
Physical data model represents how the model will be built in the
database/data warehouse.
 A physical database model shows all table structures, including
column name, column data type, column constraints, primary key,
foreign key, and relationships between tables.
Features of a physical data model include:
• Specification all tables and columns.
• Physical considerations may cause the physical data model to be quite
different from the logical data model.
Physical Data Model
The steps for physical data model design are as follows:
• Convert entities into tables.
• Convert relationships into foreign keys.
• Convert attributes into columns.
• Modify the physical data model based on physical constraints /
requirements.
Physical Data Model
Difference b/w physical data model and
logical data model diagram
• Entity names are now table names.
• Attributes are now column names.
• Data type for each column is specified.
The three levels of data modeling, conceptual data model, logical data model, and physical data model are
compared using different features:

Feature Conceptual Logical Physical


Entity Names ✓ ✓
Entity Relationships ✓ ✓
Attributes ✓
Primary Keys ✓ ✓
Foreign Keys ✓ ✓
Table Names ✓
Column Names ✓
Column Data Types ✓
Dimensional Modeling
• Dimensional Modeling is a logical design technique present the data
in a standard framework that allows for high-performance access.
• In this design model all the data is stored in two types of tables.
• Dimensional modeling methods make it possible for warehouse
designers to create database schemas that business customers can
easily hold and figure out the facts (beneficial or not).
• A Dimensional model is designed to read, summarize, analyze
numeric information like values, balances, counts, weights, etc. in a
data warehouse.
Elements of Dimensional Data
Model
• Fact
• Dimension
• Fact Table
• Dimension table
Steps of Dimensional Modeling
Step 1) Identify the business process
Step 2) Identify the dimensions
Step 3) Identify the Fact
Step 4) Build Schema
THANKS

You might also like