DBMS Module 1
DBMS Module 1
System concepts
and applications
Module I - DBMS
Knowledge is not free…
You have to pay
attention!
● Introduction to databases
● File Systems vs. DBMS
● Advantages and Disadvantages of using DBMS Approach
● Database administrators and user
● Data Abstraction
● Schemas
● Instances
● Types of Data Models
● Three Schema Architecture and Data Independence
● Database Languages and Interfaces
Introduction to databases…
A database-management system (DBMS) is a collection of interrelated data
and a set of programs to access those data.
The collection of data, usually referred to as the database, contains information
relevant to an enterprise.
The primary goal of a DBMS is to provide a way to store and retrieve database
information that is both convenient and efficient.
A database is a collection of data, typically describing the activities of one or
more related organizations. For example, a university database might contain
information about the following: Entities such as students, faculty, courses, and
classrooms. Relationships between entities, such as students’ enrollment in
courses, faculty teaching courses, and the use of rooms for courses.
A database management system, or DBMS, is software designed to assist in
maintaining and utilizing large collections of data
Database-System Applications
• Enterprise Information
◦ Sales: For customer, product, and purchase information.
◦ Accounting: For payments, receipts, account balances, assets and other
accounting information.
◦ Human resources: For information about employees, salaries, payroll
taxes, and benefits, and for generation of paychecks.
◦ Manufacturing: For management of the supply chain and for tracking
production of items in factories, inventories of items in warehouses and stores,
and orders for items.
◦ Online retailers: For sales data noted above plus online order tracking,
generation of recommendation lists, and maintenance of online product
evaluations.
• Airlines: For reservations and schedule information. Airlines were among the
first to use databases in a geographically distributed manner.
File System VS DBMS
A company has a large collection (say, 500 GB) of data on employees, departments,
products, sales, and so on. This data is accessed concurrently by several employees.
Questions about the data must be answered quickly, changes made to the data by
different users must be applied consistently, and access to certain parts of the data
(e.g., salaries) must be restricted. We can try to deal with this data management
problem by storing the data in a collection of operating system files. This approach
has many drawbacks, including the following:
● We probably do not have 500 GB of main memory to hold all the data. We
must therefore store data in a storage device such as a disk or tape and bring
relevant parts into main memory for processing as needed.
● Even if we have 500 GB of main memory, on computer systems with 32-bit
addressing, we cannot refer directly to more than about 4 GB of data! We have
to program some method of identifying all data items.
File System VS DBMS
● We have to write special programs to answer each question that users may want to ask
about the data. These programs are likely to be complex because of the large volume of
data to be searched.
● We must protect the data from inconsistent changes made by different users accessing
the data concurrently. If programs that access the data are written with such concurrent
access in mind, this adds greatly to their complexity. We must ensure that data is restored
to a consistent state if the system crashes while changes are being made.
● Operating systems provide only a password mechanism for security. This is not
sufficiently flexible to enforce security policies in which different users have permission to
access different subsets of the data.
A DBMS is a piece of software that is designed to make the preceding tasks easier.
By storing data in a DBMS, rather than as a collection of operating system files, we
can use the DBMS’s features to manage the data in a robust and efficient manner. As
the volume of data and the number of users grow—hundreds of gigabytes of data
and thousands of users are common in current corporate databases—DBMS support
becomes indispensable.
ADVANTAGES OF A DBMS
● Data independence: Application programs should be as independent as possible from
details of data representation and storage. The DBMS can provide an abstract view of
the data to insulate application code from such details.
● Data integrity and security: If data is always accessed through the DBMS, the DBMS
can enforce integrity constraints on the data. For example, before inserting salary
information for an employee, the DBMS can check that the department budget is not
exceeded. Also, the DBMS can enforce access controls that govern what data is visible
to different classes of users.
● Data administration: When several users share the data, centralizing the
administration of data can offer significant improvements. Experienced professionals
who understand the nature of the data being managed, and how different groups of
users use it, can be responsible for organizing the data representation to minimize
redundancy and for fine-tuning the storage of the data to make retrieval efficient.
ADVANTAGES OF A DBMS
● Concurrent access and crash recovery: A DBMS schedules concurrent accesses to
the data in such a manner that users can think of the data as being accessed by only
one user at a time. Further, the DBMS protects users from the effects of system
failures.
● Efficient data access: A DBMS utilizes a variety of sophisticated techniques to store
and retrieve data efficiently. This feature is especially important if the data is stored
on external storage devices.
● Reduced application development time: Clearly, the DBMS supports many
important functions that are common to many applications accessing data stored in
the DBMS. This, in conjunction with the high-level interface to the data, facilitates
quick development of applications. Such applications are also likely to be more
robust than applications developed from scratch because many important tasks are
handled by the DBMS instead of being implemented by the application.
DISADVANTAGES OF A DBMS
● A DBMS is a complex piece of software, optimized for certain kinds of workloads (e.g.,
answering complex queries or handling many concurrent requests), and its performance
may not be adequate for certain specialized applications.
○ Examples include applications with tight real-time constraints or applications with just
a few well-defined critical operations for which efficient custom code must be written.
● An application may need to manipulate the data in ways not supported by the query
language. In such a situation, the abstract view of the data presented by the DBMS does
not match the application’s needs, and actually gets in the way.
● In most situations calling for large-scale data management, however, DBMSs have
become an indispensable tool.
Database Users and Administrators
A primary goal of a database system is to retrieve information from and store new
information into the database. People who work with a database can be categorized
as database users or database administrators.
Database Users and User Interfaces
There are four different types of database-system users, differentiated by the way
they expect to interact with the system. Different types of user interfaces have been
designed for the different types of users.
● Naive users
● Application programmers
● Sophisticated users
● Specialized users
Database Users and Administrators
● Naıve users are unsophisticated users who interact with the system by invoking
one of the application programs that have been written previously. Naıve users
may also simply read reports generated from the database. Example, consider a
student, who during class registration period, wishes to register for a class by
using a Web interface. Such a user connects to a Web application program that
runs at a Web server. The application first verifies the identity of the user, and
allows her to access a form where she enters the desired information.
● Application programmers are computer professionals who write application
programs. Application programmers can choose from many tools to develop user
interfaces. Rapid application development (RAD) tools are tools that enable an
application programmer to construct forms and reports with minimal
programming effort.
Database Users and Administrators
● Sophisticated users interact with the system without writing programs. Instead,
they form their requests either using a database query language or by using
tools such as data analysis software. Analysts who submit queries to explore
data in the database fall in this category.
● Specialized users are sophisticated users who write specialized database
applications that do not fit into the traditional data-processing framework.
Among these applications are computer-aided design systems, knowledgebase
and expert systems, systems that store data with complex data types (for
example, graphics data and audio data), and environment-modeling systems.
Database Users and Administrators
Database Administrator
One of the main reasons for using DBMSs is to have central control of both the data
and the programs that access those data. A person who has such central control over
the system is called a database administrator (DBA). The functions of a DBA include:
● Schema definition. The DBA creates the original database schema by executing
a set of data definition statements in the DDL.
● Storage structure and access-method definition.
● Granting of authorization for data access. By granting different types of
authorization, the database administrator can regulate which parts of the
database various users can access. The authorization information is kept in a
special system structure that the database system consults whenever someone
attempts to access the data in the system.
Database Users and Administrators
Database Administrator