0% found this document useful (0 votes)
21 views11 pages

Unit 1 - Basics of RDBMS

Uploaded by

bsmn027
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)
21 views11 pages

Unit 1 - Basics of RDBMS

Uploaded by

bsmn027
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/ 11

Self-Learning Material

[email protected]
svim0023

Program:MCA
Semester: 3
Course Name: Big Data Management and Analytics
Code: 21VMT6S303
Unit Name: Basics of RDBMS

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
Table of Contents

Introduction 3

Definition of Database: 3

Access Methods 3

Indexes – Access Method 3

Type of indexes are as follows: 4


Function-based indexes 4
Indexes based on bitmaps 4
Domain indexes 4
Clusters 4
ISAM 4

Data Models 5

Hierarchical Model 5
Network Model 5

Entity-relationship Model 5
[email protected]
svim0023
Relational Model 6

DBMS Vs RDBMS 7
Key Difference Between DBMS VS RDBMS 7

Advantages of DBMS 8
1. Reducing Data Redundancy 8
2. Sharing of Data 8
3. Data Integrity 8
4. Data Security 8
5. Privacy 8
6. Backup and Recovery 9
7. Data Consistency 9

Application of Databases 9

Keys 9
Super key 10
Candidate Key 10
Primary key 10
Foreign key 10
Secondary key 10

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
UNIT 1
BASICS OF RDBMS

Learn about the basic concepts of RDBMS - Data redundancy, relationships in data, Primary keys,
secondary keys.

Introduction
Databases and database technologies have had a significant impact on computer usage. Databases
are vital in practically every sector where computers are utilized, including business, electronic
commerce, social media, engineering, medical, genetics, law and education to name a few.

Definition of Database:
● A database is a collection of data that is linked together i.e. it is collection of related data.
We use the term "data" to refer to known facts that can be recorded and have implicit
meaning. For example, consider the names, phone numbers, and addresses of the people
[email protected]
svim0023 you know. These days, most of this information is saved on mobile phones, which come
with their own database software.

● Data can be stored in different ways, using a personal computer and applications such as
Microsoft Access or Excel, this information can be entered into an indexed address book or
saved on a hard drive. A database is a collection of related data having an underlying
meaning.

Access Methods
The primary goal of DBMS is to return data that the user has requested. It could be a record or a
set of records in RDBMS.

Indexes – Access Method


The index is a small table with two columns. The first column contains the table's primary key, and
the second column contains a set of pointers containing the address of the disc where the specific
key (value) can be found. Indexes are extremely useful for improving the search operation in a
DBMS system.

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
Type of indexes are as follows:
Function-based indexes

● A function-based index computes the expression values that appear in one or more columns
and are stored in the table.
● An arithmetic expression or a SQL function can be used as the expression.
● There can't be a null value in a function-based index.

● Example:
CREATE INDEX Sample _idx on table_(a+c*(b+d));

Indexes based on bitmaps

● Bitmap indexes are useful for working with low-cardinal (columns with few unique values)
columns in tables.
● For instance, boolean data has only two values: true or false.
● In data warehouse applications, bitmap indexes are very useful for joining large fact tables.

Domain indexes

● The domain index is used to create an index type schema object as well as an application
specific index. It is used to index data in a specific application domain.
[email protected]
svim0023
Clusters

● Clustering in DBMS is intended to provide high data availability. Clustering is used on


tables that are frequently accessed by the user.
● For example, if the department has a large number of employees, we can create an index
with a non-unique key, such as Dept-id. This means that all employees in the same
department are considered to be part of the same cluster.
● Clustering has the potential to improve performance.

ISAM

● The indexed sequential access method is a type of sequential access method (ISAM)
● ISAM was created by IBM for mainframe computers, but the term is now used to describe
a variety of concepts.
● ISAM is used in DBMS to access data sequentially (the order in which data is entered) or
randomly (with an index).

Data Models
Data models describe how a database's logical structure is represented. In a database management
system, data models are essential for introducing abstraction. Data models specify how data is
linked to one another, as well as how it is processed and stored within the system. While

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
the Relational Model is the most widely used database model, there are other models too:

● Hierarchical Model

● Network Model

● Entity-relationship Model

● Relational Model

This database model organizes information into a tree-like structure with a single root to which all
other information is linked. The hierarchy begins with the Root data and grows in a tree-like
fashion, adding child nodes to parent nodes.

In this model, a child node will only have a single parent node.

Hierarchical Model
● In a hierarchical model, data is organized into a tree-like structure with a one-to-many
relationship between two types of data, such as one department having many courses, many
professors, and, of course, many students.

Network Model
● Data
[email protected] in this model is organized more like a graph, and nodes can have more than one
svim0023
parent node.
● As more relationships are established in this database model, data becomes more related.
Also, because the data is more related, accessing it is easier and faster. Many-to-many data
relationships were mapped using this database model. This was the most widely used
database model, before the Relational Model was introduced.

Entity-relationship Model
● The Entity-Relationship (ER) Model is based on the concept of real-world entities and their
relationships. The ER Model creates entity sets, relationship sets, general attributes, and
constraints while formulating real-world scenarios into the database model.

● ER Model is best used for the conceptual design of a database.

ER Model is based on −

Entities and their attributes.

Relationships among entities.

Entity

● In an ER Model, an entity is a real-world entity with properties known as attributes. Every


attribute is defined by a set of values known as its domain. A student, for example, is

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
treated as an entity in a school database. A student has several characteristics such as his or
her name, age, class, and so on.

Relationships

● The term "relationship" refers to the logical connection between two or more entities.
Entities and relationships are mapped in a variety of ways. The number of associations
between two entities is defined by mapping cardinalities.

[email protected]
svim0023 Relational Model
Data is organized in two-dimensional tables in this model, and the relationship is
maintained by storing a common field.

Tables are the basic data structure in the relational model. All information pertaining to a
specific type is stored in the table's rows.
Hence, tables are also known as relations in relational model.

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
DBMS Vs RDBMS

● A database management system (DBMS) is software that stores and manages data. The
database management system (DBMS) was first introduced in the 1960s to store any type
of data. It also allows for data manipulation such as insertion, deletion, and updating.
[email protected]
svim0023
● The DBMS system also manages the database by defining, creating, revising, and
controlling it. It's built to create and maintain data while also allowing each business
application to extract the information it needs.

● RDBMS stands for Relational Database Management System and is a more advanced
version of a database management system. It was established in the 1970s. In addition, an
RDBMS system allows an organization to access data more quickly than a DBMS system.

● RDBMS is a software system that only stores data that must be stored in the form of tables.
Data in this type of system is managed and stored in rows and columns, which are referred
to as tuples and attributes. RDBMS is a powerful data management system that is used all
over the world.

Key Difference Between DBMS VS RDBMS

● DBMS stores data in the form of files, whereas RDBMS stores data in the form of tables.
● RDBMS supports multiple users, whereas DBMS only supports one.
● Client-server architecture is not supported by DBMS, but it is supported by RDBMS.
● RDBMS requires more hardware and software than DBMS.
● Data redundancy is common in DBMS, whereas keys and indexes do not allow for data
redundancy in RDBMS.

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
Advantages of DBMS
● A Database Management System (DBMS) is a software system that allows users to define,
create, maintain, and control database access. End users can use DBMS to create, read,
update, and delete data in a database. It serves as a barrier between programmes and data.

● Database Management System has many advantages over File Based Data Management
System. Some of these benefits are listed below.

1. Reducing Data Redundancy

● Multiple files were stored in many different locations within a system or even across
multiple systems in file-based data management systems. As a result, there were sometimes
multiple copies of the same file, resulting in data redundancy.

● This is avoided in a database because there is only one database and any change in it is
immediately reflected. As a result, there is no chance of encountering duplicate data.

2. Sharing of Data

● In a database, database users can share data among themselves. There are different levels of
authorization to access the data, and as a result, the data can only be shared if the proper
[email protected]
svim0023 authorization protocols are followed.

● Many remote users can also access the database at the same time and share data among
themselves.

3. Data Integrity

● The term "data integrity" refers to the accuracy and consistency of the data in the database.
Because a DBMS contains multiple databases, data integrity is critical. All of these
databases contain information that can be accessed by multiple users. As a result, it is
critical to ensure that the data in all databases and for all users is correct and consistent.

4. Data Security

● In a database, data security is a critical concept. Only authorized users should be able to
access the database, and their identities should be verified with a username and password.
Unauthorized users should never be allowed to access the database because it violates the
integrity constraints.

5. Privacy

● A database's privacy rule means that only authorized users can access the database in
accordance with its privacy constraints. There are different levels of database access, and a

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
user can only view the data that he is permitted to see. For example, in social networking
sites, access constraints differ depending on which accounts a user wishes to access.

6. Backup and Recovery

● Backup and recovery are handled automatically by the Database Management System.
Users are not required to backup data on a regular basis because the DBMS handles this for
them. Furthermore, it restores the database to its previous state following a crash or system
failure.

7. Data Consistency

● In a database, there is no data redundancy, so data consistency is guaranteed. All data is


consistent throughout the database, and all users viewing the database see the same
information. Furthermore, any database changes are immediately reflected to all users,
ensuring that there is no data inconsistency.

Application of Databases
A database management system can be used in a variety of fields. The applications that use the
information base administration framework are listed below.

● Railway Reservation System – An information base is required in the rail route


reservation
[email protected] framework to store the record or information of ticket appointments, train
svim0023
appearance status, and flight. Furthermore, if trains are delayed, people are made aware of
it through the information base update.

● Library Management System – Because the library has a large number of books, it is
difficult to keep track of them all in a register or duplicate. In this way, the data set
administration framework (DBMS) is used to keep track of all the information related to
the book's title, publication date, accessibility, and author.

● HR Management
For information on employees, salaries, payroll, deductions, paycheck generation, and so
on.

● Banking System:
For storing customer information, tracking daily credit and debit transactions, generating
bank statements, and so on. All of this work was completed with the assistance of database
management systems.

● Online shopping:
You must be familiar with online shopping websites such as Amazon, Flipkart, and others.
These websites save product information, your addresses and preferences, your credit card
information, and provide you with a relevant list of products based on your search. All of
this necessitates the use of a database management system.

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
● Airline Reservation:
Airlines, like railway reservation systems, require DBMS to keep track of flight arrivals,
departures, and delays.

Keys
STUDENT
Stud_no Stud_name Stud_phone Stud_state Stud_country Stud_age
1 Jay 9878083789 Karnataka India 20
2 Ram 9880378064 Tamil nadu India 19
3 Sujay 9039786529 Rajasthan India 18
4 Suresh 8890765467 Andra India 21

COURSE
Stud_no Course_no Course_name
1 CS2 DBMS
2 CS3 Computer networks
[email protected]
1 CS3 Computer networks
svim0023

Keys are the entity set used to uniquely identify an entity within its entity set.

Super key: Super Key refers to the set of attributes that can uniquely identify a tuple. For
instance, STUD NO, (STUD NO, STUD NAME), and so on.

Candidate Key: A candidate key is the smallest set of attributes that can uniquely identify a
tuple. For instance, STUD NO in the STUDENT relation.
1. The Candidate Key value is unique and non-null for each tuple.
2. A relation may contain more than one candidate key.STUD NO, for example, is the
candidate key for the relation STUDENT.
3. The candidate key can be simple (only having one attribute) or composite.STUD NO,
COURSE NO, for example, is a composite candidate key for the relation STUDENT
COURSE.

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
Primary key: There may be more than one candidate key in relation, with one being selected
as the primary key. For example, both STUD NO and STUD PHONE are candidate keys for the
relation STUDENT, but STUD NO can be chosen as the primary key (only one out of many
candidate keys).

Foreign key: Foreign key is known as a link key between two or more tables. A foreign key of
one table is derived from the primary key of another table or parent table .

Secondary key: A primary key is the field in a database that is the primary key used to
uniquely identify a record in a database. A secondary key is an additional key, or alternate
key, which can be used in addition to the primary key to locate specific data.

[email protected]
svim0023

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.

You might also like