z
Database
Management
System
z
What is RDBMS?
z
What is RDBMS?
z
What is RDBMS?
z
What is RDBMS?
z
What is RDBMS?
Definition:
A relational database management system (RDBMS) is a
collection of data items with pre-defined relationships between
them.
z
What is RDBMS?
Definition:
A relational database management system (RDBMS) is a
collection of data items with pre-defined relationships between
them.
These items are organized as a set of tables with columns and
rows.
z
What is RDBMS?
Definition:
A relational database management system (RDBMS) is a
collection of data items with pre-defined relationships between
them.
These items are organized as a set of tables with columns and
rows.
Tables are used to hold information about the objects to be
represented in the database.
z
History of RDBMS
RDBMS model:
RDBMS was invited by E. F. Codd in 1970.
He proposed the idea of storing data into row-column format.
The paper published is “A Relational Model of Data for Large
Shared Data Banks”
z
Features of RDBMS?
z
Features of RDBMS?
Offers information to be saved in the tables.
z
Features of RDBMS?
Offers information to be saved in the tables.
Numerous users can access it together which is managed by a
single user.
z
Features of RDBMS?
Offers information to be saved in the tables.
Numerous users can access it together which is managed by a
single user.
Virtual tables are available for storing the insightful data.
z
Features of RDBMS?
Offers information to be saved in the tables.
Numerous users can access it together which is managed by a
single user.
Virtual tables are available for storing the insightful data.
In order to exclusively find out the rows, the primary key is used.
z
Features of RDBMS?
Offers information to be saved in the tables.
Numerous users can access it together which is managed by a
single user.
Virtual tables are available for storing the insightful data.
In order to exclusively find out the rows, the primary key is used.
The data are always saved in rows and columns.
z
Features of RDBMS?
Offers information to be saved in the tables.
Numerous users can access it together which is managed by a
single user.
Virtual tables are available for storing the insightful data.
In order to exclusively find out the rows, the primary key is used.
The data are always saved in rows and columns.
To retrieve the information the indexes are used.
z
Features of RDBMS?
Offers information to be saved in the tables.
Numerous users can access it together which is managed by a single
user.
Virtual tables are available for storing the insightful data.
In order to exclusively find out the rows, the primary key is used.
The data are always saved in rows and columns.
To retrieve the information the indexes are used.
Columns are being shared between tables using the foreign key.
z
What is a table?
The data tables used in a relational database store information
about the related objects.
z
What is a table?
The data tables used in a relational database store information
about the related objects.
Each row holds a record with a unique identifier known as a
key and each column contains the attributes of the data.
z
What is a table?
The data tables used in a relational database store information about
the related objects.
Each row holds a record with a unique identifier known as a key and
each column contains the attributes of the data.
Each record assigns a value to each feature, making relationships
between data points easy to identify.
z
Structured Query Language
z
Structured Query Language
SQL is the standardized language used to access the database.
ANSI/SQL defines the SQL standard. The current version of SQL is
SQL:2023.
z
Structured Query Language
SQL is the standardized language used to access the database.
ANSI/SQL defines the SQL standard. The current version of SQL is
SQL:2023.
SQL contains three parts:
Data definition language includes statements that help you define
the database and its objects, e.g., tables, views, triggers, stored
procedures etc.
z
Structured Query Language
SQL is the standardized language used to access the database.
ANSI/SQL defines the SQL standard. The current version of SQL is
SQL:2023.
SQL contains three parts:
Data definition language includes statements that help you define
the database and its objects, e.g., tables, views, triggers, stored
procedures,
Data manipulation language contains statements that allow you
to update and query data.
z
Structured Query Language
SQL is the standardized language used to access the database.
ANSI/SQL defines the SQL standard. The current version of SQL is
SQL:2023.
SQL contains three parts:
Data definition language includes statements that help you define
the database and its objects, e.g., tables, views, triggers, stored
procedures,
Data manipulation language contains statements that allow you
to update and query data.
Data control language allows you to grant the permissions to a
user to access specific data in the database.
z
Advantages of RDBMS
z
Advantages of RDBMS
The main advantage of relational databases is that they enable
users to easily categorize and store data that can later be queried
and filtered to extract specific information for reports.
z
Advantages of RDBMS
The main advantage of relational databases is that they enable
users to easily categorize and store data that can later be
queried and filtered to extract specific information for reports.
Relational databases are also easy to extend and aren't reliant
on physical organization. After the original database creation, a
new data category can be added without all existing
applications being modified.
z
Few more advantages…
Flexibility: Complex queries are easy for users to carry.
Collaboration: Multiple users can access the same database.
Trust: Relational database models are mature and well-
understood.
Security: Data in tables within a RDBMS can be limited to allow
access by only specific users.
z
Tables
z
Tables
Tables are a logical structure maintained by the Database
manager. In a table, each vertical block is called a column
(Tuple) and each horizontal block is called a row (Entity).
z
Tables
Tables are a logical structure maintained by the Database
manager. In a table, each vertical block is called a column
(Tuple) and each horizontal block is called a row (Entity).
At the intersection of every column and row is a specific data
item, which is called a value. A column is a set of values of the
same type. A row is a sequence of values such that the nth
value is a value of the nth column of the table. Every table must
have one or more columns, but the number of rows can be zero.
z
Primary Keys
z
Primary Keys
A primary key is a special type of unique key
and cannot contain null values. A table can have
no more than one primary key.
In the table “StudentInfo”, STUDENT_ID is the
primary key and is used to represent the unique
set of records.
Primary keys are optional and can be defined in
CREATE TABLE or ALTER TABLE statement.
z
Foreign Keys
z
Foreign Keys
A foreign key is a set of columns in a
table which are required to match at
least one primary key of a row in
another table.
A table can have zero or more foreign
keys.
In table “StudentsMarksInfo”, Student
ID is the foreign key and it’s a primary
key of table “StudentInfo”. Here, the
foreign key is used to get the student
information in the Marks register table.
z
MySQL - Introduction
z
MySQL - Introduction
MySQL is a relational database management system.
z
MySQL - Introduction
MySQL is a relational database management system.
MySQL is free and open-source released in 1995 by Oracle
Corporation.
z
MySQL - Introduction
MySQL is a relational database management system.
MySQL is free and open-source released in 1995 by Oracle
Corporation.
MySQL is ideal for both small and large applications.
z
MySQL - Introduction
MySQL is a relational database management system.
MySQL is free and open-source released in 1995 by Oracle
Corporation.
MySQL is ideal for both small and large applications.
MySQL is very fast, reliable, scalable, and easy to use.
z
MySQL - Introduction
MySQL is a relational database management system.
MySQL is free and open-source released in 1995 by Oracle
Corporation.
MySQL is ideal for both small and large applications.
MySQL is very fast, reliable, scalable, and easy to use.
Its name is a combination of "My", the name of co-founder
Michael Widenius’s daughter, and "SQL", the abbreviation for
Structured Query Language.
z
MySQL - Introduction
MySQL is a relational database management system.
MySQL is free and open-source released in 1995 by Oracle
Corporation.
MySQL is ideal for both small and large applications.
MySQL is very fast, reliable, scalable, and easy to use.
Its name is a combination of "My", the name of co-founder Michael
Widenius’s daughter, and "SQL", the abbreviation for Structured
Query Language.
MySQL is cross-platform.
z
MySQL – Downloading
URL - https://dev.mysql.com/downloads/installer/
Select
Version - 8.0.41
OS – Windows/Whichever the OS you’re using.
Download MSI installer with larger size.
Select No thanks, just start my download.
Once the .exe file is downloaded, double click to start installing.
z
MySQL - Installation
While Installing
In the Setup Window,
Select Full, and click Next
Now click Execute
After execution,
Click Next
In Product Configuration,
Click Next
z
MySQL - Installation
While Installing
In Type and Networking,
Config Type – Development Computer
Click Next
In Authentication Method,
Select RECOMMENDED
Click Next
Create a new (medium to strong) root password & click Next
z
MySQL - Installation
While Installing
In Window Service,
Click Next
In Server File Permissions,
Click Next
In Apply Configuration,
Click Execute
z
MySQL - Installation
While Installing
Click Finish
In Connect To Server,
Enter the root password and click Check
Click Next.
In the Apply Configuration,
Click Execute
Click Finish
Click Finish
z
Database Store
z
Database Store
A data store is a repository for the persistent storage and
management of data sets that not only include repositories
such as databases but also simpler storage types such as basic
files, emails etc.
z
Database Store
A data store is a repository for the persistent storage and
management of data sets that not only include repositories
such as databases but also simpler storage types such as basic
files, emails etc.
Data Storage is the mechanism by which IT collects, organizes,
and exchanges the bits and bytes that make up the items that
you rely on every day — from applications to network protocols,
documents to newspapers, and address books to user
preferences.
z
Database Normalization
z
Database Normalization
Database design is very important to be perfect. If it is not perfect,
then it may contain anomalies. Managing a database with anomalies
is difficult or may be near to impossible.
z
Database Normalization
Database design is very important to be perfect. If it is not perfect,
then it may contain anomalies. Managing a database with anomalies
is difficult or may be near to impossible.
There are three types of anomalies as follows:
Update anomalies
Deletion anomalies
Insert anomalies
z
Database Normalization
Database design is very important to be perfect. If it is not perfect,
then it may contain anomalies. Managing a database with anomalies
is difficult or may be near to impossible.
There are three types of anomalies as follows:
Update anomalies
Deletion anomalies
Insert anomalies
Normalization is a method to remove all these anomalies and bring
the database to a consistent state.
z
Database Normalization
Update anomalies:
An update anomaly is a data inconsistency that results from data
redundancy and a partial If data items are scattered and are not
linked to each other properly, then it could lead to strange
situations.
z
Database Normalization
Update anomalies:
An update anomaly is a data inconsistency that results from data
redundancy and a partial If data items are scattered and are not
linked to each other properly, then it could lead to strange situations.
Example:
When we try to update one data item having its copies scattered
over several places, a few instances get updated properly while a
few others are left with old values. Such instances leave the
database in an inconsistent state.
z
Database Normalization
Deletion anomalies:
A deletion anomaly occurs when you delete a record that may
contain attributes that should not be deleted.
z
Database Normalization
Deletion anomalies:
A deletion anomaly occurs when you delete a record that may
contain attributes that should not be deleted.
Example:
We tried to delete a record, but parts of it was left undeleted
because of unawareness, the data is also saved somewhere else.
z
Database Normalization
Insert anomalies:
An Insert Anomaly occurs when certain attributes cannot be
inserted into the database without the presence of other attributes.
z
Database Normalization
Insert anomalies:
An Insert Anomaly occurs when certain attributes cannot be
inserted into the database without the presence of other attributes.
Example:
We tried to insert data in a record that does not exist at all.
z
Database Index
z
Database Index
A database index is a data structure that improves the speed of
data retrieval operations on a database table.
z
Database Index
A database index is a data structure that improves the speed of
data retrieval operations on a database table.
Indexes are used to quickly locate data without having to search
every row in a database table every time a database table is
accessed.
z
Database Index
A database index is a data structure that improves the speed of
data retrieval operations on a database table.
Indexes are used to quickly locate data without having to search
every row in a database table every time a database table is
accessed.
Indexes can be created using one or more columns of a database
table, providing the basis for both rapid random lookups and
efficient access of ordered records.
z
Database Index
z
Database 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.
Note: The data may or may not be stored in sorted
order.
z
Database 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.
Note: The data may or may not be stored in sorted
order.
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.
z
Database Index
The indexing has various attributes:
Access Types: This refers to the type of access such
as value based search, range access.
Access Time: It refers to the time needed to find
particular data element.
Insertion Time: It refers to the time taken to find the
appropriate space and insert a new value.
Deletion Time: Time taken to find an item and delete it
as well as update the index.
Space Overhead: It refers to the additional space
required by the index.