0% found this document useful (0 votes)
10 views8 pages

Unit 1

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 8

Unit – 1

Introduction
A database is a collection of related data, we mean known facts that can be recorded and that
have implicit meaning.
For example, consider the names, telephone numbers, and addresses of the people.
Database has the following implicit properties:
• A database represents some aspect of the real world, sometimes called the mini world or the
universe of discourse (UoD). Changes to the mini world are reflected in the database. • A
database is a logically coherent collection of data with some inherent meaning. A random
assortment of data cannot correctly be referred to as a database.
• A database is designed, built, and populated with data for a specific purpose. It has an intended
group of users and some preconceived applications in which these users are interested.

Database Management System (DBMS)


“It is a collection of programs that enables users to create and maintain a database. The DBMS is a
general-purpose software system that facilitates the processes of defining, constructing, manipulating,
and sharing databases among various users and applications”.
• Defining a database involves specifying the data types, structures, and constraints of the data to
be stored in the database.
• The database definition or descriptive information is also stored by the DBMS in the form of a
database catalog or dictionary; it is called meta-data.
• Constructing the database is the process of storing the data on some storage medium that is
controlled by the DBMS.
• Manipulating a database includes functions such as querying the database to retrieve specific
data, updating the database to reflect changes in the mini world, and generating reports from the
data.
• Sharing a database allows multiple users and programs to access the database simultaneously.
• Other important functions provided by the DBMS include protecting the database and
maintaining it over a long period of time.
• Protection includes system protection against hardware or software malfunction (or crashes) and
security protection against unauthorized or malicious access.
• A typical large database may have a life cycle of many years, so the DBMS must be able to
maintain the database system by allowing the system to evolve as requirements change over
time.

File-based Systems
A file system is a technique of arranging the files in a storage medium like a hard disk, pen drive, DVD,
etc. It helps you to organize the data and allows easy retrieval of files when they are required. It mostly
consists of different types of files like mp3, mp4, txt, doc, etc. that are grouped into directories. A file
system enables you to handle the way of reading and writing data to the storage medium. It is directly
installed into the computer with the Operating systems such as Windows and Linux.

Features of a File system - Here are important elements of the file system:
∙ It helps you to store data in a group of files.
∙ Files data are dependent on each other.
∙ C/C++ and COBOL languages were used to design the files.
∙ Shared File System Support
∙ Fast File System Recovery.
Drawbacks of using file systems to store data:
• Data redundancy and inconsistency
• Multiple file formats, duplication of information in different files
• Difficulty in accessing data
• Need to write a new program to carry out each new task
• Data isolation — multiple files and formats
• Integrity problems
• Integrity constraints (e.g. account balance > 0) become part of program code
• Hard to add new constraints or change existing ones
• Atomicity of updates
• Failures may leave database in an inconsistent state with partial updates carried out • E.g.
transfer of funds from one account to another should either complete or not happen at all
• Concurrent access by multiple users
• Concurrent accessed needed for performance
• Uncontrolled concurrent accesses can lead to inconsistencies
• E.g. two people reading a balance and updating it at the same time
• Security problems

Database systems offer solutions to all the above problems.

Difference between File System and DBMS:


S.NO. FILE SYSTEM DBMS

1. File system is a software that manages and DBMS is a software for managing the
organizes the files in a storage medium database.
within a computer.

2. Redundant data can be present in a file In DBMS there is no redundant data.


system.

3. It doesn’t provide backup and recovery of It provides backup and recovery of data
data if it is lost. even if it is lost.

4. There is no efficient query processing in file Efficient query processing is there in


system. DBMS.

5. There is less data consistency in file system. There is more data consistency because of
the process of normalization.

6. It is less complex as compared to DBMS. It has more complexity in handling as


compared to file system.

7. File systems provide less security in DBMS has more security mechanisms as
comparison to DBMS. compared to file system.

8. It is less expensive than DBMS. It has a comparatively higher cost than a


file system.

Advantage of DBMS over file system

There are several advantages of Database management system over file system. Few of them are as
follows:
∙ No redundant data: Redundancy removed by data normalization. No data duplication saves storage
and improves access time.
∙ Data Consistency and Integrity: As we discussed earlier the root cause of data inconsistency is data
redundancy, since data normalization takes care of the data redundancy, data inconsistency also been
taken care of as part of it
∙ Data Security: It is easier to apply access constraints in database systems so that only authorized user
is able to access the data. Each user has a different set of access thus data is secured from the issues
such as identity theft, data leaks and misuse of data.
∙ Privacy: Limited access means privacy of data.
∙ Easy access to data – Database systems manages data in such a way so that the data is easily
accessible with fast response times.
∙ Easy recovery: Since database systems keeps the backup of data, it is easier to do a full recovery of
data in case of a failure.
∙ Flexible: Database systems are more flexible than file processing systems.

Disadvantages of DBMS:
∙ DBMS implementation cost is high compared to the file system
∙ Complexity: Database systems are complex to understand
∙ Performance: Database systems are generic, making them suitable for various applications. However
this feature affect their performance for some applications

Types of DBMS - There are 4 major types of DBMS.

∙ Hierarchical: This type of DBMS employs the "parent-child" relationship of storing data. This type of
DBMS is rarely used nowadays. Its structure is like a tree with nodes representing records and branches
representing fields. The windows registry used in Windows XP is an example of a hierarchical
database. Configuration settings are stored as tree structures with nodes.
∙ Network DBMS: This type of DBMS supports many-to-many relations. It usually results in complex
database structures. RDM Server is an example of a database management system that implements the
network model.
∙ Relational DBMS: This type of DBMS defines database relationships in the form of tables, also known
as relations. Unlike network DBMS, RDBMS does not support many to many relationships. Relational
DBMS usually have pre-defined data types that they can support. It is the most popular DBMS type in
the market. Examples of relational database management systems include MySQL, Oracle, and
Microsoft SQL Server database.
∙ Object-Oriented Relation DBMS: This type supports the storage of new data types. The data to be
stored is in the form of objects. The objects to be stored in the database have attributes (i.e., gender,
ager) and methods that define what to do with the data. PostgreSQL is an example of an object oriented
relational DBMS.

Characteristics of the Database Approach


The main characteristics of the database approach versus the file-processing approach are the following:
1. Self-describing nature of a database system:
∙ A fundamental characteristic of the database approach is that the database system contains not only
the database itself but also a complete definition or description of the database structure and
constraints.
• This definition is stored in the DBMS catalogue, which contains information such as the
structure of each file, the type and storage format of each data item, and various constraints on
the data.
• The information stored in the catalogue is called meta-data and it describes the structure of the
primary database.
• DBMS is being developed as general- purpose software package and it is not written for specific
database application.
2. Insulation between programs and data, and data abstraction
∙ Database approach ensures program- data independence. A characteristic that permits programs
data independence is termed as ―Data Abstraction‖ accordingly; the data model is type of data
abstraction.
• DBMS provides users with the conceptual representation of data that does not include many of
the details of how data is stored and implemented.
3. Support of Multiple Views of the Data
∙ A database typically has many users, each of whom may require a different view of the database. A
view may be a subset of the database or it may contain virtual data. That is derived from the
database files but is not explicitly stored.
• Some users may not need to be aware of whether the data they refer to is stored or derived.
• The multiuser DBMS whose users have a variety of distinct applications must provide facilities
for defining multiple views.
4. Sharing of Data and Multiuser Transaction Processing:
∙ A multiuser DBMS, as its name implies, must allow multiple users to access the data-base at the
same time.
• This is essential if data for multiple applications is to be integrated and maintained in a single
database.
• DBMS must include ―Concurrency Control‖ when multiple applications access same sets of data
simultaneously (multi user DBMS) and also it is software to ensure that several users trying to
update the same data do so in a controlled manner so that the result of the updates is correct
• For example, when several reservation clerks try to assign a seat on an airline flight, the DBMS
should ensure that each seat can be accessed by only one clerk at a time for assignment to a
passenger.
• These types of applications are generally called ‗Online transaction process (OLTP).
5. Control of data redundancy
In the database approach, ideally, each data item is stored in only one place in the database. In some
cases, data redundancy still exists to improve system performance, but such redundancy is controlled
by application programming and kept to minimum by introducing as little redundancy as possible
when designing the database.
6. Enforcement of integrity constraints
Database management systems must provide the ability to define and enforce certain constraints to
ensure that users enter valid information and maintain data integrity. A database constraint is a
restriction or rule that dictates what can be entered or edited in a table such as a postal code using a
certain format or adding a valid city in the City field.
There are many types of database constraints. Data type, for example, determines the sort of data
permitted in a field, for example numbers only. Data uniqueness such as the primary key ensures that no
duplicates are entered. Constraints can be simple (field based) or complex (programming). 7. Restriction of
unauthorized access
Not all users of a database system will have the same accessing privileges. For example, one user
might have read-only access (i.e., the ability to read a file but not make changes), while another might
have read and write privileges, which is the ability to both read and modify a file. For this reason, a
database management system should provide a security subsystem to create and control different types
of user accounts and restrict unauthorized access.
8. Backup and recovery facilities
Backup and recovery are methods that allow you to protect your data from loss. The database system
provides a separate process, from that of a network backup, for backing up and recovering data. If a
hard drive fails and the database stored on the hard drive is not accessible, the only way to recover the
database is from a backup. If a computer system fails in the middle of a complex update process, the
recovery subsystem is responsible for making sure that the database is restored to its original state.
These are two more benefits of a database management system.

Actors on the Scene in DBMS


The people involved in the design, use and maintenance of large database with hundreds of users.
We called them as Actors on the Scene.
Actors are:
1) Database Administrators: - The DBA is responsible for authorizing access to the database,
coordinating and monitoring its use and acquiring software and hardware resources as needed.
DBA is single person to manage the databases of typically large establishments. He has
administered the co-ordinate use of resource of database system environment.
Functions of DBA:
a) Authorize access to database.
b) Facilitate co-ordinate use of database.
c) Install an upgrade DBMS and application Tools.
2) Database Designers: - Database designers are responsible for identifying the data to be stored in the
database and for choosing appropriate structures to represent and store this data.
• It is the responsibility of database designers to communicate with all prospective database users in
order to understand their requirements and to create a design that meets these requirements. •
Database designers develop and finalize database model and database designers must ensure that the
proposed model is capable of supporting real-world system in many aspects.
• Database designers typically interact with each potential group of users and develop views of the
database that meet the data and processing requirements of these groups.
3) End Users:- These are the people whose jobs is to access the database for querying, updating, and
generating reports, the database primarily exist for their use.
Types of End users:
• a) Casual end users: - occasionally, access the database, but they may need different information
each time. They use a sophisticated database query language to specify theirrequests, and are
typically middle- or high-level managers or other occasional browsers.
• b) Parametric end users: - This makes up a sizable portion of database end users. Their main job
function revolves around constantly querying and updating the database, using standard types of
queries and updates—called canned transactions—that have been carefully programmed and
tested. The tasks that such users perform are varied:
• A Bank tellers check account balances and post withdrawals and deposits. Reservation clerks for
airlines, hotels, and car rental companies check availability for a given request and make
reservations.
• c) Stand-alone end users: - Maintain the personal database by using readymade program package
that provide easy-to-use provided by the DBMS.
• For example: Income tax assessment software package- to file tax return on annual income of an
individual.
• d) Sophisticated End User: include engineers, scientists, business analysts and other who
thoroughly familiarize themselves with the facilities of the DBMS in order to implement
applications to meet complex requirements.
4) System Analysts and Application Programmers(Software Engineers)
• System analysts determine the requirements of end users, especially naive and parametric end
users, and develop specifications for standard canned transactions that meet these requirements. •
Application programmers implement these specifications as programs; then they test, debug,
document, and maintain these canned transactions.
• Such analysts and programmers—commonly referred to as software developers or software
engineers.
Functions and responsibilities of DBAs
DBA: person in the organization who controls the design and the use of the database refers as DBA.
1. Schema Definition:
• The DBA definition the logical Schema of the database. A Schema refers to the overall logical
structure of the database.
• According to this schema, database will be developed to store required data for an organization.
2. Storage Structure and Access Method Definition:
• The DBA decides how the data is to be represented in the stored database.
3. Assisting Application Programmers:
• The DBA provides assistance to application programmers to develop application programs.
4. Physical Organization Modification:
• The DBA modifies the physical organization of the database to reflect the changing needs of the
organization or to improve performance.
5. Approving Data Access:
• The DBA determines which user needs access to which part of the database.
• According to this various types of authorizations are granted to different users.
6. Monitoring Performance:
• The DBA monitors performance of the system. The DBA ensures that better performance is
maintained by making changes in physical or logical schema if required.
7. Backup and Recovery:
• Database should not be lost or damaged.
• The DBA ensures this periodically backing up the database on magnetic tapes or remote servers. •
In case of failure, such as virus attack database is recovered from this backup.

Workers behind the Scene in DBMS


1) DBMS System designers & implementers: The people are design, develop and implement various
modules of DBMS software package.
• They also these DBMS modules as a general purpose software package. They implement DBMS
interface with its operational system environment via operating system & compilers associated
with one or more languages applications.
2) Tool Developers: - Design and implement tools—the software packages that facilitate database
modeling and design, database system design, and improved performance.

• Tools are include packages for database design, performance monitoring, natural language or
graphical interfaces, prototyping, simulation, and test data generation.
3) Operators and maintenance personnel: This person who conduct execution operation and
maintenance activities of the actual hardware and software environment surrounding the databasesystem.

Advantages of Using the DBMS Approach


1. Controlling Redundancy:
• This redundancy in storing the same data multiple times leads to several problems. • First,
there is the need to perform a single logical update—such as entering data on a new
student—multiple times:
• once for each file where student data is recorded. This leads to duplication of effort. Second,
storage space is wasted when the same data is stored repeatedly.
2. Restricting Unauthorized Access
• When multiple users share a large database, it is likely that most users will not be authorized to
access all information in the database.
• For example, financial data is often considered confidential, and only authorized persons are
allowed to access such data.
• In addition, some users may only be permitted to retrieve data, whereas others are allowed to
retrieve and update. Hence, the type of access operation retrieval or update must also be
controlled.
• DBMS should provide a security and authorization subsystem which the DBA uses to create
accounts and to specify account restriction
3. Providing Persistent Storage for Program Objects:
• Databases can be used to provide persistent storage for program objects and data structures.
This is one of the main reasons for object-oriented database systems.
• The persistent storage of program objects and data structures is an important function of database
systems. Traditional database systems often suffered from the so called impedance mismatch
problem, since the data structures provided by the DBMS were incompatible with the
programming language’s data structures.
4. Providing Storage Structures and Search Techniques for Efficient Query Processing: •
Database systems must provide capabilities for efficiently executing queries and updates.
Because the database is typically stored on disk,
• The DBMS must provide specialized data structures and search techniques to speed up disk
search for the desired records.
5. Providing Backup and Recovery
• A DBMS must provide facilities for recovering from hardware or software failures. The backup
and recovery subsystem of the DBMS is responsible for recovery.
• For example, if the computer system fails in the middle of a complex update transaction, the
recovery subsystem is responsible for making
6. Providing Multiple User Interfaces
• DBMS should provide a variety of user interfaces. These include query languages for casual users,
programming language interfaces for application programmers, forms and command codes for
parametric users, and menu-driven interfaces and natural language interfaces for standalone
users.
• Both forms-style interfaces and menu-driven interfaces are commonly known as graphical user
interfaces (GUIs).
7. Representing Complex Relationships among Data
• A database may include numerous varieties of data that are interrelated in many ways. • A
DBMS must have the capability to represent a variety of complex relationships among the data, to
define new relationships as they arise, and to retrieve and update related data easily and efficiently.
8. Enforcing Integrity Constraints
• Most database applications have certain integrity constraints that must hold for constraints. The
simplest type of integrity constraint involves specifying a data type for each data item. • Another type of
constraint specifies uniqueness on data item values, such as every course record must have a unique
value for Course_number. This is known as a key or uniqueness constraint 9. Permitting Inferencing
and Actions Using Rules:
• Some database systems provide capabilities for defining deduction rules for inferencing new
information from the stored database facts. Such systems are called deductive database
systems.
• More powerful functionality is provided by active database systems, which provide active rules
that can automatically initiate actions when certain events and conditions occur. 10. Additional
Implications of Using the Database Approach:
• Potential for Enforcing Standards. The database approach permits the DBA to define and
enforce standards among database users in a large organization.
• Reduced Application Development Time. A prime selling feature of the database approach is
that developing a new application—such as the retrieval of certain data from the database for
printing a new report—takes very little time. Designing and implementing a large multiuser
database
• Flexibility. It may be necessary to change the structure of a database as requirements change.
• Availability of Up-to-Date Information. A DBMS makes the database available to all users. As
soon as one user’s update is applied to the database, all other users can immediately see this
update.
• Economies of Scale. The DBMS approach permits consolidation of data and applications, thus
reducing

When Not to Use a DBMS


In spite of the advantages of using a DBMS, there are a few situations in which such a system
may involve unnecessary overhead costs as that would not be incurred in traditional file processing.
1) High initial investment in hardware, software, and training.
2) The generality that a DBMS provides for defining and processing data.
3) Overhead for providing security, concurrency control, recovery, and integrity functions.
4) Simple, well defines database applications that are not expected to change.
5) Real-time requirement are not met because of overhead of DBMS.
6) No multiple-user access to data.
Database Applications – DBMS - Applications where we use Database Management Systems are: ∙
Telecom: There is a database to keeps track of the information regarding calls made, network usage,
customer details etc. Without the database systems it is hard to maintain that huge amount of data that
keeps updating every millisecond.
∙ Industry: Where it is a manufacturing unit, warehouse or distribution center, each one needs a database
to keep the records of ins and outs. For example distribution center should keep a track of the
product units that supplied into the center as well as the products that got delivered out from the
distribution center on each day; this is where DBMS comes into picture.
∙ Banking System: For storing customer info, tracking day to day credit and debit transactions,
generating bank statements etc. All this work has been done with the help of Database management
systems.
∙ Sales: To store customer information, production information and invoice details. ∙ Airlines: To travel
though airlines, we make early reservations, this reservation information along with flight schedule is
stored in database.
∙ Education sector: Database systems are frequently used in schools and colleges to store and retrieve
the data regarding student details, staff details, course details, exam details, payroll data, attendance
details, fees details etc. There is a hell lot amount of inter-related data that needs to be stored and
retrieved in an efficient manner.
∙ Online shopping: You must be aware of the online shopping websites such as Amazon, Flipkart etc.
These sites store the product information, your addresses and preferences, credit details and provide
you the relevant list of products based on your query. All this involves a Database management
system.

You might also like