0% found this document useful (0 votes)
2 views

Class Notes DBMS 1

The document provides an overview of databases, explaining the definitions of data, information, and database management systems (DBMS). It discusses the applications, users, characteristics, advantages, and disadvantages of DBMS, as well as different types of DBMS and their architectures. Additionally, it covers data models, the relational model, integrity constraints, and entity-relationship diagrams used in database design.

Uploaded by

fahathaat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Class Notes DBMS 1

The document provides an overview of databases, explaining the definitions of data, information, and database management systems (DBMS). It discusses the applications, users, characteristics, advantages, and disadvantages of DBMS, as well as different types of DBMS and their architectures. Additionally, it covers data models, the relational model, integrity constraints, and entity-relationship diagrams used in database design.

Uploaded by

fahathaat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Page |1

Introduction to Database
What is Database?
A database is an organized collection of data, generally stored and accessed
electronically from a computer system.

What is Data?
Data is a raw and unorganized fact that required to be processed to make it
meaningful. Data can be simple at the same time unorganized unless it is organized.
Generally, data comprises facts, observations, perceptions numbers, characters,
symbols, image, etc.

Data is always interpreted, by a human or machine, to derive meaning. So, data is


meaningless. Data contains numbers, statements, and characters in a raw form.

What is Information?
Information is a set of data which is processed in a meaningful way according to the
given requirement. Information is processed, structured, or presented in a given
context to make it meaningful and useful.

Information assigns meaning and improves the reliability of the data. It helps to ensure
undesirability and reduces uncertainty. So, when the data is transformed into
information, it never has any useless details.

Data vs Information
Page |2

Database Management System (DBMS)


The database management system (DBMS) is the software that interacts with end
users, applications, and the database itself to capture and analyze the data.

A general-purpose DBMS is designed to allow the definition, creation, querying,


update, and administration of databases.

Well-known DBMSs include MySQL, PostgreSQL, Microsoft SQL Server, Oracle, Sybase
and IBM DB2.

Database management systems are often classified according to the database model
that they support; the most popular database systems since the 1980s have all
supported the relational model as represented by the SQL language.

Application of DBMS
Sector Use of DBMS

Banking For customer information, account activities, payments,


deposits, loans, etc.

Airlines For reservations and schedule information.

Universities For student information, course registrations, colleges


and grades.

Telecommunication It helps to keep call records, monthly bills, maintaining


balances, etc.

Finance For storing information about stock, sales, and


purchases of financial instruments like stocks and
bonds.
Page |3

Sales Use for storing customer, product & sales information.

Manufacturing It is used for the management of supply chain and for


tracking production of items. Inventories status in
warehouses.

HR Management For information about employees, salaries, payroll,


deduction, generation of paychecks, etc.

Users in a DBMS environment


Following, are the various category of users of a DBMS system

Component Name Task

Application Programmers The Application programmers write programs in


various programming languages to interact with
databases.

Database Administrators Database Admin is responsible for managing the entire


DBMS system. He/She is called Database admin or
DBA.

End-Users The end users are the people who interact with the
database management system. They conduct various
operations on database like retrieving, updating,
deleting, etc.

Characteristics of Database Management System


 Provides security and removes redundancy
 Self-describing nature of a database system
 Insulation between programs and data abstraction
Page |4

 Support of multiple views of the data


 Sharing of data and multiuser transaction processing
 DBMS allows entities and relations among them to form tables.
 DBMS supports multi-user environment that allows users to access and
manipulate data in parallel.

Components of a DBMS
 Buffer management
 Stored data manager
 DDL compiler
 Interactive query interface
 Query compiler
 Query optimizer
 Pre-compiler
 Runtime database processor
 System catalog
 Concurrency control system
 Backup and recovery system

Advantages of DBMS
 DBMS offers a variety of techniques to store & retrieve data
 DBMS serves as an efficient handler to balance the needs of multiple
applications using the same data
 Uniform administration procedures for data
 A DBMS uses various powerful functions to store and retrieve data efficiently.
 Offers Data Integrity and Security
Page |5

 The DBMS implies integrity constraints to get a high level of protection against
prohibited access to data.
 A DBMS schedules concurrent access to the data in such a manner that only one
user can access the same data at a time
 Reduced Application Development Time

Disadvantage of DBMS
DBMS may offer plenty of advantages but, it has certain flaws-

 Cost of Hardware and Software of a DBMS is quite high which increases the
budget of your organization.
 Most database management systems are often complex systems, so the training
for users to use the DBMS is required.
 In some organizations, all data is integrated into a single database which can be
damaged because of electric failure or database is corrupted on the storage
media
 Use of the same program at a time by many users sometimes lead to the loss of
some data.

Types of DBMS
Four Types of DBMS systems are:

 Hierarchical, Network, Relational & Object-Oriented DBMS

Hierarchical DBMS

In a Hierarchical database, model data is organized in a tree-like structure. Data is


Stored Hierarchically (top down or bottom up) format. Data is represented using a
parent-child relationship. In Hierarchical DBMS parent may have many children, but
children have only one parent.

Network Model
Page |6

The network database model allows each child to have multiple parents. It helps you
to address the need to model more complex relationships like as the orders/parts
many-to-many relationship. In this model, entities are organized in a graph which can
be accessed through several paths.

Relational model

Relational DBMS is the most widely used DBMS model because it is one of the easiest.
This model is based on normalizing data in the rows and columns of the tables.
Relational model stored in fixed structures and manipulated using SQL.

Object-Oriented Model

In Object-oriented Model data stored in the form of objects. The structure which is
called classes which display data within it. It defines a database as a collection of
objects which stores both data members values and operations.
Page |7

DBMS Architecture
DBMS architecture helps in design, development, implementation, and maintenance
of a database. A database stores critical information for a business.

Selecting the correct Database Architecture helps in quick and secure access to this
data.

1 tier Architecture

2-tier Architecture

3-tier Architecture

1 tier Architecture
The simplest of Database Architecture are 1 tier where the Client, Server, and
Database all reside on the same machine.

In 1-tier architecture, the DBMS is the only entity where the user directly sits on the
DBMS and uses it. Any changes done here will directly be done on the DBMS itself. It
does not provide handy tools for end-users. Database designers and programmers
normally prefer to use single-tier architecture.

2 tier Architecture
If the architecture of DBMS is 2-tier, then it must have an application through which
the DBMS can be accessed.

A two-tier architecture is a database architecture where

1. Presentation layer runs on a client (PC, Mobile, Tablet, etc)


2. Data is stored on a Server.

3-tier Architecture
A 3-tier architecture separates its tiers from each other based on the complexity of
the users and how they use the data present in the database. It is the most widely
used architecture to design a DBMS.

3-tier schema is an extension of the 2-tier architecture. 3-tier architecture has


following layers
Page |8

1. Presentation layer (your PC, Tablet, Mobile, etc.)


2. Application layer (server)
3. Database Server

Data Models
Data models define how the logical structure of a database is modeled. Data Models
are fundamental entities to introduce abstraction in a DBMS. Data models define how
data is connected to each other and how they are processed and stored inside the
system.

The very first data model could be flat data-models, where all the data used are to be
kept in the same plane. Earlier data models were not so scientific, hence they were
prone to introduce lots of duplication and update anomalies.

Entity-Relationship Model
Entity-Relationship (ER) Model is based on the notion of real-world entities and
relationships among them. The ER Model creates entity set, relationship set, general
attributes and constraints.
ER Model is best used for the conceptual design of a database.
ER Model is based on −
 Entity − An entity in an ER Model is a real-world entity having properties
called attributes. Every attribute is defined by its set of values called domain.
For example, in a school database, a student is considered as an entity. Student
has various attributes like name, age, class, etc.
 Relationship − The logical association among entities is called relationship.
Relationships are mapped with entities in various ways. Mapping cardinalities
define the number of association between two entities.
Mapping cardinalities −

o one to one
o one to many
o many to one
o many to many
Page |9

What is Relational Model


The relational model represents the database as a collection of relations. A relation is
nothing but a table of values. Every row in the table represents a collection of related
data values. These rows in the table denote a real-world entity or relationship.

Relational data model is the primary data model, which is used widely around the
world for data storage and processing. This model is simple and it has all the
properties and capabilities required to process data with storage efficiency.

Concepts
1. Attribute: Each column in a Table. Attributes are the properties which define a
relation. e.g., Student_Rollno, NAME,etc.
2. Tables – In the Relational model the, relations are saved in the table format. It is
stored along with its entities. A table has two properties rows and columns. Rows
represent records and columns represent attributes.
3. Tuple – It is nothing but a single row of a table, which contains a single record.
4. Relation Schema: A relation schema represents the name of the relation with its
attributes.
5. Degree: The total number of attributes which in the relation is called the degree of
the relation.
6. Cardinality: Total number of rows present in the Table.
P a g e | 10

7. Column: The column represents the set of values for a specific attribute.
8. Relation instance – Relation instance is a finite set of tuples in the RDBMS system.
Relation instances never have duplicate tuples.
9. Relation key - Every row has one, two or multiple attributes, which is called
relation key.
10. Attribute domain – Every attribute has some pre-defined value and scope which is
known as attribute domain

Constraints
Every relation has some conditions that must hold for it to be a valid relation. These
conditions are called Relational Integrity Constraints. There are three main integrity
constraints −

 Key constraints
 Domain constraints
 Referential integrity constraints
Key Constraints
There must be at least one minimal subset of attributes in the relation, which can
identify a tuple uniquely. This minimal subset of attributes is called key for that
relation.
Key constraints force that −
 In a relation with a key attribute, no two tuples can have identical values for key
attributes.
 A key attribute cannot have NULL values.
Domain Constraints
Attributes have specific values in real-world scenario. For example, age can only be a
positive integer. The same constraints have been tried to employ on the attributes of
a relation. Every attribute is bound to have a specific range of values.
For example, age cannot be less than zero and telephone numbers cannot contain a
digit outside 0-9.
P a g e | 11

Referential integrity Constraints


Referential integrity constraints work on the concept of Foreign Keys. A foreign key is
a key attribute of a relation that can be referred in other relation.
Referential integrity constraint states that if a relation refers to a key attribute of a
different or same relation, then that key element must exist.

ER Diagram Representation

The ER Model is represented by means of an ER diagram.

ENTITY-RELATIONSHIP DIAGRAM (ERD) displays the relationships of entity set stored


in a database. In other words, we can say that ER diagrams help you to explain the
logical structure of databases.

Components of the ER Diagram


This model is based on three basic concepts:

 Entities
 Attributes
 Relationships

Entity
Entities are represented by means of rectangles. Rectangles are named with the
entity set they represent.

Attributes
Attributes are the properties of entities. Attributes are represented by means of
ellipses. Every ellipse represents one attribute and is directly connected to its entity
(rectangle).
P a g e | 12

Types of Attributes Description

Simple attribute Simple attributes can't be divided any further.


For example, a student's contact number. It is
also called an atomic value.

Composite attribute It is possible to break down composite attribute.


For example, a student's full name may be
further divided into first name, second name,
and last name.

Derived attribute This type of attribute does not include in the


physical database. However, their values are
derived from other attributes present in the
database. For example, age should not be
stored directly. Instead, it should be derived
from the DOB of that employee.

Multivalued attribute Multivalued attributes can have more than one


values. For example, a student can have more
than one mobile number, email address, etc.
P a g e | 13

If the attributes are composite, they are further divided in a tree like structure.
Every node is then connected to its attribute. That is, composite attributes are
represented by ellipses that are connected with an ellipse.

Multivalued attributes are depicted by double ellipse.


P a g e | 14

Derived attributes are depicted by dashed ellipse.

Relationship
Relationships are represented by diamond-shaped box. Name of the relationship is
written inside the diamond-box. All the entities (rectangles) participating in a
relationship, are connected to it by a line.

Binary Relationship and Cardinality


A relationship where two entities are participating is called a binary relationship.
Cardinality is the number of instance of an entity from a relation that can be
associated with the relation.
One-to-one − When only one instance of an entity is associated with the relationship,
it is marked as '1:1'. The following image reflects that only one instance of each entity
should be associated with the relationship. It depicts one-to-one relationship.
P a g e | 15

One-to-many − When more than one instance of an entity is associated with a


relationship, it is marked as '1:N'. The following image reflects that only one instance
of entity on the left and more than one instance of an entity on the right can be
associated with the relationship. It depicts one-to-many relationship.

Many-to-one − When more than one instance of entity is associated with the
relationship, it is marked as 'N:1'. The following image reflects that more than one
instance of an entity on the left and only one instance of an entity on the right can be
associated with the relationship. It depicts many-to-one relationship.

Many-to-many − The following image reflects that more than one instance of an entity
on the left and more than one instance of an entity on the right can be associated with
the relationship. It depicts many-to-many relationship.

You might also like