You are on page 1of 16

Level I – Semester I

BEC 1201
Database
Management
Systems
1. Introduction to Database Systems
1.1 Introduction
 What is a Data?
Data is the collection of raw facts and figures. It is without any proper meaning.
Data may be collection of words, numbers, graphics or sounds
Eg : Student Data on Admission Forms
When students get admission in a college, they fill admission form. This
form contains raw facts (data of student) like name, father’s name, address
of student etc.

 What is an Information?
Processed data is called information. When raw facts and figures are processed
and arranged in some order then they become information. Information has
proper meanings.
Eg : Student Address Labels
Stored data of students can be used to print address labels of students
 What is a Database?
Collection of data (related to a particular subject or purpose) that is stored in
a computer system.
Eg : Student Database, Library Database, Payroll Database

 What is a Database Management System (DBMS)?


Collection of programs that enables to store, modify, and extract information
from a database.
Eg : Oracle, IBM DB2, Informix, MySQL, Microsoft SQL Server, Microsoft Access

1.2 Database Models


Logical structure of a database determines in which manner data can be
stored, organized, and manipulated.

Types of Database Models


▪ Hierarchical model ▪ Object-oriented model
▪ Network model ▪ Object-relational model
▪ Relational model
 Hierarchical Database Model
- Data is organized into a tree-like structure.
- Data is stored as records which are connected to one another through links.

- Each child record has only one parent, whereas each parent record can have
one or more child records.
- At the top of hierarchy there is only one entity which is called Root.
- In order to retrieve data from a hierarchical database the whole tree needs to
be traversed starting from the root node.
 Network Database Model
- In the network model, entities are organized in a graph structure.
- Allows each record to have multiple parent and child records.
- Entities can be accessed through several paths.
 Relational Database Model
- In the relational model, all data is represented in terms of tuples (records),
grouped into relations (tables).
- A table has rows and columns, where rows represent records and columns
represent the attributes.
- Most relational databases use the SQL data definition and query language.
 Object Oriented Database Model
- Information is represented in the form of objects as used in object-oriented
programming.
- Each real-world entity is modeled by an object.
- Each object is associated with a unique identifier that makes the object
different from other objects.
- Each object has a set of attributes (properties) and methods (operations)
- The attribute values represent the object’s status.
1.3 Steps of Designing a Database
6 main steps in designing a database

1. Requirements Analysis Identify user needs and what must database do

Identify the Entities, Attributes, Relationships


2. Conceptual Design
and draw ER (Entity- Relationship) diagram
ERD
Translate ER diagram into DBMS data models
3. Logical Design
(tables)

4. Schema Refinement Normalization (minimize data redundancy)


1NF, 2NF, 3NF, 4NF, 5NF

5. Physical Design Implement the database in a DBMS

Define access controls (who accesses what, and


6. Security Design
how)
1.4 Entity-Relationship Diagrams
Entity-Relationship Diagram (ERD) illustrate the logical structure of a database.

ER Diagram Notations
▪ Entity : Object that we wish to store information.
Entity
Eg : Employee, Department

▪ Week Entity : Entity that cannot be uniquely identified by its attributes alone.
Entity that depends on another entity. Week Entity

Eg : Employee and Dependents

▪ Attribute : Describe the characteristics of an entity. Attribute


Eg : Employee Name, Salary, Address

▪ Key Attribute : Attribute that uniquely identify an entity. Key Attribute


Eg : Employee Number

▪ Multivalued Attribute : Attribute, can have multiple values. Multivalued


Attribute
Eg : Multiple Phone Numbers, Multiple Degrees
▪ Derived Attribute : Attribute whose value is derived from other attributes Derived
Attribute
Eg : Age derived from Date of Birth
Attribute1 Attribute2

▪ Composite Attribute : An attribute can also have their own attributes. Attribute
Eg : Name consist of FirstName and LastName
Entity

▪ Relationship : Describe how two entities related to each other.


Relationship
Eg : Employee and Department

▪ Cardinality : How many instances of an entity relate to one instance of another entity.

(One-to-one, One-to-many, Many-to-many)


Salary DeptNo
Phn_Num
EmpNo

N Works 1
Employee Department
At

Name
DOB
DeptName
Age FName LName
1.5 Normalizations
- Database Normalization is a technique of organizing the data in the database.
- Database is modified to minimize redundancy and dependency of data.
- Normalization split a large table into smaller tables and define relationships between
data.

 First Normal Form (1NF)


Each column is unique (Remove multivalued attributes)
Eg :
 Second Normal Form (2NF)
- A relation is in 2NF if and only if it is in 1NF and every non-key attribute is fully
functionally depended on the primary key.
Eg :
 Third Normal Form (3NF)
- A relation is in 3NF if and only if it is in 2NF and every non-key attribute must be
non-transitively dependent on the primary key.
- 3NF is achieved are considered as the database is normalized.
Eg :
 Boyce-Codd Normal Form (BCNF)
- This is a higher version of the Third Normal form.
- A relation is in Boyce-Codd Normal Form if it is in 3NF and only if every determinant is a
candidate key (column or a combination of columns that can qualify as unique key).
Eg :
 Forth Normal Form (4NF)
- Tables cannot have multivalued dependencies on Primary Key
Eg : Employee may have several skills and several languages.
We have 2 relationships (many-to-many relationships), one between employees and
skills, other between employees and languages.
Under fourth normal form, these two relationships should not be represented in a single

record.
 Fifth Normal Form (5NF)
- A relation is in 5NF if it is in 4NF and contains no join dependencies.
Eg :

You might also like