DBMS Overview
DBMS Overview
T
DBMS
__________________________________________________
Unit 1
Part 1 – Introduction To DBMS
------------------------------------------------------------------------------------
Basic Concepts
Q. What is ‘data’?
Data is meaningful known raw facts that can be processed and stored as information.
1
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
In exam, don’t need to write in detail and all applications. Just mention applications in short as given in square
brackets. The detailed information is to familiarize one with relevant database of enterprises.
It is advisable you remember following seven terms. These will help you answer the next three questions
1. Data redundancy and inconsistencies
2. Difficulty in accessing data
3. Data isolation
4. Integrity problems
5. Atomicity of updates
6. Concurrent access by multiple users
7. Security
2
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
Difficult to enforce this with application programs.
3. Database systems offer solutions to all the above problems and have advantages over file-system. Hence,
are required.
Please refer to Database System Concepts by Korth, [Sec. 1.2 on pgs. 3, 4] for detailed explanation of each
point.
First seven points are just the opposites of the disadvantages of ‘file systems’ and can easily be listed.
Q. What are the difference between the DBMS and file-processing systems?
The following are differences between DBMS an file-processing systems:
DBMS File-processing Systems
1. Redundancies and inconsistencies in data are 1. Redundancies and inconsistencies in data exist
reduced due to single file formats and duplication of due to single file formats and duplication of data.
data is eliminated.
2. Data is easily accessed due to standard query 2. Data cannot be easily accessed due to special
procedures. application programs needed to access data.
3. Isolation/retrieval of required data is possible due 3. Data isolation is difficult due to different file
to common file format, and there are provisions to formats, and also because new application programs
easily retrieve data. have to be written.
4. Integrity constraints, whether new or old, can be 4. Introduction of integrity constraints is tedious and
created or modified as per need. again new application programs have to be written.
5. Atomicity of updates is possible. 5. Atomicity of updates may not be maintained.
6. Several users can access data at the same time 6. Concurrent accesses may cause problems such as
i.e. concurrently without problems. inconsistencies.
7. Security features can be enabled in DBMS very 7. It may be difficult to enforce security features.
easily.
Remember the files seven points of advantages of DBMS and seven points of disadvantages of file-
processing system. Use them as points of difference.
Data abstraction
3
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
3. To simplify user interaction with DBS.
2. Logical level: It describes data stored in database, and the relationships among the data.
Features:
a) It is next-higher level of abstraction. Here whole DB is divided into small simple structures.
b) Users at this level need not be aware of the physical-level complexity used to implement the simple
structures.
c) Here the aim is ease of use.
d) Generally, database administrators (DBAs) work at logical level of abstraction.
3. View level: Application programs hide details of data types. Views can also hide information (e.g.,
salary) for security purposes.
Features:
a) It is the highest level of abstraction.
b) It describes only a part of the whole DB for particular group of users.
c) This view hides all complexity.
d) It exists only to simplify user interaction with system.
e) The system may provide many views for the whole system.
If there is question to write a note on data abstraction, mention what is meant by data abstraction and its
types. You may omit one or more features.
Q. What is meant by ‘instances and schemas’? What are the types of schemas?
Instances and Schemas are similar to types and variables in programming languages.
1. Schema
Definition: The overall design of a database is called database schema. E.g., the database consists of
information about a set of customers and accounts and the relationship between them. It is analogous to
variable along with its type information in a program.
Types of Schemas (partitioned according to levels of abstraction):
a. Physical schema: It is database design at the physical level. It is hidden below logical
schema, and can be changed easily without affecting application programs.
b. Logical schema: It is database design at the logical level. Programmers construct
applications using logical schema. It is by far the most important schema, in terms of its
effect on application programs.
c. Subschema: It is schema at view level.
2. Instance
4
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
Definition: It is the actual content of the database at a particular point in time. It is analogous to the value
of a variable.
Database languages
In exam, if a question on DML is asked you may first explain what is ‘data manipulation’ followed by its
features.
5
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
Q. Give a note on SQL.
SQL: Structured Query Language
1. It is a widely used non-procedural language
E.g. find the name of the customer with customer-id 192-83-7465
select customer.customer-name
from customer
where customer.customer-id = ‘192-83-7465’
E.g. find the balances of all accounts held by the customer with customer-id 192-83-7465
select account.balance
from depositor, account
where depositor.customer-id = ‘192-83-7465’ and
depositor.account-number = account.account-number
The above two examples are called queries.
2. Application programs generally access databases through one of:
a) Language extensions to allow embedded SQL
b) Application program interface (e.g. ODBC/JDBC) which allow SQL queries to be sent to a
database.
In general we can have a broad classification as under with different models in each class:
1. Object-based logical models
a. Entity-Relationship model.
b. Object-oriented model.
c. Binary model.
d. Semantic data model.
e. Infological model.
f. Functional data model.
g. And more… (over 30 models)
2. Record-base logical models
a. Relational model
b. Network model
c. Hierarchical model
3. Physical data models
a. Unifying model
b. Frame memory
6
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
7. The set of all entities or relationships of the same type is called the entity set or relationship set.
8. Another essential element is the E-R diagram in which the mapping cardinalities express the number
of entities to which another entity can be associated via a relationship set.
9. The overall logical structure of a database can be expressed graphically by an E-R diagram:
a. Rectangles: represent entity sets.
b. Ellipses: represent attributes.
c. Diamonds: represent relationships among entity sets.
d. Lines: link attributes to entity sets and entity sets to relationships.
An example of ER model
Relational model
1. In this model, data and relationships are represented by a collection of tables.
2. Each table has a number of columns with unique names e.g. customer, account. It is a record-based
logical model.
3. It is a lower-level model.
7
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
1. Data are represented by collections of records.
2. Relationships among data are represented by links.
3. Organization is that of an arbitrary graph.
Logical data independence is harder to achieve as the application programs are usually heavily dependent on
the logical structure of the data. An analogy is made to abstract data types in programming languages.
8
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
9
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
b. These are submitted to a query processor that breaks a DML statement down into instructions
for the database manager module.
3. Specialized users: They are sophisticated users writing special database application programs.
These may be CADD systems, knowledge-based and expert systems, complex data systems
(audio/video), etc.
4. Naive users: They are unsophisticated users who interact with the system by using permanent
application programs (e.g. automated teller machine).
1. Database systems are partitioned into modules for different functions. Some functions (e.g. file systems)
may be provided by the operating system.
2. Broadly the functional components of a database system are:
a. Query Processor: It translates statements in a query language into low-level instructions the database
manager understands. It may also attempt to find an equivalent but more efficient form.
b. Storage Manger:
1. Storage manager is a program module that provides the interface between the low-level data stored
in the database and the application programs and queries submitted to the system.
2. The storage manager is responsible to the following tasks:
a. interaction with the file manager
b. efficient storing, retrieving and updating of data
3. The important components include:
a. File manager: It manages allocation of disk space and data structures used to represent
information on disk.
b. Database manager: It is the interface between low-level data and application programs and
queries.
10
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
11
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
The above details are condensed for exam purpose .Refer to diagram in Korth [Fig. 1.4 on pg. 19].
In addition, several data structures are implemented for physical system implementation by storage
manger:
f. Data files: They store the database itself.
g. Data dictionary: It stores information about the structure of the database. It is used heavily.
Great emphasis should be placed on developing a good design and efficient implementation of
the dictionary. In short, it stores metadata.
h. Indices: They provide fast access to data items holding particular values.
If you want, combine the above two answers into one to explain overall structure of DBMS. Draw diagram
from Korth [Fig. 1.4 on pg. 19].
12
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
13
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
Special Supplement Reading 1
This piece will help you understand a DBMS as a software program with fuller
understanding, and provide a more practical view of concepts.
Q. What is a Database?
A database is an organized collection of data. The primary function of a database
program is to enable the user to put a collection of information into some specific
order: alphabetical, numerical, chronological, or some combination of the three.
There are two key questions that must be answered before constructing a
database:
1. What information do you want to maintain?
2. In what order do you want this information organized?
The answers to these questions determine how you will structure your database.
Database File: Within a given program, the term database, or database file, has a
more specific meaning. It refers to a specific collection of data with a single
focus or topic.
Field: Each record is made up of a series of fields, which store individual bits of
information inside a record.
14
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
Q. What Are Tables?
Data are always stored in tables, and understanding the design of the tables in
your Access database can save you hours of work. Each table contains
information about one subject, such as employees, members of the class of
1994, or addresses. One table might store customer names and addresses while
another stores customer orders. Tables are made up of records, which contain
all of the information about a single entry, such as an employee or address.
Each record is then subdivided into fields, which are the smallest increments
of useful data in your database. If you are making a mailing list, then you
might have fields for First Name, Middle Name, and Last Name, rather than
including only one field for a person’s name. Visualize your table by imagining
the fields across the top of your table as column headings and then thinking of
each record as a row in the table. Relational databases, like Access and
FileMaker Pro, use many tables that each store different information about a
related subject.
Please understand the terms ‘tables’ and ‘queries’ very properly as they
are important.
15
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
Special Reading Supplement 2
The following diagram distinguishes between actual data, database (DB), and
database system (DBS) and database management system (DBMS).
Thus, data, database, database management system and end-users together form
the DATABASE SYSTEM.
Special Supplement Reading 1 This piece will help you understand a DBMS
as a software program with fuller
16
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
understanding, and provide a more same information. In turn, this structure
practical view of concepts. makes data entry easier as well as easing
storage problems on your hard disk.
Q. What is a Database?
A database is an organized collection of Q. What are parts of DBMS or a database
data. The primary function of a database program?
program is to enable the user to put a In general, all database management
collection of information into some specific programs have the same overall
order: alphabetical, numerical, organization. Different types of objects
chronological, or some combination of the perform specific tasks. Most database
three. There are two key questions that programs contain four main object types:
must be answered before constructing a tables, queries, forms, and reports.
database:
1. What information do you want to maintain? Q. What Are Tables?
2. In what order do you want this information
organized? Data are always stored in tables, and
The answers to these questions determine understanding the design of the tables in
how you will structure your database. your Access database can save you hours
of work. Each table contains information
Q. List the commonly used terms. about one subject, such as employees,
members of the class of 1994, or
Database Program: The term database is addresses. One table might store
often used to refer to an entire database customer names and addresses while
management system (DBMS). For another stores customer orders. Tables
example, the software programs Access, are made up of records, which contain all
dBase, FileMaker Pro and FoxBASE are of the information about a single entry,
often referred to as database programs. such as an employee or address. Each
Microsoft Excel is usually considered a record is then subdivided into fields, which
spreadsheet application which contains are the smallest increments of useful data
several database functions. in your database. If you are making a
mailing list, then you might have fields for
Database File: Within a given program, First Name, Middle Name, and Last Name,
the term database, or database file, has a rather than including only one field for a
more specific meaning. It refers to a person’s name. Visualize your table by
specific collection of data with a single imagining the fields across the top of your
focus or topic. table as column headings and then
thinking of each record as a row in the
Record: A database file is a group of table. Relational databases, like Access
records that are identical in structure. A and FileMaker Pro, use many tables that
record can contains information about a each store different information about a
single item in your database. related subject.
Field: Each record is made up of a series Q. What Are Queries?
of fields, which store individual bits of A query is a way of asking questions about
information inside a record. data stored in your tables. A query’s
design tells the database engine exactly
Q. What are the types of databases? which data to retrieve. With queries you
There are two main types of databases can look at selected data from one or more
that you need to know about: flat-file and tables without viewing all of the fields in
relational. As the name implies, a flat-file each table and without having to save the
database consists of a single database file data over again. The only parts of a query
or table which contains all of the that most database management
information that you want to store about programs retain are the design
your topic. This type of database is ideal parameters. Queries are especially useful
for a simple database that does not because they let you organize your data
contain a lot of repeated information. A without tampering with the actual records
relational database, on the other hand, themselves. For example, you could use a
consists of multiple database files or tables query to alphabetize a mailing list or to
linked together by at least one common select only residents of Pune from a state-
field. For instance, a library card catalog wide mailing list.
might consist of an Author table, a Title
table, and a Subject table. This type of Q. What Are Forms?
structure eliminates the endless repetition Like a paper form, an Access form or a
of author and title information that would FileMaker Pro layout collects and
occur in a flat-file database containing the organizes information. In forms you can
17
Jahiruddin Ahamed(lect. Of IT ), D.I.E.T
DBMS
enter data into your database, display this mutually dependent files. Those files contain
data for review, and print it out. Forms are the following information:
designed to make onscreen data entry and 1. The set of data, available to the user, the so
retrieval easier. In most database called "End-user data". Those are the real data,
programs, you will almost always use a which can be read, connected and modified by
form to enter and edit data because you the user (if he has the corresponding rights).
can enter information to be stored in more 2. The so called "metadata" (the data
than one table on a single form. Another describing the end-user data). In this part, we
advantage of using forms to enter and edit describe the properties (e.g. their type) and the
data is that you look at only one record at relative relations of the end-user data.
a time. If you enter data using tables, you
will have to look at a confusing number of DBMS and End-Users: A database is
records at once. implemented by a powerful software system,
the so called "Database Management System"
Q. What Are Reports? (DBMS). This system consists of a number of
A Report provides a way to retrieve programs, controlling the structure of the
selected stored data and present that database as well as the access to those data.
information effectively and meaningfully. The DBMS is serving as "mediator" between
Reports are designed to be printed out the end-user and the effective user-data by
rather than viewed on a computer screen, translating the user-commands into complex
so they need to be carefully planned. sequences of instructions. With this translation
Examples of everyday reports include it ensures the access required for those
mailing labels, invoices, receipts, sales commands to the user-data. Often the DBMS
summaries, and phone books. You can enables the access to the data by several,
combine text, data, pictures, lines, boxes, simultaneous independent users. The number
graphs, and drawings to produce exactly of users can be very high (searching in
the report you want. Fortunately, the latest libraries, payment/account systems in banks
versions of the big database packages etc.). The end-user has the possibility of writing
also come with several preplanned report application-programs in classical programming
layouts that you can set up quickly using languages such as Pascal, COBOL, C, or
Report Wizards. JAVA (embedded in a query-system to the
DMBS) or to access with utility-programs made
Please understand the terms ‘tables’ and available by the DBMS. In any case most
‘queries’ very properly as they are important. DBMS offer a high level of abstraction of the
data, by hiding its complexity behind a
---***--- relatively simple standard interface (principal of
information-hiding by Parnas).
Special Reading Supplement 2
The following diagram distinguishes Thus, data, database, database management
between actual data, database (DB), and system and end-users together form the
database system (DBS) and database DATABASE SYSTEM.
management system (DBMS).
---***---
18