0% found this document useful (0 votes)
3 views41 pages

Databases Notes

The document compares traditional file systems with database systems, highlighting the disadvantages of file systems such as data redundancy, inconsistency, and lack of integration. It outlines the advantages of database systems, including controlled redundancy, data consistency, and improved security. Additionally, it discusses various data models, including hierarchical, network, entity-relationship, and relational models, along with their features, advantages, and disadvantages.

Uploaded by

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

Databases Notes

The document compares traditional file systems with database systems, highlighting the disadvantages of file systems such as data redundancy, inconsistency, and lack of integration. It outlines the advantages of database systems, including controlled redundancy, data consistency, and improved security. Additionally, it discusses various data models, including hierarchical, network, entity-relationship, and relational models, along with their features, advantages, and disadvantages.

Uploaded by

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

Traditional file system Versus database systems

• Traditionally, the data were stored and processed using file processing
systems.
• In these traditional file systems, each file is independent of other file, and
data in different files can be integrated only by writing individual program
for each application.
• The data and the application programs that uses the data are so arranged
that any change to the data requires modifying all the programs that uses
the data. This is because each file is hard-coded with specific
information like data type, data size etc
Traditional file system Versus database systems

• This organization is simple to operate and better local control but the data
of the organization is dispersed throughout the functional sub-systems.
• These days, databases are preferred because of many disadvantages of
traditional file systems.
Disadvantages of Traditional File System
• Data Redundancy : Since each application has its own data file, the same
data may have to be recorded and stored in many files. For example,
personal file and payroll file, both contain data on employee name,
designation etc. The result is unnecessary duplicate or redundant data
items. This redundancy requires additional or higher storage space, costs
extra time and money, and requires additional efforts to keep all files upto-
date.
• Data Inconsistency : Data redundancy leads to data inconsistency
especially when data is to be updated. Data inconsistency occurs due to the
same data items that appear in more than one file do not get updated
simultaneously in each and every file. For example, an employee is
promoted from Clerk to Superintendent and the same is immediately
updated in the payroll file may not necessarily be updated in provident
fund file.
Disadvantages of Traditional File System
• Lack of Data Integration : Since independent data file exists, users
face difficulty in getting information on any ad hoc query that
requires accessing the data stored in many files. In such a case
complicated programs have to be developed to retrieve data from
every file or the users have to manually collect the required
information.
• Program Dependence : The reports produced by the file processing
system are program dependent, which means if any change in the
format or structure of data and records in the file is to be made, the
programs have to modified correspondingly. Also, a new program will
have to be developed to produce a new report.
Disadvantages of Traditional File System
• Data Dependence : The Applications/programs in file processing
system are data dependent i.e., the file organization, its physical
location and retrieval from the storage media are dictated by the
requirements of the particular application.
• Limited Data Sharing : There is limited data sharing possibilities with
the traditional file system. Each application has its own private files
and users have little choice to share the data outside their own
applications. Complex programs required to be written to obtain data
from several incompatible files.
Disadvantages of Traditional File System
• Problem of Security : It is very difficult to enforce security checks and
access rights in a traditional file system, since application programs
are added in an adhoc manner.
• Needs Excessive Programming : An excessive programming effort
was needed to develop a new application program due to very high
interdependence between program and data in a file system. Each
new application requires that the developers start from the scratch by
designing new file formats and descriptions and then write the file
access logic for each new file.
Advantages of Database Systems (DBMS’s)
• Controlled redundancy : In a traditional file system, each application
program has its own data, which causes duplication of common data items
in more than one file. We cannot eliminate all redundancy due to technical
reasons. But in a database, this duplication can be carefully controlled, that
means the database system is aware of the redundancy and it assumes the
responsibility for propagating updates.
• Data consistency : The problem of updating multiple files in traditional file
system leads to inaccurate data as different files may contain different
information of the same data item at a given point of time. This causes
incorrect or contradictory information to its users. In database systems,
this problem of inconsistent data is automatically solved by controlling the
redundancy.
Advantages of Database Systems (DBMS’s)
• Program data independence : The traditional file systems are generally
data dependent, which implies that the data organization and access
strategies are dictated by the needs of the specific application and the
application programs are developed accordingly. However, the database
systems provide an independence between the file system and application
program, that allows for changes at one level of the data without affecting
others. This property of database systems allow to change data without
changing the application programs that process the data.
• Sharing of data : In database systems, the data is centrally controlled and
can be shared by all authorized users. The sharing of data means not only
the existing applications programs can also share the data in the database
but new application programs can be developed to operate on the existing
data. Furthermore, the requirements of the new application programs may
be satisfied without creating any new file.
Advantages of Database Systems (DBMS’s)
• Improved data integrity : Data integrity means that the data
contained in the database is both accurate and consistent. The
centralized control property allow adequate checks can be
incorporated to provide data integrity. One integrity check that should
be incorporated in the database is to ensure that if there is a
reference to certain object, that object must exist.
• Improved security : Database security means protecting the data
contained in the database from unauthorized users. The DBA ensures
that proper access procedures are followed, including proper
authentical schemes for access to the DBMS and additional checks
before permitting access to sensitive data. The level of security could
be different for various types of data and operations
Advantages of Database Systems (DBMS’s)
• Concurrency control : The database systems are designed to manage
simultaneous (concurrent) access of the database by many users.
They also prevents any loss of information or loss of integrity due to
these concurrent accesses.
• Data access is efficient : The database system utilizes different
sophisticated techniques to access the stored data very efficiently.
Disadvantages of Database Systems
• Complexity increases : The data structure may become more complex
because of the centralised database supporting many applications in
an organization. This may lead to difficulties in its management and
may require professionals for management.
• Cost of conversion : The cost of conversion from old file-system to
new database system is very high. In some cases the cost of
conversion is so high that the cost of DBMS and extra hardware
becomes insignificant. It also includes the cost of training manpower
and hiring the specialized manpower to convert and run the system.
Disadvantages of Database Systems
• Need of additional and specialized manpower : Any organization
having database systems, need to be hire and train its manpower on
regular basis to design and implement databases and to provide
database administration services.
• Additional cost of hardware : The cost of database system’s
installation is much more. It depends on environment and
functionality, size of the hardware and maintenance costs of
hardware.
Database schemas
• A schema is plan of the database that give the names of the entities
and attributes and the relationship among them. A schema includes
the definition of the database name, the record type and the
components that make up the records. Alternatively, it is defined as a
frame-work into which the values of the data items are fitted
Data models
• A data model is a collection of concepts that can be used to describe the
structure of the database including data types, relationships and the
constraints that apply on the data.
• A data model supports communication between the users and database
designers. The major use of data model is to understand the meaning of
the data and to facilitate communication about the user requirements.
• Data Model gives us an idea that how the final system will look like after its
complete implementation. It defines the data elements and the
relationships between the data elements. It used to show how data is
stored, connected, accessed and updated in the database system.
Data models
• We use a set of symbols and text to represent the information so that
members of the organization can communicate and understand it.
• There are many data models being used nowadays but the Relational
model is the most widely used model.
• Other many data model some data models in use are:
• Hierarchical Model
• Network Model
• Entity-Relationship Model
Types of Data Models
• Hierarchical Data Model
• Hierarchical Model was the first DBMS model.
• Organizes the data in the hierarchical tree structure.
• The hierarchy starts from the root/Parent which has root data and then it
expands in the form of a tree adding child node to the parent node.
• This model easily represents some of the real-world relationships like food
recipes, sitemap of a website etc.
Hierarchical Data Model
Features of a Hierarchical Model
• One-to-many relationship: The data here is organised in a tree-like structure
where the one-to-many relationship is between the datatypes. Also, there can
be only one path from parent to any node.
• Parent-Child Relationship: Each child node has a parent node but a parent
node can have more than one child node. Multiple parents are not allowed.
• Deletion Problem: If a parent node is deleted then the child node is
automatically deleted.
Hierarchical Data Model
Advantages of Hierarchical Model
• It is very simple and fast to traverse through a tree-like structure.
• Any change in the parent node is automatically reflected in the child node so,
the integrity of data is maintained.
Disadvantages of Hierarchical Model
• Complex relationships are not supported.
• As it does not support more than one parent of the child node so if we have
some complex relationship where a child node needs to have two parent
node then that can't be represented using this model.
• If a parent node is deleted then the child node is automatically deleted
Network Model
Network Model
• An extension of the hierarchical model. It was the most popular model before the
relational model.
• This model is the same as the hierarchical model, the only difference is that a record
can have more than one parent.
Network Model
Features of a Network Model
• Ability to Merge more Relationships: In this model, as there are more
relationships so data is more related. This model has the ability to manage
one-to-one relationships as well as many-to-many relationships.
• Many paths: As there are more relationships so there can be more than one
path to the same record. This makes data access fast and simple.
Network Model
Advantages of Network Model
• The data can be accessed faster as compared to the hierarchical model. This is
because the data is more related in the network model and there can be
more than one path to reach a particular node. So the data can be accessed in
many ways.
• As there is a parent-child relationship so data integrity is present. Any change
in parent record is reflected in the child record.
Disadvantages of Network Model
• As more and more relationships need to be handled the system might get
complex. So, a user must be having detailed knowledge of the model to work
with the model.
• Any change like updating, deletion, insertion is very complex.
Entity-Relationship Model
Entity-Relationship Model
• Entity-Relationship Model or simply ER Model is a high-level data
model diagram.
• In this model, we represent the real-world problem in the pictorial
form to make it easy for the stakeholders to understand.
• It is also very easy for the developers to understand the system by
just looking at the ER diagram.
• We use the ER diagram as a visual tool to represent an ER Model.
Entity-Relationship Model
ER diagram has the following elements
• Entities: Entity is a real-world thing. It can be a person, place, or even a
concept. Example: Teachers, Students, Course, Building, Department, etc are
some of the entities of a School Database.

• Attributes: An entity contains a real-world property called attribute. This is


the characteristics of that attribute. Example: The entity teacher has the
property like teacher id, salary, age, etc.

• Relationship: Relationship tells how two attributes are


related. Example: Teacher works for a department.
Entity-Relationship Model

• The two entities are connected using the relationship


Entity-Relationship Model
Features of ER Model
• Graphical Representation for Better Understanding: It is very easy and
simple to understand so it can be used by the developers to communicate
with the stakeholders.

• ER Diagram: ER diagram is used as a visual tool for representing the model.

• Database Design: This model helps the database designers to build the
database and is widely used in database design.
Entity-Relationship Model
Advantages of ER Model
• Simple: Conceptually ER Model is very easy to build. If we know the
relationship between the attributes and the entities we can easily build the
ER Diagram for the model.
• Effective Communication Tool : This model is used widely by the database
designers for communicating their ideas.
• Easy Conversion to any Model : This model maps well to the relational model
and can be easily converted relational model by converting the ER model to
the table. This model can also be converted to any other model like network
model, hierarchical model etc
Entity-Relationship Model
Disadvantages of ER Model
• No industry standard for notation: There is no industry standard for
developing an ER model. So one developer might use notations which are not
understood by other developers.

• Hidden information: Some information might be lost or hidden in the ER


model. As it is a high-level view so there are chances that some details of
information might be hidden.
Relational Model
Relational Model
• Relational Model is the most widely used model.
• In this model, the data is maintained in the form of a two-dimensional
table.
• All the information is stored in the form of row and columns.
• The basic structure of a relational model is tables. So, the tables are
also called relations in the relational model.
Relational Model
• Example: Employee table
Data Table 1: Project Table Data Table 2: Department Table
Dept. Number Dept. Name Manager SSN

257 Accounting 421-55-99993

632 Manufacturing 765-00-3192

598 Marketing 098-40-1370

Data Table 3: Manager Table


SSN Last Name First Name Hire Date Dept. Number

005-10-6321 Johns Francine 10-7-65 257

549-77-1001 Buckley Bill 2-17-79 650

098-40-1370 Fiske Steven 1-5-85 598


Relational Model
Features of Relational Model
• Tuples : Each row in the table is called tuple. A row contains all the
information about any instance of the object. In the above example, each row
has all the information about any specific individual like the first row has
information about John.

• Attribute or field: Attributes are the property which defines the table or
relation. The values of the attribute should be from the same domain. In the
above example, we have different attributes of the employee like Salary,
Mobile_no, etc.
Relational Model
Advantages of Relational Model
• Simple: This model is more simple as compared to the network and
hierarchical model.
• Scalable: This model can be easily scaled as we can add as many rows
and columns we want.
• Structural Independence: We can make changes in database
structure without changing the way to access the data.
• When we can make changes to the database structure without
affecting the capability to DBMS to access the data we can say that
structural independence has been achieved.
Relational Model
Disadvantages of Relational Model
• Hardware Overheads: For hiding the complexities and making things
easier for the user this model requires more powerful hardware
computers and data storage devices.
• Bad Design: As the relational model is very easy to design and use. So
the users don't need to know how the data is stored in order to
access it. This ease of design can lead to the development of a poor
database which would slow down if the database grows.
But all these disadvantages are minor as compared to the advantages
of the relational model. These problems can be avoided with the help
of proper implementation and organization.
Which Data Models to use?
• We have large number of data models, the one which is best for the
Organization depends upon the following factors:

• Is the database too small or too big.


• What are the costs involved.
• The volume of daily transactions that will be done.
• The estimated number of queries that will be made from the database by the
organization to enquire about the data.
• The data requirements of the organization using it.
Which Data Models to use?
• From the available record based data models, the relational data
model is most commonly used model by most of the organizations
because of the following reasons:
• It increases the productivity of application programmers in designing the
database. Whenever changes are made to the database there is no need of
changing the application programs because of separation of logical level from
conceptual level.
• It is useful for representing most of the real world objects and relationships
between them.
• It provides very powerful search, selection and maintenance of data.
• It hides the physical level details from the end users so end users are not
bothered by physical storage.
• It provides data integrity and security so that data is not accessed by
unauthorized users and data is always accurate.
• It provides adhoc query capability.
Types of database systems
• The database systems can be classified into three categories i.e.,
• According to the number of users
(a) Single-user database systems : In a single user database system, the
database reside on a PC–on the hard disk. All the applications run on the
same PC and directly access the database.
(b) Multiuser database systems : In a multiuser database system, many PC’s
are connected through a Local Area Network (LAN) and a file server stores a
copy of the database files. Each PC on the LAN is given a volume name on
the file server. Applications run on each PC that is connected to the LAN and
access the same set of files on the file server
Types of database systems
• According to the Type of use
• Production or Transactional Database Systems : The production database
systems are used for management of supply chain and for tracking production
of items in factories, inventories of items in warehouses/stores and orders for
items.
• Decision Support Database Systems : Decision support database systems are
interactive, computer-based systems that aid users in judgement and choice
activities. They provide data storage and retrieval but enhance the traditional
information access and retrieval functions with support for model building
and model based reasoning. They support framing, modelling and problem
solving.
Types of database systems
• Data Warehouses : A data warehouse is a relational database
designed specifically to meet the transaction processing systems.
stores historical and commutative data from multiple sources. It is
designed to analyze data.

• It can be loosely defined as any centralised data repository which can


be queried for business benefit.
Types of database systems
• According to database site locations, database systems can be
further subdivided into four categories namely:
• Centralized database systems : The centralized database system consists of a
single processor together with its associated data storage devices and other
peripherals.
• Database files resides on a personal computer (small enterprise) or on a
mainframe computer (large enterprise)
Types of database systems
• Parallel database systems : A parallel database system can be defined
as a database system that are implemented by linking multiple
smaller machines (procesors)to achieve the same throughput as a
single larger machine, often with greater scalability and reliability
than single processor.
• Parallel database systems are used in the applications that have to
query extremely large databases or have to process an extremely
large number of transactions per second.
Types of database systems
• Distributed database systems : A distributed database system is a
database system, in which, the data is spread across a variety of
different databases. These are managed by a variety of DBMS’s that
are running on various types of machines having different operating
systems. These machines are widely spread and are connected
through the communication networks. Each machine can have is own
data and applications, and can access data stored on other machines.

You might also like