RDBMS Unit I
RDBMS Unit I
Structure of DBMS:
DBMS (Database Management System) acts as an interface between the user and the
database. The user requests the DBMS to perform various operations such as insert,
delete, update and retrieval on the database.
The components of DBMS perform these requested operations on the database and
provide necessary data to the users.
Applications: -
It can be considered as a user friendly web page where the user enters the requests. Here he
simply enters the details that he needs and presses buttons to get the data.
DDL Compiler:
Data Description Language compiler processes schema definitions specified in the DDL.
It includes metadata information such as the name of the files, data items, storage details
of each file, mapping information and constraints etc.
DML Compiler: -
When the user inserts, deletes, updates or retrieves the record from the database, he will be
sending request which he understands by pressing some buttons. But for the database to
work/understand the request, it should be broken down to object code. This is done by this
compiler. In other words The DML commands such as insert, update, delete, retrieve from the
application program are sent to the DML compiler for compilation into object code for database
access.
Query Optimizer: -
The object code is then optimized in the best way to execute a query by the query optimizer and
then send to the data manager. The query optimizer decides the best way to execute the user
request which is received from the DML compiler
Data Manager:
The Data Manager is the central software component of the DBMS also knows as
Database Control System.
The Main Functions Of Data Manager Are:
1. Convert operations in user's Queries coming from the application programs or
combination of DML Compiler and Query optimizer which is known as Query
Processor from user's logical view to physical file system.
2. Controls DBMS information access that is stored on disk.
3. It also controls handling buffers in main memory.
4. It also enforces constraints to maintain consistency and integrity of the data.
5. It also synchronizes the simultaneous operations performed by the concurrent
users.
6. It also controls the backup and recovery operations.
Data Dictionary:
Data Dictionary, which stores metadata about the database, in particular the schema of the
database.
names of the tables, names of attributes of each table, length of attributes, and number of rows in
each table.
Detailed information on physical database design such as storage structure, access paths, files and
record sizes.
Usage statistics such as frequency of query and transactions.
Data dictionary is used to actually control the data integrity, database operation and accuracy. It
may be used as a important part of the DBMS
Data Files:
Compiled DML:
The DML complier converts the high level Queries into low level file access commands known
as compiled DML.
End Users:
The second class of users then is end user, who interacts with system from online workstation or
terminals.
Use the interface provided as an integral part of the database system software.
1. User can request, in form of query, to access database either directly by using particular language,
such as SQL, or by using some pre-developed application interface.
2. Such request are sent to query evaluation engine via DML pre-compiler and DML compiler
3. The query evaluation engine accepts the query and analyses it.
4. It finds the suitable way to execute the compiled SQL statements of the query.
5. Finally, the compiled SQL statements are executed to perform the specified operation
6. Query Processor Units:
a. DDL Interpreter
b. DML Compiler
c. Embedded DML Pre-compiler
d. Query Evalution Engine
a. Authorization Manager
b. Integrity Manager
c. Transaction Manager
d. File manager
e. Buffer Manager
Users or DBMS
1. Online Users – These are the users who can communicate with DB directly using any online terminal
or indirectly through Application Interface.
- These users having very limited access and very average knowledge and skill of DB handling.
- E.g. A user visiting irctc.co.in web site to access Railway Database for booking online tickets.
2. Naïve Users - These are also called as end users or unsophisticated users.
- These users interacts with DB using previously created or installed application. These users may know
about the presence of DB system.
3. Application Programmer – These are the professional programmers who are responsible for
developing application program or user interface utilized by the naive and online users.
- These programmers write the application programs in general purpose languages like VB, java,
COBOL, Assembly language, etc.
- These programmers may also use available tools to develop programs as per RAD(Rapid
Application Development).
- Today many high-end programming tools available which creates applications and also web
applications.
4. Sophisticated User – This user interacts with DB without using any application program.
- To complete any task, this user write queries to be compiled and executed by DBMS.
• Advantages Of DBMS:
1. Simplicity – as database is based on hierarchical structure, it’s design is simple.
2. Data Security –It is the first model which offers data security with the help of DBMS.
3. Data Sharing – As the database is stored in common place hence data can be shared between multiple
users.
4. Data Integrity – Because of parent child relationship, there will be first a parent segment and then
child.
5. Data Independence – It separates / isolates program and complex storage. If there are changes in data
no change in application program with less maintenance.
6. Efficiency – It is very efficient if DB contains large numbers of records with 1:m (one-t0-many)
relationships
Disadvantages
1. Implementation Complexity – Hierarchical DB is conceptually simple and easy to deign but
complex to implement.
2. Inflexibility –Hierarchical DB is not flexible i.e not easy to change. If changes are made, it creates
more complexed DB model. If any segment deleted, it may cause error in whole DB str.
3. Database Management Problems – If any change is made in DB, it also needs changes in its
application program hence the maintenance becomes very difficult.
4. No Structural Independence – If there is change in DB then the functions in DBMS to access data
also to be changed
All modern database management systems like SQL, MS SQL Server, IBM DB2, ORACLE,
My-SQL, and Microsoft Access are based on RDBMS.
How it works
Data is represented in terms of tuples (rows) in RDBMS.
A relational database is the most commonly used database. It contains several tables, and each
table has its primary key.
Due to a collection of an organized set of tables, data can be accessed easily in RDBMS.
What is table/Relation?
Everything in a relational database is stored in the form of relations. The RDBMS database uses
tables to store data. A table is a collection of related data entries and contains rows and columns
to store data. Each table represents some real-world objects such as person, place, or event about
which information is collected. The organized collection of data into a relational table is known
as the logical view of the database.
Properties of a Relation:
1 Ajeet 24 B.Tech
2 aryan 20 C.A
3 Mahesh 21 BCA
4 Ratan 22 MCA
5 Vimal 26 BSC
Properties of a row:
1 Ajeet 24 B.Tech
What is a column/attribute?
A column is a vertical entity in the table which contains all information associated with a
specific field in a table. For example, "name" is a column in the above table which
contains all information about a student's name.
Properties of an Attribute:
Database Schema
A database schema is a structure that represents the logical storage of the data in
a database. It represents the organization of data and provides information about the
relationships between the tables in a given database. In this topic, we will understand
more about database schema and its types. Before understanding database schema, lets
first understand what a Database is.
What is Database?
A database is a place to store information. It can store the simplest data, such as a list of
people as well as the most complex data. The database stores the information in a well-
structured format.