0% found this document useful (0 votes)
25 views20 pages

Lec - 5 - Basic ER

The document discusses conceptual modeling and database design. It describes semantic data modeling which aims to represent real-world concepts and relationships. Entity-relationship modeling is introduced as a way to design databases using entity-relationship diagrams. The document outlines the typical phases of database development including requirements analysis, conceptual design using ER modeling, logical design by mapping the ER model to relational structures, and physical database building and administration.

Uploaded by

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

Lec - 5 - Basic ER

The document discusses conceptual modeling and database design. It describes semantic data modeling which aims to represent real-world concepts and relationships. Entity-relationship modeling is introduced as a way to design databases using entity-relationship diagrams. The document outlines the typical phases of database development including requirements analysis, conceptual design using ER modeling, logical design by mapping the ER model to relational structures, and physical database building and administration.

Uploaded by

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

Database Systems

Basic Database ER Model


Semantic Modeling
• A class of data models
• Conveys semantic meaning
• Implements databases more intelligently
• Support more sophisticated user interfaces (SQL queries, forms &
reports)
• Research started in 1970s and early 1980s
• Other names are data modeling, E/R modeling, E-modeling

CS204 Database System 2


Top-Down Methodology
• Design methodologies that are based on
semantic modeling ideas are often
referred to as Top-Down methodologies,
because they start at a high level of
abstraction with real world constructs or
entities and finish at the low level of
abstraction represented by a specific
concrete database design

CS204 Database System 3


Chen E/R Model
• Chen in 1976 introduced the E/R model

• The E/R model allows us to sketch the design of a


database informally.

• Designs are pictures called entity-relationship


diagrams.

• Fairly mechanical ways to convert E/R diagrams to


real implementations like relational databases exist.

CS204 Database System 4


Database Development & DBA
Requirements Requirements Natural
Analysis Specification Language

Conceptual Conceptual
Informal
Design Model

Logical Relational Formal


Design Model
DBMS-independent
Database DBMS-specific
Building Database

Physical/ DBA
Operation, Mainte- Evolving
nance, & Tuning Database
CS204 Database System 5
Database Development …
 Requirements Analysis
 Collect and Analyze the requirements of the users, e.g., Functional Specification,
Prototyping.
 Conceptual Design
 Design a conceptual model (schema), e.g., ER model, ER Design, ER Mapping.
 Logical Design
 Translate the ER model into a relational model (schema), DDL Scripts (e.g., ER Mapping
to DDL)
 Normalization
 Database Building
 Build the database and write application programs for specific DBMS & S/W Appls/
Tools.
 Operation, Maintenance & Tuning
 Use/ Training, Installations, maintain and “tune” the database.

6
Goals for Conceptual/ Logical Design
• Simplicity
– Users should understand the design
– Data model should match users’ conceptual model
– Queries should be easy and intuitive to write
• Expressiveness
– Include enough information to answer all important
queries
– Include all relevant data (without irrelevant data)
– Design must be within well-defined scope
• Performance
– An efficient physical design (DBA) should be possible
Conceptual Model
• Highest conceptual grouping of ideas
– Data tends to naturally cluster with data from the
same or similar categories relevant to the
organization
• The major relationships between
subjects have been defined
– Least amount of detail

8
Conceptual Model…

• Conceptual design
– Entity-Relationship (ER) Modeling
• Entities - “things” in the real world
– E.g. Car,Account, Product Car Account Product
• Attributes – property of an entity, entity type, or
relationship type Car Color
– E.g. color of a car, balance of an account, price of a product
•Relationships – between entities there can be
relationships, which also can have attributes
– E.g. Person owns Car
owns
Person Car

9
Conceptual Model to Reality

CS204 Database System 10


Systems Development Life Cycle.
Most systems development efforts follow a classical
Systems Development Life Cycle.
1. Project Identification - preliminary analysis of needs.
Feasibility study of project.
2. Project Initiation and Planning - identifies possible
approaches to solving the business need.
3. Analysis - identify the functional specifications for the business
needs - continue to confirm that the project is feasible.
4. Logical Design - detailed functional specifications in the form
of screen designs, report layout designs, data models, processing
rules, etc.

CS204 Database System 11


Systems Development Life Cycle.

5. Physical Design - programming, development of physical


data structures, redesigning parts of the organization to support
the new system.

6. Implementation - sometimes includes testing or testing


may be part of physical design. Includes a plan to cut over to
the new system. (Process of moving idea/ design from concepts
to reality)

7. Maintenance - continued modification of the system as the


firm's needs change.
CS204 Database System 12
Three-Schema Architecture.
This is the concept that there are different levels or views of the data that the firm uses.

Level 0--Reality. This is the actual real data that managers use.

Level 1--Conceptual Schema - also called a Conceptual Model.


This model is developed during the analysis stage of system development.
Typically this is some type of diagramming model of the data and the relationships
among the data. It is an abstractions of reality to focus on the data the firm uses for
specific applications.
Entity-Relationship Diagrams capture overall structure of the organization's data
(Purpose: Storing Data)

CS204 Database System 13


Three-Schema Architecture.
• Level 2--External Schema -- also termed a Logical Model.
– This model is developed during the design stage and represents the
actual implementation of the conceptual model with a specific DBMS
product.
– This includes table design and the application of rules for
Normalization of data and translating conceptual model into relations.

• Level 3--Physical or Internal Schema.


– This is created during the physical design and implementation phase.
– It includes the actual storage of data, creation of files that comprise the
database including indexes and other structures

14
For Logical Design
• Translate an ER schema into a relational schema.
– Entity
– Relationship
– Attribute
– Subtype

• Normalization
– To ensure you have a “good” design (Testing of your model).

CS204 Database System 15


SUMMARY OF ER-DIAGRAM NOTATION
Symbol Meaning

ENTITY TYPE

WEAK ENTITY TYPE

RELATIONSHIP TYPE

IDENTIFYING RELATIONSHIP TYPE

ATTRIBUTE

KEY ATTRIBUTE

MULTIVALUED ATTRIBUTE

COMPOSITE ATTRIBUTE

DERIVED ATTRIBUTE

E1 R E2 TOTAL PARTICIPATION OF E2 IN R

E1 N CARDINALITY RATIO 1:N FOR E1:E2 IN R


R E2

(min,max) STRUCTURAL CONSTRAINT (min, max) ON


R E PARTICIPATION OF E IN R
16
Example COMPANY Database – 1
• Requirements of the Company (over) simplified:
– The company is organized into DEPARTMENTs.
– Each department has a name, number and an employee who
manages the department.
– We keep track of the start date of the department manager.
– Each department controls a number of PROJECTs.
– Each project has a name, number and is located at a single
location.

17
Example COMPANY Database – 2.
 We store each EMPLOYEE’s social security number, address, salary,
gender, and birthdate.

 Each employee works for one department but may work on several projects.

 We keep track of the number of hours per week that an employee currently
works on each project.

 We keep track of each employee’s direct supervisor.

 Each employee may have a number of DEPENDENTs.

 For each dependent, we keep track of their name, gender, birthdate, and
relationship to employee.
18
We will aim to Draw ER DIAGRAM FOR THE COMPANY DATABASE

19
End

CS204 Database System 20

You might also like