0% found this document useful (0 votes)
17 views30 pages

DBMS Chapter-1

The document discusses the introduction to database management systems (DBMS). It defines key terms like data, database, table, row and column. It also explains characteristics, applications, advantages and disadvantages of DBMS.

Uploaded by

aiden.atz78
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views30 pages

DBMS Chapter-1

The document discusses the introduction to database management systems (DBMS). It defines key terms like data, database, table, row and column. It also explains characteristics, applications, advantages and disadvantages of DBMS.

Uploaded by

aiden.atz78
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

TECH-VISION INSTITUTE OF CS Mob No: 7030766381

Subject: BCA-303 Database Management System

TECH-VISION INSTITUTE OF CS, NANDED

Lecturer: Mr. Rohit Phule

Unit- I Introduction to DBMS

1.1 : Introduction, Definition & Application Area

 DATA:
The term data can be defined as known facts or raw facts that could be recorded
or stored in computer.
 DATABASE:
A database is a organized collection of data. In other words, a database is a
collection of information in a systematic manner in form of tables.
 TABLE:
A table is a collection of rows and columns.

 ROW:
Row represents a set of related data. Example: (1, abc,6586565656)
 COLUMN:
A column is a set of data values of particular type, one value for each row of
database. Example: ID,CUST_NAME,PHONE, etc
 DBMS:
DBMS stands for Database Management System. It is a software or set of
programs that allow user to create, process, store, retrieve and manage data.

1
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

 Applications of DBMS: 

SECTOR USE OF DBMS


Banking For customer’s information, account
activities, payment deposits, loans,
etc.
Airlines For reservation and schedule
information.
Universities For student info, course registration,
colleges & grades.
Telecommunication It helps to keep call records,
monthly bills, maintaining balances,
etc.
Finance For storing info about stock, sales &
purchases.
Manufacturing For management supply chain and
tracking production.
Online shopping To store product info, addresses,
payment details, etc.

1.2 Characteristics Of Dbms:

 ACID Properties –
DBMS follows the concepts of Atomicity, Consistency, Isolation, and Durability
(normally shortened as ACID). These concepts are applied on transactions, which
manipulate data in a database. ACID properties help the database stay healthy in multi-
transactional environments and in case of failure.
 Multiuser and Concurrent Access –
DBMS supports multi-user environment and allows them to access and
manipulate data in parallel. Though there are restrictions on transactions when users
attempt to handle the same data item, but users are always unaware of them.
 Multiple views –
DBMS offers multiple views for different users. A user who is in the Sales
department will have a different view of database than a person working in the Production
2
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

department. This feature enables the users to have a concentrate view of the database
according to their requirements.

 Security –
Features like multiple views offer security to some extent where users are
unable to access data of other users and departments.
 Backup and Recovery
There are many chances of failure of whole database. At that time no one will
be able to get the database back and for sure company will be in a big loss. The only solution
is to take backup of database and whenever it is needed, it can be stored back.
 Data Integrity
It protects unauthorized access of database and makes it more secure. It
brings only consistence and accurate data into the database.
 Stores Any Kind of Data
A database management system should be able to store any kind of data. It
should not be restricted to employee name, salary and address. Any kind of data that exists
in the real world can be stored in DBMS because we need to work with all kinds of data
that is present around us.
 Query Language
Queries are used to retrieve and manipulate data but DBMS is armed by a strong
query language that make it more effective and efficient. Users have the power to retrieve
any kind of data they want from database by applying different set of queries.

1.3 Advantages of DBMS:

 Data Redundancy
Unlike traditional file-system storage, Data Redundancy in DBMS is very less or
not present. Data Redundancy occurs when the same data are stored unnecessarily at
different places. Data Redundancy is reduced or eliminated in DBMS because all data are
stored at a centralized location rather than being created by individual users and for each
application.
 Data Inconsistency
In traditional file system storage, the changes made by one user in one
application doesn’t update the changes in other application, given both have the same set

3
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

of details. While this is not the case with DBMS systems as there is a single repository of
data that is defined once and is accessed by many users, and data are consistent.
 Data Backup and Recovery
This is another advantage of DBMS as it provides a strong framework for Data
backup, users are not required to back up their data periodically and manually, it is
automatically taken care by DBMS. Moreover, in case of a server crash, DBMS restores
the Database to its previous condition.
 Data Security
Data Security is vital concept in a database. Only authorized users should be
allowed to access the database and their identity should be authenticated using a username
and password. Unauthorized users should not be allowed to access the database under any
circumstances
 Sharing of Data
In a database, the users of the database can share the data among themselves.
There are various levels of authorization to access the data, and consequently the data can
only be shared based on the correct authorization protocols being followed.
 Data Integrity
Data integrity means that the data is accurate and consistent in the database.
Data Integrity is very important as there are multiple databases in a DBMS. All of these
databases contain data that is visible to multiple users. So it is necessary to ensure that
the data is correct and consistent in all the databases and for all the users.
 Flexibility
Flexibility DBMS approach ensures database is adaptable to change.
Sometimes, it may be necessary to change the structure of a database.
Modern DBMS allow certain types of Change to the structure of the database without
affecting stored data and exiting stored data and existing application programs.

1.4 Disadvantages of DBMS:

 Increased Cost
To store huge amount of data, one needs huge amount of space. Additionally, it
will require more memory and fast processing power to run the DBMS. So, an expensive
hardware and software will be needed that can provide all these facilities. As a result, old
file-based system needs to be upgraded. These sophisticated hardware and software
require maintenance which is very costly.

4
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

DBMS requires high initial investment for hardware and software. A significant
investment based upon size and functionality of organization is required. Also, organization
has to pay concurrent annual maintenance cost.
 Increased Vulnerability
As DBMS is capable of many things because it is centralized, but at the same
time centralization increases vulnerability. The whole system shuts down due to the failure
of a single component.
 Complexity
A DBMS fulfill lots of requirement and it solve many problems related to
database. But all these functionalities make dbms an extremely complex software.
Developers, designers, DBA and end users of database must have complete skills of DBMS
if they want to use it properly.
If they don’t understand this complex software then it may cause loss of
data or database failure.
 Technical staff required
Organization has many employees working for them and these employees can
perform many other tasks too that are not in their domain but it is also impossible for them
to work on dbms.
A dedicated team of technical staff is required who can handle dbms and as a
result, company has to pay salary to them.
 Database failure
Data is key for any organization, if data is lost then whole organization will
collapse. And as we know that in dbms, all the files are stored in single database so chances
of database failure becomes more.
 Huge size
DBMS is made to handle extremely huge data and queries, but due to its
complexity dbms has become huge in size. As a result, it requires lots of space and memory
to run its application efficiently.
 System maintenance
System should be maintained and update with security measures frequently.
 Privacy and Security
If information from the data centre gets corrupted then every user of the
organization will be in a big trouble.

5
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

1.5 Users Of DBMS:


Database users are categorized based up on their interaction with the data
base. Their are six types of database users in DBMS.

 Database administrator(DBA)
Database Administrator (DBA) is a person/team who defines the schemaand also controls
the 3 levels of database.
The DBA will then create a new account id and password for the user ifhe/she need to
access the data base.
DBA is also responsible for providing security to the data base and he allows only the
authorized users to access/modify the data base.
 DBA also monitors the recovery and back up and provide technical support.
 The DBA has a DBA account in the DBMS which called a system or super user account.
 DBA repairs damage caused due to hardware and/or software failures.
 Naive/Parametric End Users:
Parametric End Users are the unsophisticated who don’t have any DBMS
knowledge but they frequently use the data base applications in their daily life to get the
desired results.
For examples, Railway’s ticket booking users are naive users. Clerks in any
bank is a naive user because they don’t have any DBMS knowledge but they still use the
database and perform their given task.
 System Analyst :
System Analyst is a user who analyzes the requirements of parametric end
users. They check whether all the requirements of end users are satisfied.
 Sophisticated Users :
Sophisticated users can be engineers, scientists, business analyst, who are
familiar with the database. They can develop their own data base applications according to
their requirement. They don’t write the program code but they interact the data base by
writing SQL queries directly through the query processor.
 Data Base Designers :
Data Base Designers are the users who design the structure of data base
which includes tables, indexes, views, constraints, triggers, stored procedures. He/she
controls what data must be stored and how the data items to be related.
 Application Programmer :
Application Program are the back end programmers who writes the code for
the application programs. They are the computer professionals. These programs could be
6
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

written in Programming languages such as Visual Basic, Developer, C, FORTRAN, COBOL


etc.

1.6 Structure Of DBMS:


Database Management System (DBMS) is a software that allows access to
data stored in a database and provides an easy and effective method of –
 Defining the information.
 Storing the information.
 Manipulating the information.
 Protecting the information from system crashes or data theft.
 Differentiating access permissions for different users.
The database system is divided into four components: Users, Query
Processor, Storage Manager, and Disk Storage. These are explained as following below.

 Query Processor :
It interprets the requests (queries) received from end user via an
application program into instructions. It also executes the user request which is received
from the DML compiler.
Query Processor contains the following components –
1. DML Compiler –
It processes the DML statements into low level instruction (machine
language), so that they can be executed.
2. DDL Interpreter –
It processes the DDL statements into a set of table containing meta data
(data about data).
3. Query Optimizer –
It executes the instruction generated by DML Compiler.

 Storage Manager :
Storage Manager is a program that provides an interface between the
data stored in the database and the queries received. It is also known as Database
Control System. It maintains the consistency and integrity of the database by applying

7
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

the constraints and executes the DCL statements. It is responsible for updating, storing,
deleting, and retrieving data in the database.
It contains the following components –
1. Authorization Manager –
It ensures role-based access control, i.e,. checks whether the particular
person is privileged to perform the requested operation or not.
2. Integrity Manager –
It checks the integrity constraints when the database is modified.
3. Transaction Manager –
It controls concurrent access by performing the operations in a scheduled
way that it receives the transaction. Thus, it ensures that the database remains in the
consistent state before and after the execution of a transaction.
4. File Manager –
It manages the file space and the data structure used to represent
information in the database.
5. Buffer Manager –
It is responsible for cache memory and the transfer of data between the
secondary storage and main memory.

 Disk Storage :
It contains the following components –
1. Data Files –
It stores the data.
2. Data Dictionary –
It contains the information about the structure of any database object.
It is the repository of information that governs the metadata.
3. Indices-
It provides faster retrieval of data item.

 Users:
There are 4 users which directly or indirectly interact with DBMS they are:
1. Naïve user
2. Application programmer
3. Sophisticated user
4. Database administrator

8
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

Fig: Structure of DBMS

1.7 View Of Data- Data Abstraction, Instances & Schemas:

It refers that how database is actually stored in database, what data


and structure of data used by database for data. So describe all this database provides user
with views and these are:

 Data abstraction

 Instances and schemas.


 Data abstraction

As a data in database are stored with very complex data structure so when
user come and want to access any data, he will not be able to access data if he has go through

9
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

this data structure. So to simplify the interaction of user and database, DBMS hides some
information which is not of user interest, this is called data abstraction:- So developer hides
complexity from user and store abstract view of data.

Data abstraction has three level of abstractions:

1. Physical level / internal level

2. Logical level / conceptual level

3. view level / external level

Physical level:-
This is the lowest level of data abstraction which describe How data is actual
stored in database. This level basically describe the data structure and access path /indexing
use for accessing file.
Logical level:-
The next level of abstraction describe what data are stored in the
database and what are the relationship existed among those of data.
View level:-
In this level user only interact with database and the complexity remain
TECH-VISION INSTITUTE OF CS
unview . User see data and there may be many views of one data like chart and graph.

 Instances and schemas.

10
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

1. Schema:
Design of database is called the Schema. It is basically skeleton
structure that represent the logical view of entire database. It defines how data is
organized and how the relationship among them are associated. It formulates all the
constraints that are to be applied on the data.
Database system has various schemas:
1. Physical schema
2. Logical schema
3. View schema

1. Physical Database Schema:


 It describes how data will be stored in hard disc / secondary storage device.
 It describes the database design at physical level.
 The schema related to the actual storage of data and its form of storage like file,
indices.

2.Logical Database Schema:

 This schema define all the logical constraints that need to be applied on the data storage.
 It Defines table, views, and integrity constraint.
 Define relationship between table and keys applied.

3.View Schema:

11
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

 It describes different views of database and sometime also called subschema..

2. Instances:
Data stored in database at particular moment of time is instance of database.
1.8 Database Languages:
A DBMS must provide appropriate languages and interfaces for each
category of users to express database queries and updates. Database Languages
are used to create and maintain database on computer.
Following are the database languages:
1. Data Definition Language (DDL)
2. Data Manipulation Language (DML)
3. Data Control Language (DCL)
4. Transaction Control Language (TCL)

1. Data Definition Language (DDL)-

It is a language that allows the users to define data and their relationship to
other types of data. It is mainly used to create files, databases, data dictionary and tables within
databases.
It is also used to specify the structure of each table, set of associated values
with each attribute, integrity constraints, security and authorization information for each table
and physical storage structure of each table on disk.
The following table gives an overview about the usage of DDL statements:

12
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

2. Data Manipulation Language(DML)-


It is a language that provides a set of operations to support the basic data
manipulation operations on the data held in the databases. It allows users to insert,
update, delete and retrieve data from the database. The part of DML that involves
data retrieval is called a query language.
The following table gives an overview about the usage of DML statements:

3. Data Control Language(DCL)-

DCL statements control access to data and the database using statements
such as GRANT and REVOKE. A privilege can either be granted to a User with the help of GRANT
statement. The privileges assigned can be SELECT, ALTER, DELETE, EXECUTE, INSERT, INDEX
etc. In addition to granting of privileges, you can also revoke (taken back) it by using REVOKE
command.
The following table gives an overview about the usage of DCL statements:
13
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

4. Transaction Control Language(TCL)-


Manage transactions in the Database using the Transaction Control
Language. The following table gives an overview about the usage of TCL statements:

1.9 File Processing System Vs DBMS:

File Processing System DBMS


• Software that manages the data • Software to create and manage
files in computer system. database.

 Helps to store collection of raw • Helps to easily store, retrieve


data files into hard disk. and manipulate data in database.

• Tasks such as storing, retrieving, • These operations are easy to


searching are done manually. perform since it allows using
queries.

• There is more redundant data. • Data redundancy is less.

• Data is inconsistent. • Data is consistent.

• Doesn’t provide security. • Better security.

• Concurrency control is not • Multiple user access data at


possible single user system. same time.

14
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

• Data integrity is not maintained. • It maintains data integrity by


enforcing constraints.

• Small organizations uses file • Large organizations uses dbms.


system.

 Relatively cheap. • Relatively expensive.

• Files are files. • Files are tables.

 Eg. Ntfs, ext, etc. • Eg. Mysql, oracle, etc.

1.10 File Organization- Introduction, Types Of File Organization:

A database consist of a huge amount of data. The data is grouped within a


table in RDBMS, and each table have related records. A user can see that the data is stored in
form of tables, but in actual this huge amount of data is stored in physical memory in form of
files.

File –
A file is named collection of related information that is recorded on secondary
storage such as magnetic disks, magnetic tables and optical disks.
File Organization-
File Organization refers to the logical relationships among various records that
constitute the file, particularly with respect to the means of identification and access to any
specific record. In simple terms, Storing the files in certain order is called file Organization. File
Structure refers to the format of the label and data blocks and of any logical control record.

Types of File Organizations –

Various methods have been introduced to Organize files. These particular


methods have advantages and disadvantages on the basis of access or selection . Thus it is all

15
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

upon the programmer to decide the best suited file Organization method according to his
requirements.
Some types of File Organizations are :

 Sequential File Organization


 Heap File Organization
 Hash File Organization
 Clustered File Organization

 Sequential File Organization


The easiest method for file Organization is Sequential method. In this
method the file are stored one after another in a sequential manner. There are two ways
to implement this method:
1. Pile File Method
2. Sorted File Method

1. Pile File Method – This method is quite simple, in which we store the
records in a sequence i.e one after other in the order in which they are
inserted into the tables.

a) Insertion of new record –


-- Let the R1, R3 and so on upto R5 and R4 be four records in the sequence. Here,
records are nothing but a row in any table. Suppose a new record R2 has to be
inserted in the sequence, then it is simply placed at the end of the file.

16
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

2.Sorted File Method- In this method, As the name itself suggest whenever a new
record has to be inserted, it is always inserted in a sorted (ascending or descending)
manner. Sorting of records may be based on any primary key or any other key.

a) Insertion of new record –


-- Let us assume that there is a preexisting sorted sequence of four records R1, R3, and
so on upto R7 and R8. Suppose a new record R2 has to be inserted in the sequence, then
it will be inserted at the end of the file and then it will sort the sequence .

-Pros and Cons of Sequential File Organization –


Pros –

17
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

 Fast and efficient method for huge amount of data. 


 Simple design. 
 Files can be easily stored in magnetic tapes i.e cheaper storage mechanism.
Cons –
 Time wastage as we cannot jump on a particular record that is required, but we have to
move in a sequential manner which takes our time.
 Sorted file method is inefficient as it takes time and space for sorting records.

 Heap File Organization:


It is the simplest and most basic type of organization. It works with data
blocks. In heap file organization, the records are inserted at the file's end. When the
records are inserted, it doesn't require the sorting and ordering of records.

a) Insertion of new record:

--When the data block is full, the new record is stored in some other block. This new
data block need not to be the very next data block, but it can select any data block in the
memory to store new records. The heap file is also known as an unordered file.

--Suppose we have five records R1, R3, R6, R4 and R5 in a heap and suppose we want to
insert a new record R2 in a heap. If the data block 3 is full then it will be inserted in any
of the database selected by the DBMS, let's say data block 1.

18
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

-Pros & Cons Of Heap File Organization:

Pros-

 It is a very good method of file organization for bulk insertion. If there is a large
number of data which needs to load into the database at a time, then this method
is best suited.
 In case of a small database, fetching and retrieving of records is faster than the
sequential record.

-Cons

 This method is inefficient for the large database because it takes time to search
or modify the record.
 This method is inefficient for large databases.

 Hash File Organization:


Hash File Organization uses the computation of hash function on some fields of
the records. The hash function's output determines the location of disk block where the
records are to be placed.
When a record has to be received using the hash key columns, then the address
is generated, and the whole record is retrieved using that address.

19
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

In this method, there is no effort for searching and sorting the entire file.
In this method, each record will be stored randomly in the memory.

a) Insertion of new record:

--when a new record has to be inserted, then the address is generated using the hash key
and record is directly inserted.

-Pros & Cons Of Heap File Organization:

Pros-

 Records need not be sorted after any of the transaction. Hence the effort of sorting is
reduced in this method.
 Since block address is known by hash function, accessing any record is very faster.
Similarly updating or deleting a record is also very quick.

Cons-

 Since all the records are randomly stored, they are scattered in the memory. Hence
memory is not efficiently used.
20
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

 If these hash columns are frequently updated, then the data block address is also changed
accordingly. Each update will generate new address. This is also not acceptable.

 Clustered File Organization:


When the two or more records are stored in the same file, it is known as
clusters. These files will have two or more tables in the same data block, and key attributes
which are used to map these tables together are stored only once.
This method reduces the cost of searching for various records in different
files. In this method, we can directly insert, update or delete any record. Data is sorted
based on the key with which searching is done.

1.11 Data Models In DBMS

A Database model defines the logical design and structure of a


database and defines how data will be stored, accessed and updated in a database
management system.

21
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

Different types of data models are:


1. Hierarchical Model
2. Network Model
3. Entity-relationship Model
4. Relational Model

1. 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 heirarchy 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.

2. 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.

22
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

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.

3. Entity-relationship Model
In this database model, relationships are created by dividing object of
interest into entity and its characteristics into attributes.
Different entities are related using relationships.
E-R Models are defined to represent the relationships into pictorial
form to make it easier for different stakeholders to understand.

 Entities: Entity is a real-world thing. It can be a person, place, or even a


concept. Example: Teachers, Students, Course, Building, Department, etc are some of the
entities of a School Management System.

 Attributes: An entity contains a real-world property called attribute. This is the


characteristics of that attribute. Example: The entity teacher has the property like
teacher id, salary, age, etc.

 Relationship: Relationship tells how two attributes are related. Example: Teacher works
for a department.

23
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

4. Relational Model
In this model, data is organized in two-dimensional tables and the
relationship is maintained by storing a common field.
This model was introduced by E.F Codd in 1970, and since then it has
been the most widely used database model, infact, we can say the only database model used
around the world.
The basic structure of data in the relational model is tables. All the
information related to a particular type is stored in rows of that table.
Hence, tables are also known as relations in relational model.

24
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

1.12 Indexes In DBMS


Indexing is used to optimize the performance of a database by minimizing
the number of disk accesses required when a query is processed.
The index is a type of data structure. It is used to locate and access the data in
a database table quickly.

 Structure of index:
• The first column is the Search key that contains a copy of the primary key of the table.
These values are stored in sorted order so that the corresponding data can be accessed
quickly.
• The second column is the Data Reference or Pointer which contains a set of pointers
holding the address of the disk block where that particular key value can be found.

 Types of indexes in DBMS:

 Primary Index:- (Ordered + Key)


If the index is created on the basis of the primary key of the table, then
it is known as primary indexing. These primary keys are unique to each record.

25
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

As primary keys are stored in sorted order, the performance of the searching operation is
quite efficient.
The primary index can be classified into two types:
1. Dense index
2. Sparse index.
1. Dense index:
The dense index contains an index record for every search key value in
the data file. It makes searching faster.
In this, the number of records in the index table is same as the number
of records in the main table.
The index records have the search key and a pointer to the actual record
on the disk.

2. Sparse index:
In the data file, index record appears only for a few items. Each item
points to a block.
In this, instead of pointing to each record in the main table, the index
points to the records in the main table in a gap.

26
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

• Clustered Index:– (Ordered + Non-key)


A clustered index can be defined as an ordered data file. Sometimes the
index is created on non-primary key columns which may not be unique for each record.
In this case, to identify the record faster, we will group two or more
columns to get the unique value and create index out of them. This method is called a
clustering index.
The records which have similar characteristics are grouped, and indexes
are created for these group.
Example: suppose a company contains several employees in each department. Suppose we
use a clustering index, where all employees which belong to the same Dept_ID are
considered within a single cluster, and index pointers point to the cluster as a whole. Here
Dept_Id is a non-unique key.

27
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

The previous schema is little confusing because one disk block is sharedby records which
belong to the different cluster. If we use separate disk block for separate clusters, then it is
called better technique.

28
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

• Secondary Index:- (Unordered + Key/Non-Key)


A secondary index, put simply, is a way to efficiently access records in a
database by means of some piece of information other than the usual (primary) key.
Secondary indexes can be created manually by the application; there is no
disadvantage, other than complexity, to doing so.
Secondary index provides a secondary means of accessing data for which
primary access already exist.
Secondary index is created on each record of file(Dense).
Secondary index can be created on both Unordered + Key & Unordered +
Non-key.

29
TECH-VISION INSTITUTE OF CS Mob No: 7030766381

30

You might also like