RDBMS_UNIT1
RDBMS_UNIT1
DATA
INFORMATION
This is a processed from of data.
It is always meaningful.
“Meaningful data is called information”.
It is output processing units.
Whenever we organize the data and process is done on it then we get
proper information.
Example :-
1
DATA vs. INFORMATION
DATA INFORMATION
METADATA
The data structure of database is specifying by database schema and it
called metadata.
Data that describe the properties or characteristics of other data
Properties include data definitions, data structures, and rules or
constraints.
Metadata describe data but not include that data
WHAT IS DATABASE???
The database is a collection of inter-related data which is used to
retrieve, insert and delete the data efficiently.
It is also used to organize the data in the form of a table, schema,
views, and reports, etc.
FOR EXAMPLE: The college Database organizes the data about the
admin, staff, students and faculty etc.
Using the database, you can easily retrieve, insert, and delete the
information.
3
Database management system is software which is used to manage the database.
FOR EXAMPLE:
MySQL, Oracle, Microsoft SQL Server etc are a very popular commercial
database which is used in different applications.
Data Retrieval: It is used to retrieve the data from the database which
unexpected failure.
4
CHARACTERISTICS OF DATABASE
APPROACH
Characteristics of Database Approach: Database approach has been proved
far better than traditional file management system. Database Approach has
many characteristics that make it more robust in nature. Let us discuss the
main Characteristics of Database Approach.
1. Manages Information
All the operations like insert, delete, update, search etc. are carried out in
a flexible and easy way.
Database makes it very simple to implement these operations.
A user with little knowledge can perform these operations. This
characteristic of database makes it more powerful.
to maintain the record of student’s marks, fees and attendance etc. This
6
8. Logical Relationship between Records and Data
7
DATABASE USERS (ACTORS ON SCENE
WORKERS BEHIND THE SCENE)
Based on their interaction with the database, the database users are
divided into two categories:
2. Administering/managing these
resources is the responsibility of the
database administrator (DBA).
8
5. Responsible for Trouble shooting if any
problem arises.
6. To check security issues and so on..
11
packages.
12
DESIGNERS AND
IMPLEMENTERS 1. DBMS system designers and
implementers design and implement the
DBMS modules and interfaces as a one
software package.
13
ADVANTAGES OF USING THE DBMS
APPROACH
Database Management System has many advantages. Some of these advantages
are given below
The file based data management systems contained multiple files that were
stored in many different locations in a system or even across multiple systems.
Because of this, there were sometimes multiple copies of the same file which
lead to data redundancy.
2. Sharing of Data
In a database, the users of the database can share the data among themselves.
There are various levels of authorisation to access the data, and consequently
the data can only be shared based on the correct authorisation protocols being
followed.
Many remote users can also access the database simultaneously and share the
data between themselves.
3. Data Integrity
Data integrity means that the data is accurate and consistent in the database.
So it is necessary to ensure that the data is correct and consistent in all the
databases and for all the users.
14
4. Data Security
Unauthorized users should not be allowed to access the database under any
circumstances as it violates the integrity constraints.
5. Privacy
The privacy rule in a database means only the authorized users can access a
database according to its privacy constraints.
There are levels of database access and a user can only view the data he is
allowed to.
For example - In social networking sites, access constraints are different for
different accounts a user may want to access.
The users don't need to backup data periodically because this is taken care of by
the DBMS.
Moreover, it also restores the database after a crash or system failure to its
previous condition.
7. Data Consistency
All data appears consistently across the database and the data is same for all the
users viewing the database.
Moreover, any changes made to the database are immediately reflected to all
the users and there is no data inconsistency.
15
DATABASE SYSTEM CONCEPTS AND
ARCHITECTURE
DATA MODELS
Database systems can be based on different data models or database models
respectively.
Ensures that all data objects required by the database are accurately
represented. Omission of data will lead to creation of faulty reports and
produce incorrect results.
A data model helps design the database at the conceptual, physical and
logical levels.
Data Model structure helps to define the relational tables, primary and
foreign keys and stored procedures.
It provides a clear picture of the base data and can be used by database
developers to create a physical database.
It is also helpful to identify missing and redundant data.
16
CATEGORIES / TYPES OF DATA MODELS
There are mainly three different types of data models: conceptual data
models, logical data models, and physical data models, and each one have
a specific purpose.
The data models are used to represent the data and how it is stored in the
database and to set the relationship between data items.
17
3. Physical Data Model: This Data Model describes HOW the system
will be implemented using a specific DBMS system. This model is
typically created by DBA and developers. The purpose is actual
implementation of the database for E.g Create Schemas.
18
19
SCHEMAS, INSTANCES, AND DATABASE STATE
SCHEMAS: https://www.youtube.com/watch?v=R6-zHd5-eoI
The description of a database is called the database schema, which is
specified during database design.
Includes descriptions of the database structure, data types, and the
constraints on the database.
Schema Construct:
o A component of the schema or an object within the schema, e.g.,
STUDENT, COURSE is called Schema Construct.
20
Example of a Database Schema diagram
21
THREE-SCHEMA ARCHITECTURE
The Goal of Three Schema Architecture is to separate the user application and
physical database. User applications resides at the top level and physical
database is at the lowest level.
In the three-schema architecture, each user group refers to its own external
schema.
Programs refer to an external schema, and are mapped by the DBMS to the
internal schema for execution.
Data extracted from the internal DBMS level is reformatted to match the
user’s external view (e.g. formatting the results of an SQL query display in a
Web page
If the request is database retrieval, the data extracted from the stored
database must be reformatted to match the user’s external view.
23
DATA INDEPENDENCE
24
DATABASE LANGUAGES AND DATABASE
INTERFACES
DATABASE LANGUAGES
For describing data and data structures a suitable description tool, a data
definition language (DDL), is needed. With this help a data scheme can be
defined and also changed later.
25
Often these two languages for the definition and manipulation of databases
are combined in one comprehensive language.
DBMS INTERFACES
User-friendly interfaces provided by a DBMS may include the following:
These interfaces present the user with lists of options (called menus)
that lead the user through the formulation of a request.
These interfaces present mobile users with access to their data. For
example, banking, reservations, and insurance companies, among
many others, provide apps that allow users to access their data
through a mobile phone or mobile device.
The apps have built-in programmed interfaces that typically allow
users to login using their account name and password; the apps then
provide a limited menu of options for mobile access to the user data,
26
as well as options such as paying bills (for banks) or making
reservations (for reservation Web sites).
Forms-based Interfaces
27
Applications with limited vocabularies, such as inquiries for
telephone directory, flight arrival/departure, and credit card account
information, are allowing speech for input and output to enable
customers to access this information.
The speech input is detected using a library of predefined words and
used to set up the parameters that are supplied to the queries.
For output, a similar conversion from text or numbers into speech
takes place.
28
DATABASE SYSTEM
ENVIRONMENT
The database system environment is comprised of the components that are
meant for defining and managing the data that we collect, store, manage and
use in the database environment.
29
The figure is divided into two parts.
The top part of the figure refers to the various users of the database
environment and their interfaces.
The lower part shows the internal modules of the DBMS responsible
for storage of data and processing of transactions.
Once the database design is completed, the schema has to be defined by the
Database Administrator/the Database designers.
So the DBA staff uses database definition Language (DDL) to specify these
schemas.
The DBA staff works on defining the database and tuning it by making
changes to its definition using the DDL and other privileged
commands.
DDL compiler -
It Processes the schema definition (which is specified in DDL) - Store the
schema definition/description in the catalog (Catalog contains the details of file
size, data type, Storage of files, Constraints etc).
Modules at the top of the diagram access this catalog whenever required.
30
Query Compiler -
It handles the high level queries, this query compiler analyzes and interprets
the queries by creating the database access code then it calls the runtime
database processor to executing that code.
Pre-Compiler -
It Extracts the DML commands from an application program written in a host
programming languages like C, C++ and Java etc.
DML Compiler -
The Compilation of DML Commands into an Object Code for access to the
database. So here the DML Compiler Extract the DML commands in object
code and other than the DML commands the rest of the program send to the
Host Language Compiler.
Host-Language Compiler -
Then the Object code and rest of the program are linked together to form the
compiled or the Canned Transactions (Canned transitions are used by the
parametric or naïve End-users).
Compiled Transactions -
This compiled or the Canned Transition then generates a call to the Runtime
database Processor.
In addition to these modules most DBMS have Database System Utilities that
help the DBA to manage the database system.
32
DATABASE UTILITIES
1. Loading Utility
2. Backup Utility
Creates the backup copy of the database and with this back up copy
we can restore the database in case of any kind of system failure.
Incremental backups are often used. In incremental backups only
changes since the previous backup are recorded.
4. Performance Monitoring
33
DBMS ARCHITECTURE
1-Tier Architecture
1 Tier Architecture in DBMS is the simplest architecture of
Database in which the client, server, and Database all reside on the
same machine.
34
A simple one tier architecture example would be anytime you install
a Database in your system and access it to practice SQL queries. But
such architecture is rarely used in production.
2-Tier Architecture
35
In the above 2 Tier client-server architecture of database
management system, we can see that one server is connected with
clients 1, 2, and 3.
3-Tier Architecture
36
user
client Presentation Tier
application client
Application Tier
network
application server
Database Tier
database system
Server
Database(Data) Tier
Summary
38
TYPES OF DATABASES/ CLASSIFICATION OF
DBMS
39
on multiple sites so that failure of a site will not make some
data unavailable.
1) Relational Database
In the above student table Std ID, Name and city are called as attributes and their values.
Std ID is a primary key attribute which uniquely identifies each record in the student
table.
40
ACID Properties of Relational Database
There are following four commonly known properties of a relational model
known as ACID properties, where:
A means Atomicity:
This ensures the data operation will complete either with success or with
failure.
It follows the 'all or nothing' strategy. For example, a transaction will either
be committed or will abort.
C means Consistency:
If we perform any operation over the data, its value before and after the
operation should be preserved.
For example, the account balances before and after the transaction should
be correct, i.e., it should remain conserved.
I means Isolation:
There can be concurrent users for accessing data at the same time from the
database.
Thus, isolation between the data should remain isolated. For example,
when multiple transactions occur at the same time, one transaction effects
should not be visible to the other transactions in the database.
41
Entity-Relational model
Entity set and Relationship: The set of all entities of the same type
are called entity set and the set of relationship of the same type
are called the relationship set.
Represented diagrammatically by an entity-relationship diagram:
42
2) Object Oriented Database
It is a system where information or data is represented in the form of
objects which is used in object-oriented programming.
3) Hierarchical Databases
It is the type of database that stores data in the form of parent-
children relationship nodes. Here, it organizes data in a tree-like
structure.
43
It is a system where the data elements have a one to many
relationship (1: N). Here data is organized like a tree which is similar
to a folder structure in your computer system.
The hierarchy starts from the root node, connecting all the child
nodes to the parent node.
It is used in industry on mainframe platforms.
Data get stored in the form of records that are connected via links. Each
child record in the tree will contain only one parent. On the other hand,
each parent record can have multiple child records.
44
FOR EXAMPLE:
4) Network Databases
It is the database that typically follows the network data model. Here,
the representation of data is in the form of nodes connected via links
between them.
Unlike the hierarchical database, it allows each record to have
multiple children and parent nodes to form a generalized graph
structure.
A Network database management system is a system where the data
elements maintain one to one relationship (1: 1) or many to many
relationship (N: N).
It also has a hierarchical structure, but the data is organized like a
graph and it is allowed to have more than one parent for one child
record.
45
FOR EXAMPLE
46