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

DMS UNIT 1

Unit 3

Uploaded by

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

DMS UNIT 1

Unit 3

Uploaded by

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

Unit 1

Introduction To
Database System
Data
Data can be defined as facts or information that can be recorded and have an implicit
meaning.

Database
A database is an organized collection of data so that it can be easily accessed, managed and
updated.

Database:-

A database is a collection of information/data that is organized so that it can be easily accessed,


managed and updated.

Computer databases typically contain aggregations of data records or files, containing


information about sales transactions or interactions with specific customers.

File Processing System:-


• All the files were grouped based on their categories
• File used to have only related information's and each file is named properly

Drawbacks of File system:-


• Data redundancy: Data redundancy refers to the duplication of data, lets say we are
managing the data of a college where a student is enrolled for two courses, the same student
details in such case will be stored twice, which will take more storage than needed. Data
redundancy often leads to higher storage costs and poor access time.
• Data inconsistency: Data redundancy leads to data inconsistency, lets take the same
example that we have taken above, a student is enrolled for two courses and we have student
address stored twice, now lets say student requests to change his address, if the address is
changed at one place and not on all the records then this can lead to data inconsistency.
• Data Isolation: Because data are scattered in various files, and files may be in different
formats, writing new application programs to retrieve the appropriate data is difficult.
• Dependency on application programs: Changing files would lead to change in application
programs.
• Atomicity issues: Atomicity of a transaction refers to “All or nothing”, which means either
all the operations in a transaction executes or none.For example: Lets say Steve transfers 100
Rs to Negan’s account. This transaction consists multiple operations such as debit 100 Rs
from Steve’s account, credit 100 Rs to Negan’s account. Like any other device, a computer
system can fail lets say it fails after first operation then in that case Steve’s account would
have been debited by 100 Rs but the amount was not credited to Negan’s account, in such
case the rollback of operation should occur to maintain the atomicity of transaction. It
is difficult to achieve atomicity in file processing systems.
• Data Security: Data should be secured from unauthorised access, for example a student in a
college should not be able to see the payroll details of the teachers, such kind of security
constraints are difficult to apply in file processing systems.

DBMS-Database Management System:-

• Database management system is a software which is used to manage the database.


• For example: MySQL, Oracle, etc are a very popular commercial database which is used in
different applications.
• DBMS provides an interface to perform various operations like database creation, storing
data in it, updating data, creating a table in the database and a lot more.
• It provides protection and security to the database. In the case of multiple users, it also
maintains data consistency.

Purpose of Database:-
• Data redundancy: Data redundancy refers to the duplication of data, lets say we are
managing the data of a college where a student is enrolled for two courses, the same student
details in such case will be stored twice, which will take more storage than needed. Data
redundancy often leads to higher storage costs and poor access time.
• Data inconsistency: Data redundancy leads to data inconsistency, lets take the same
example that we have taken above, a student is enrolled for two courses and we have student
address stored twice, now lets say student requests to change his address, if the address is
changed at one place and not on all the records then this can lead to data inconsistency.
• Data Isolation: Because data are scattered in various files, and files may be in different
formats, writing new application programs to retrieve the appropriate data is difficult.
• Dependency on application programs: Changing files would lead to change in application
programs.
• Atomicity issues: Atomicity of a transaction refers to “All or nothing”, which means either
all the operations in a transaction executes or none.For example: Lets say Steve transfers 100
Rs to Negan’s account. This transaction consists multiple operations such as debit 100 Rs
from Steve’s account, credit 100 Rs to Negan’s account. Like any other device, a computer
system can fail lets say it fails after first operation then in that case Steve’s account would
have been debited by 100 Rs but the amount was not credited to Negan’s account, in such
case the rollback of operation should occur to maintain the atomicity of transaction. It
is difficult to achieve atomicity in file processing systems.
• Data Security: Data should be secured from unauthorised access, for example a student in a
college should not be able to see the payroll details of the teachers, such kind of security
constraints are difficult to apply in file processing systems.
• Difficulty in accessing data
• Integrity Problem
• Concurrent access anomalies

Characteristics of the database


1. Persistent Data
2. Meta Data and Self-describing nature of a DB
3. Insulation between programs and data (Data Independence)
4. Support of multiple views of the data
5. Sharing of data and multiuser transaction processing
6. Access flexibility and Security.
7. Controlled Redundancy

File system vs database approach


DBMS File processing system
1. Presence of Self-describing nature of a 1. File processing don't contain any self
database system and Metadata. describing feature and neither posses
metadata.
2. In database system, the structure of data
files is stored in the DBMS catalog 2.In file processing system, if any changes to
separately from the access program. This the structure of a file may require changing
is called program-data independence all programs that access the file

3.File processing system don't support


3. Support of multiple views of the data i.e multiple views.
Each user may see a different view of the
database, which describes only the data 4.It is not possible to share data and multi
of interest to that user user transaction simultaneously among
concurrent users in case of file processing
4. Sharing of data and multi-user system.
transaction processing i.e allowing a set
of concurrent users to retrieve from and 5. The traditional file approach, each group
to update the database. independently keeps their own file.
5. Controlling Redundancy is one of most
important feature to use DBMS.

Advantages of database system are the following:


1. Controlling Redundancy of data in a centralized system of DBMS
2. Integrity of data can be enforced in case of database system by enforcing constraints
3. Inconsistency of data can be avoided by reducing duplicity or redundancy
4. Data can be shared by multiple applications in centralized DBMS
5. Standards can be enforced in DBMS is a central system by enforcing standards easily at
Company level, Department level, National level or International level.
6. Restricting unauthorized access among multiple users when sharing of data takes place in a
database.
7. Providing Backup and Recovery facilities is provide by DBMS for recovering from hardware
or software failures.

Disadvantages of database system:-


Cost of Hardware and Software: It requires a high speed of data processor and large memory size to run
DBMS software.
Size: It occupies a large space of disks and large memory to run them efficiently.
Complexity: Database system creates additional complexity and requirements.
Higher impact of failure: Failure is highly impacted the database because in most of the organization, all
the data stored in a single database and if the database is damaged due to electric failure or database
corruption then the data may be lost forever.

Data Abstraction
Data abstraction is defined as Suppression of details of data organization and storage
Highlighting of the essential features for an improved understanding of data The characteristic
that allow program data independence and program operation independence is called data
abstraction.

Three levels of data abstraction are:

Internal level or Physical level: This is the lowest level of data abstraction. It describes how
data is actually stored in database. The complex data structure details is described at this level.
It is the physical representation of the database on the computer. This level describes how the
data is stored in the database. The internal level is the one that concerns the way the data are
physically stored on the hardware.
Conceptual Level or Logical level: This is the middle level of 3-level data abstraction
architecture. It describes what data is stored in database and the relationships among the data. It
is the community view of the database. This level describes what data is stored in the database
and the relationships among the data. The middle level in the three level architecture is the
conceptual level. This level contains the logical structure of the entire database as seen by the
DBA. It is a complete view of the data requirements of the organization that is independent of
any storage considerations. The conceptual level represents all entities, their attributes, and their
relationships.

External Level or View level: This is highest level of data abstraction. This level describes the
user interaction with database system. It is the users' view of the database. This level describes
that part of the database that is relevant to each user. External level is the one which is closest to
the end users. This level deals with the way in which individual users view data. Individual users
are given different views according to the user's requirement.

Data independence:
The ability to modify or change schema definition of one level without affecting schema
definition in the next Higher level.

1. Logical Data Independence


Logical data independence refers characteristic of being able to change the conceptual schema
without having to change the external schema.
Logical data independence is used to separate the external level from the conceptual view.
If we do any changes in the conceptual view of the data, then the user view of the data would not
be affected.
Logical data independence occurs at the user interface level.

2. Physical Data Independence


Physical data independence can be defined as the capacity to change the internal schema without
having to change the conceptual schema.
If we do any changes in the storage size of the database system server, then the Conceptual
structure of the database will not be affected.
Physical data independence is used to separate conceptual levels from the internal levels.
Physical data independence occurs at the logical interface level.

Database schema:-
The overall design of the database is called the database schema. A schema diagram displays
only names of record types (entities) and names of data items (attributes) and does not show the
relationships among the various files.

Codd’s Rule
• Rule 1: Information Rule–
Everything in a database must be stored in a table format.
• Rule 2: Guaranteed Access Rule
Every single data element (value) is guaranteed to be accessible logically with a
combination of table-name, primary-key (row value), and attribute-name (column value
• Rule 3: Systematic Treatment of NULL Values
The NULL values in a database must be given a systematic and uniform treatment.
• Rule 4: Active Online Catalog
The structure description of the entire database must be stored in an online catalog,
known as data dictionary, which can be accessed by authorized users.
• Rule 5: Comprehensive Data Sub-Language Rule
• A database can only be accessed using a language that supports data definition, data
manipulation, and transaction management operations..
• Rule 6: View Updating Rule
• All the views of a database, which can theoretically be updated, must also be updatable
by the system.
• Rule 7: High-Level Insert, Update, and Delete Rule
• A database must support high-level insertion, updation, and deletion.
• Rule 8: Physical Data Independence
• The data stored in a database must be independent of the applications that access the
database..
• Rule 9: Logical Data Independence
• The logical data in a database must be independent of its user’s view (application).
• Rule 10: Integrity Independence
• A database must be independent of the application that uses it. All its integrity constraints
can be independently modified without the need of any change in the application.
• Rule 11: Distribution Independence
• The end-user must not be able to see that the data is distributed over various locations.
Users should always get the impression that the data is located at one site only. This rule
has been regarded as the foundation of distributed database systems.
• Rule 12: Non-Subversion Rule
• If a system has an interface that provides access to low-level records, then the interface
must not be able to subvert the system and bypass security and integrity constraints.
Overall Structure of DBMS

Architecture of Database Three level Architecture for a database system


1-Tier Architecture:-
• In this architecture, the database is directly available to the user. It means the user can
directly use DBMS.
• Any changes done here will directly be done on the database itself. It doesn't provide a
handy tool for end users.
• The 1-Tier architecture is used for development of the local application, where
programmers can directly communicate with the database for the quick response.

2-Tier Architecture:-

• The 2-Tier architecture is same as basic client-server. In the two-tier architecture,


applications on the client end can directly communicate with the database at the server
side. For this interaction, API's like: ODBC, JDBC are used.
• The user interfaces and application programs are run on the client-side.
• The server side is responsible to provide the functionalities like: query processing and
transaction management.
• To communicate with the DBMS, client-side application establishes a connection with
the server side.

3-Tier Architecture:-
 The 3-Tier architecture contains another layer between the client and server.
 In this architecture, client can't directly communicate with the server.
 The application on the client-end interacts with an application server which further
communicates with the database system.
 End user has no idea about the existence of the database beyond the application server. The
database also has no idea about any other user beyond the application.
 The 3-Tier architecture is used in case of large web application.

Data Model:-
Underlying structure of the database is called as data model. It is a collection of
conceptual tools for describing data, data relationships, data semantics and
consistency constraints. Data models define how data is connected to each other
and how they are processed and stored inside the system.

Hierarchical model:-
• This database model organizes data into a tree-like-structure, with a single root,
to which all the other data is linked. The hierarchy starts from the Root data,
and expands like a tree, adding child nodes to the parent nodes.
• In this model, a child node will only have a single parent node.
• This model efficiently describes many real-world relationships like index of a
book, recipes etc.
• In hierarchical model, data is organized into tree-like structure with one one-to-
many relationship between two different types of data, for example, one
department can have many courses, many professors and of-course many
students.

Network Model:-
• This is an extension of the Hierarchical model. In this model data is organized
more like a graph, and are allowed to have more than one parent node.
• In this database model data is more related as more relationships are established
in this database model. Also, as the data is more related, hence accessing the
data is also easier and fast. This database model was used to map many-to-
many data relationships.
• This was the most widely used database model, before Relational Model was
introduced

Object Oriented Model


Object oriented models were introduced to overcome the shortcomings of
conventional models like Relational, Hierarchical and network model. An object-
oriented database is collection of objects whose behavior, state, and relationships
are defined in accordance with object-oriented concepts (such as objects, class,
class hierarchy etc.) In this both data and their relationship are organized or
contained in a single structure known as object. Object includes information about
relationship between the facts within the object, as well as information about
relationship with other objects. It is also said to be semantic data model
Merits:
 Object oriented data model allows the real world to be modeled closely. The
object encapsulates both state and behavior. The object can also store the relations
with other objects.
 It allows new data types to be built from existing types. Redundancy can be
reduced as common factors of several classes can be grouped into a super class and
can be shared by the sub classes.
 It can be used to store a variety of data.
 Data evolution is easier.
Demerits:
 There is a lack of universal data model.
 Use of this type of modeling is still limited.
 It lacks standards since there is no universal data model.
 Increased functionality provided by this modeling makes it complex.
 There is no view mechanism
 There is no adequate security mechanism
Relational Model:-
Define
Domain: A domain is a set of all possible (or permissible) values in an attribute.
Tuple: A row or a record is called as tuple in relational database management
system.
Relation: A relation is nothing but a table which can store data in rows and
columns form I relational database management system.

Advantages of relational database.


1) Controlled redundancy
2) Sharing of data
3) Improved data security
4) Consistency
5) Higher integrity
Srno Hierarchical Database Model Network Model
1 Network Model represents tree Network Model represents tree
like structure with one root. like structure with many roots.
2 Reflects 1:N (One to many) M:N (Many to many)
relationship Reflects relationship
3 There can be only one node at It allows a record to have more
the parent level than one parent.
4 Relationship between records is Relationship between records is
of parent child type expressed in the form of
pointers or links(Graphs).
5 Searching for a record is very Searching a record is easy since
difficult since one can retrieve a there are multiple access paths
child only after going through its to a data element
parent record.
6 There are multiple occurrences This model is free from update
of child records, which lead to anomalies because there is only
problem of inconsistency during a single occurrence for each
the update operations record set.
7 Record relationship Record relationship
implementation is simple due to implementation is complex due
the use of pointers to the use of pointers

Srno Network database model Relational database model


1 Relationship between records is Relationship between records is
expressed in the form of pointers represented by a relation that
or links contains a key for each record
involved in the relationship.
2 Many to many relationship can Many to many relationship can be
also be implemented easily implemented
3 Record relationship Relationship implementation is
implementation is very complex very easy through the use of a key
due to use of pointers or composite key fields
4 Network model is useful for Relationship model relations are
representing such records which is useful for representing most of
have many to many relationships the real world objects and
relationship among them
5 In Network model also the Relational model does not
record relations are physical maintain physical connection
among of records. Data is
organized logically in the form of
rows and columns.

Components of a Database:

The five major components of a database are:


1. HardwareHardware refers to the physical, electronic devices such as computers and hard
disks that offer the interface between computers and realworld systems.
2. Software Software is a set of programs used to manage and control the database and includes
the database software, operating system, network software used to share the data with other
users, and the applications used to access the data.
3. Data Data are raw facts and information that need to be organized and processed to make it
more meaningful. Database dictionaries are used to centralize, document, control, and coordinate
the use of data within an organization. A database is a repository of information about a database
(also called metadata).
4. ProceduresProcedures refer to the instructions used in a database management system and
encompass everything from instructions to setup and install, login and logout, manage the day-
to-day operations, take backups of data, and generate reports.
5. Database Access Language Database Access Language is a language used to write commands
to access, update, and delete data stored in a database. Users can write commands using Database
Access Language before submitting them to the database for execution. Through utilizing the
language, users can create new databases, tables, insert data, and delete data.
hardware, Software, people, Procedure. Database Product,

You might also like