DATABASE SYSTEM ENVIRONMENT:
Data model:
• A data model is a collection of concepts that can be used to describe the
structure of a database
• Data modeling in the first step in designing a database refers to the
process of creating a specific data model for a problem.
• A model is an abstraction of a real world object. A data model represents
data structures and their characteristics, relations, constraints and
transactions.
• Data model is an iterative process we start with a simple understanding of
the problem increases, and finally design a database in a specific database
model.
• Data Model basic building blocks:
• The basic building blocks of data models are entities, attributes,
relationships and constraints. An entity represents a real world object
person (or) place.
For e.g., a customer entity have different of customers.
An attribute is a characteristic of an entity.
For e.g. customer entity have attributes customer_no, customer_name,
customer_address etc. A relationship describes an association between
entities. Data models use three types of associations. One-to-many, many-
to-many and one-to-one.
• One-to-many (1:M, 1…..*): A painter paints many different paintings.
Therefore,the database designer label the relationship PAINTER PAINTS
PAINTINGS as one-tomany.
• Many-to-many (M:N, *…….*): An employee may learn many job skills and
each job skill may be learned by many employees. Therefore, the database
designer label the relationship Employee learns skills as many-to-many
(M:N).
• One-to-one (1:1, 1…….1): Each store manager manages only a single store.
Therefore, the data designer label the relationship employee manages stores
as oneto-one (1:1).
• TYPES OF DATA MODELS :
• he hierarchical model
was developed in the 1960s to manage large amounts of data for complex manufacturing
projects .
Its basic logical structure is represented by an upside-down tree.
The hierarchical structure contains levels, or segments.
A segment is the equivalent of a file system’s record type.
Within the hierarchy, a higher layer is perceived as the parent of the segment directly
beneath it, which is called the child.
The hierarchical model depicts a set of one-to-many (1:M) relationships between a parent
and its children segments. (Each parent can have many children, but each child has only
one parent.)
In the hierarchical model, segments pointed to by the logical association are called the child
segment and the other segment is called the parent segment. If there is a segment
without a parent is then that will be called the root and the segment which has no children
are called the leaves.
The main disadvantage of the hierarchical model is that it can have one-to-one and one-to-
many relationships between the nodes.
• Advantages of the hierarchical model
As the database is based on this architecture the
relationships between various layers are logically simple so,
it has a very simple hierarchical database structure.
Disadvantages of the hierarchical model
Even though this model is conceptually simple and easy to
design at the same time it is quite complex to implement.
This model also lacks flexibility as the changes in the new
tables or segments
Network Model
• The main difference between this model and the hierarchical model is that
any record can have several parents in the network model. It uses a graph
instead of a hierarchical tree
• The hierarchical model is extended in the network model. Prior to the
relational model, it was the most popular model.
• To increase database performance and standards, the network model was
devised to express complicated data relationships more effectively than
hierarchical models.
• It has entities that are grouped in a graphical format, and some of the
entities can be reached by many paths.
• Example
• We can observe that the node student has
two parents, CSE Department and Library, in
the example below. In the hierarchical model,
this was previously impossible.
• Features of a Network Model
• 1. Multiple Paths
• There may be several paths to the same record due to the increased
number of relationships. It allows for quick and easy data access.
• 2. The Ability to Merge More Relationships
• Data is more connected in this model since there are more
relationships.
• This paradigm can handle many-to-many as well as one-to-one
relationships.
• 3. Circular Linked List
• The circular linked list is used to perform operations on the network
model.
Relational Model
• The data in this model is kept in the form of a table that is two-
dimensional.
• All of the data is kept in the form of rows and columns. Tables are
the foundation of a relational paradigm. If you wish to learn more
about the
• In DBMS, the relational model refers to an abstract model that we
use to manage and organise the data that gets stored in a database.
• Thus, it stores information in inter-related two-dimensional tables,
also called relations, in which every row represents some entity
while every column represents the entity’s properties.
• A relational model represents how we can store
data in Relational Databases. Here, a relational
database stores information in the form of
relations or tables.
• Now, let us consider a relation EMPLOYEE with
attributes ID_NO, NAME, ADDRESS, ROLL_NO,
and AGE shown in this table:
Classification of DBMS
• Classification of DBMS
• Single user –it can support only one user at a time.
• It is mostly used with the personal computer on which the data resides
accessible to a single person.
• Multiple users – It supports multiple users concurrently.
• Centralized database system – The DBMS and database are
stored at the single site that is used by several other systems
too.
• We can simply say that data here is maintained on the
centralized server.
• Parallel network database system – This system has the
advantage of improving processing input and output speeds.
• Majorly used in the applications that have query to larger
database.
• It holds the multiple central processing units and data storage
disks in parallel.
• Distributed database system – In this data and the DBMS
software are distributed over several sites but connected to
the single computer.
Homogeneous DBMS – They use same software but from the
multiple sites.
Data exchange between the sites can be handled easily.
• heterogeneous DBMS – They use different DBMS software for
different sites but there is a additional software that helps the
exchange of the data between the sites.
• Client-server database system – This system has two logical
components namely client and server.
• Clients are generally the personal computers or workstations
whereas
• servers are the large workstations, mini range computers or a
main frame computer system.
• The applications and tools of the DBMS run on the client
platforms and the DBMS software on the server.
• Both server and client computers are connected over the
network.
• Multi-tier client-server database system – The rise of
personal computers in business has increased the reliability of
the network hardware leading to evolution of two-tier and
three-tier systems which use different software for the client
and software.
ER DATA MODELS OR ER DIAGRAM:
• ER model describes entities, attributes and relationships.
•
– Entity: The entitiy is the real world object. In the ER model the
basic object is an entity. The entity is represented by the
symbol.
• Ex: Person, Customer, Employee, Student.
– Attribute: The attributes are the properties of entity.
The attribute is represented by Oval. The ovals are
connected to the rectangle through ilnes.
•
• Ex: The attributes of EMPLOYEE entity in emp-name, age,
address, salary and job.
• Serveral types of attributes in ER model: There are 4 types of
attributes in ER model.
• Simple versus composite attribute
• Single valued versus multivalued
• Stored versus desired.
• Simple attribute: The attributes which are not divisible are
called simple attributes. These are represented by
•
• Ex: SSN (Social Security Number)
•
• Composite attribute: The attributes which are divided into
small sub parts are called composite attributes. It is
represented as
• Single valued versus multivalued attributes:
• Single valued attributes: The attributes having single values
are called single values attribute.
• Ex: SSN,aadhar.
• Multivalued attributes: The attributes containing set of values
for the same entity are called multivalued attributes. These
are represented by
• Ex: Car-color, phone_number.
Stored versus derived attribute:
• Stored attribute: The values are getting from the attributes
are known as stored attribute.
• Ex: DOB.
• Derived attribute: The values of these attributes are derived
from stored attribute. These are represented by
• Ex: Age.
• Null values for an attribute: Null values are used if we don’t
know the values of an attribute for a particular entity.
Entity types, Entity sets, keys and value sets:
• Entity types: It is defined as a collection of entities that have
the same attributes. The attributes are having own values
•
Ex:
• Entity set: The collection of all entities of a particular entity
type is called an entity set.
• Ex: EMPLOYEE.
•
• Key attribute of an entity type: An entity has an attribute
whose values are distinct for each individual entity in the
entity set.
• Such an attribute is called as key attribute.
• The key attribute has its name underlined inside the oval.
• Value sets of attribute: Each attribute associated with a value
set.
• Ex: If the employee age allowed between 16 to 70, we can
specify the value set of age attribute of employee to be set
integer number between 16 to 70.
• Initial conceptual design of the company database:
• An entity department with attributes are Name, Number, Location,
Manager, Manager-start-date.
• Key attributes – Name, Number.
• Multi-valued – Location.
• An entity project with attributes are Number, Name,
Location, controlling dept.
• Key attributes – Number, Name.
•
• An entity employee with the attributes are SSN, Name,
Gender, Salary, Birthdate, Sunpervisor, Address,
Department, Works-on.
• Key attributes – SSN
• Multi-valued attributes – Works-on Compostite
attributes – Name, Address.
• An entity dependent with attributes are dependent name,
Gender, Birth_date and Relationship.