Professional Documents
Culture Documents
DBMS U1 p1
DBMS U1 p1
__________________________________________________
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.
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
• E.g. payroll people only handle employee records, and cannot see
customer accounts; tellers only access account data and cannot see
payroll data.
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
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.
Maulik Chandarana DBMS
2. Instance
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.
A query is a statement requesting the retrieval of information. The portion of DML that involves
information retrieval is called query language. Though technically incorrect, the terms ‘query language’
and ‘DML’ are used synonymously. E.g. SQL, QBE, Datalog, etc.
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
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.
14. Unlike entities in the E-R model, each object has its own unique identity, independent of the values it
contains:
a. Two objects containing the same values are distinct.
b. Distinction is maintained in physical level by assigning distinct object identifiers.
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.
d. Some special types of programming languages combine Pascal-like control structures with
control structures for the manipulation of a database.
e. These are sometimes called fourth-generation languages.
f. They often include features to help generate forms and display data.
2. Sophisticated users: They interact with the system without writing programs.
a. They form requests by writing queries in a database query language.
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.
Maulik Chandarana DBMS
c. Transaction manager: Transaction manager ensures that the database remains in a consistent
(correct) state despite system failures (e.g., power failures and operating system crashes) and
transaction failures.
d. DML precompiler: It converts DML statements embedded in an application program to normal
procedure calls in a host language. The precompiler interacts with the query processor.
e. DDL compiler: It converts DDL statements to a set of tables containing metadata stored in a
data dictionary.
4. In addition, several data structures are required for physical system implementation:
c. Data files: They store the database itself.
d. 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.
e. Indices: They provide fast access to data items holding particular values.
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].
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.
Please understand the terms ‘tables’ and ‘queries’ very properly as they
are important.
Maulik Chandarana 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
Maulik Chandarana DBMS
data for review, and print it out. Forms are mutually dependent files. Those files contain
designed to make onscreen data entry and the following information:
retrieval easier. In most database 1. The set of data, available to the user, the so
programs, you will almost always use a called "End-user data". Those are the real data,
form to enter and edit data because you which can be read, connected and modified by
can enter information to be stored in more the user (if he has the corresponding rights).
than one table on a single form. Another 2. The so called "metadata" (the data
advantage of using forms to enter and edit describing the end-user data). In this part, we
data is that you look at only one record at describe the properties (e.g. their type) and the
a time. If you enter data using tables, you relative relations of the end-user data.
will have to look at a confusing number of
records at once. DBMS and End-Users: A database is
implemented by a powerful software system,
Q. What Are Reports? the so called "Database Management System"
A Report provides a way to retrieve (DBMS). This system consists of a number of
selected stored data and present that programs, controlling the structure of the
information effectively and meaningfully. database as well as the access to those data.
Reports are designed to be printed out The DBMS is serving as "mediator" between
rather than viewed on a computer screen, the end-user and the effective user-data by
so they need to be carefully planned. translating the user-commands into complex
Examples of everyday reports include sequences of instructions. With this translation
mailing labels, invoices, receipts, sales it ensures the access required for those
summaries, and phone books. You can commands to the user-data. Often the DBMS
combine text, data, pictures, lines, boxes, enables the access to the data by several,
graphs, and drawings to produce exactly simultaneous independent users. The number
the report you want. Fortunately, the latest of users can be very high (searching in
versions of the big database packages libraries, payment/account systems in banks
also come with several preplanned report etc.). The end-user has the possibility of writing
layouts that you can set up quickly using application-programs in classical programming
Report Wizards. languages such as Pascal, COBOL, C, or JAVA
(embedded in a query-system to the DMBS) or
Please understand the terms ‘tables’ and to access with utility-programs made available
‘queries’ very properly as they are important. by the DBMS. In any case most DBMS offer a
high level of abstraction of the data, by hiding
---***--- its complexity behind a relatively simple
standard interface (principal of information-
Special Reading Supplement 2 hiding by Parnas).
The following diagram distinguishes
between actual data, database (DB), and Thus, data, database, database management
database system (DBS) and database system and end-users together form the
management system (DBMS). DATABASE SYSTEM.
---***---