Week-3 LECTURE Databasemodels
Week-3 LECTURE Databasemodels
(Conceptual Modelling
Concepts)
Topics
• Data Model
• Why Data Model
• Conceptual Modelling Concept
• ER Model
• Goals of ER Model
• Diagram conventions
Database Design Process
● Requirements collection and analysis
○ Find the facts(Interviews, Observation, looking at current data)
● Conceptual database design
○ Find out entities and model the relationship between entities
○ Design the functional specifications
● Choosing a suitable DBMS
Database Design Process
● Data model mapping (Logical database design)
○ Identify the relationships between different
tables and normalise them
● Physical database design
○ Transform the data model into the physical
data structure++
● Implementing the database management system
Data Modelling
• In databases, data modelling is the process of creating models to store the data in
the database.
• Data models focus on what kind of data is required and how it should be organised.
Importance of Data Modelling
Importance of Data Modelling
Importance of Data Modelling
● To obtain quality data: Goal of Data Model is to make sure that all Data
Objects required by Database are completely and accurately represented.
● To easily retrieve/analyse data and To reduce cost
● To set a clear scope: Data Model is also detailed enough to be used by
Database Developers to use as "blueprint" for building Physical Database.
● It will give us a clear insight into what things we need to focus on more and
how the system will develop in the days to come.
Types of Database Model
➢ Properly designed database are easy to maintain, improves data consistency and are
cost effective in terms of disk storage space.
➢ The database designer decides how the data elements correlate and what data must
be stored.
➢ Main objectives of database design in DBMS are to produce logical and physical designs
models of the proposed database system.
Conceptual Modelling Concepts
and their Representation
Phases of data modelling
Database Design Process
A schema is a “description of the structure of the database”.
• Conceptual Database Design: Defines
Conceptu
Logical Physical WHAT the system contains through data
al
Fact Database
Database
Design
Database
Design
analysis and requirements gathering
finding
results
Design
• Logical Database Design: Defines HOW
the system should be implemented
Concept
ual Logical Physical regardless of the DBMS.
schema schema
•
schema
Physical Database Design: Describes
High level Where the system will be implemented
and Can be
independe
nt from
processed
Describes
storage
using a specific DBMS system and is
by the
any
DBMS
DBMS
structures
created by DBA and developers. The
purpose is actual implementation of the
database.
Database – Levels of Abstraction
• Database systems comprise complex
data-structures.
• Abstraction creates a general idea of
External Level
Logical Level
Physical Level
•End users •What •How the
what the problem is and how to solve work on information data is
it. view level or data is stored
•Most used stored in physically
• To make the system efficient in terms of for VIEW the and where
purpose database is it stored
data retrieval, and reduce complexity, in database
developers use abstraction.
• Abstraction hide irrelevant details from
the users and approach simplifies
database design.
Abstraction – Walk Through
Users see the data in the form of rows and columns
■ Easier to make amendments later ■ It forms sound basis for Physical Database
Design.
Quiz
• Adjective + Noun
• Noun + Noun => (noun string)
Customer
• Adjective + Noun + Noun Customer Department
Order
• Examples
• Customer, Customer Order, Product, Hourly Employee, Project, Department,
Unfilled Customer Order
Where to Look for Entity?
● Tangible or Intangible Things
○ Nouns that are used to describe problem domain will often
correspond to major Entity of the system, at least at a high level.
○ Examples:
■ Product
■ Sensor
■ Employee
■ Department
■ Sale Office
Where to Look for Entity?
● Resources
○ Any resources that an organization needs to manage should be
represented as an Entity. Information assists the efficient and
effective use of other resources through improved decision.
○ Examples:
■ Inventory
■ Machine
■ Bank Account
■ Customer
Where to Look for Entity?
● Roles Played
○ Roles can be played by persons or organizational units.
○ Examples:
■ Customers
■ Managers
■ Account representatives
Where to Look for Entity?
● Events
○ Events are incidents that occur at points in time.
○ Event often involved interaction between two Entity or action that
changes status of Entity.
○ Examples:
■ Sale
■ Delivery
■ Registration of a motor vehicle
Attribute
● Attributes are the properties or characteristics of an entity.
Customer ID Name
DOB
Customer
Customer ID
Name Customer
DOB
Contact Number
Email
Emali
Contact Number
Attribute
Model no.
Brand
Color Laptop
Manufacturer
Price
Price
Manufacturer
Attribute
• Entity must have Unique Identifier
• Unique Identifier can be of single or combination of Attributes
• Candidate Key is Attribute or combination of Attributes that uniquely identifies each instance of Entity.
• Primary Key is Candidate Key that has been selected as Unique identifier for Entity, all remaining Candidate
Key are called Alternate Key
• Attributes that are not Primary Key, Candidate Key or Alternate Key are called NonKeys
• Attributes have values. Attribute value can be number, character string, date, image, sound, and even
more.
• Sometimes value of Attribute is unknown or missing, and sometimes value is not applicable.
Types of Entity
● Tangible entity:
○ Can exist in the real world physically
○ Examples - A person, a car, a house and so on
● Intangible entity:
○ Can only exist logically and does not have any physical existence
○ Examples - A bank account, a shopping order and so on
Entity Type
● Collection of the entities having similar attributes
● So, an entity type in an ER diagram is defined by a table name(here, STUDENT) and a set
of attributes(here, Student_id, Student_name, Course, Age)
Types of Entity type
Student ID Name
● Strong entity type:: Age
Address
Types of Attribute
Student
● Key attribute
● Composite attribute Student ID
Name
● Multi-valued attribute
Address
● Derived attribute DOB
Age
Contact no.
Key Attribute
Student_id
Name
Student Age
Composite Attributes
• Composed of multiple components, each with an independent existence
employee_id Name
City
House no
Employee Address
ZIP code
Street
Multi-valued Attribute
○ Hold multiple values for each occurrence in an entity type.
ContactNoC
Contact No
Person
Derived Attribute
• Derived from other attributes
DOB Age
Person
Attributes
Derived
Attribute Attribute
Attribute Attribute
Multi Valued
Attribute
Composite
Attribute
Attribute
Entity with Attributes • Example of Entity with Attributes
Entity Attribute
Attribute_List
Bank Account (Account_No,
Account_Holder_Name, Bank_Branch,
Address, Balance)
Summary
• Data modelling is the process of creating a data model for the data to be
stored in a database.
• An ERD is a visual representation of a particular system that describes the
relationship within people, objects, places, concepts, or events.
• Entities are real-world objects containing information about which is stored
in the database.
• Attributes define the properties of an entity.
Any Questions?