0% found this document useful (0 votes)
11 views12 pages

DBMS, Unit-2

The document outlines the components of a Database Management System (DBMS), including software, hardware, procedures, data, and users. It details the roles of different types of users, such as application programmers, database administrators, and end-users, as well as the various database languages used for data manipulation and control. Additionally, it discusses data independence, emphasizing the ability to change schemas without affecting other levels of the database structure.

Uploaded by

Patel Shubham
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)
11 views12 pages

DBMS, Unit-2

The document outlines the components of a Database Management System (DBMS), including software, hardware, procedures, data, and users. It details the roles of different types of users, such as application programmers, database administrators, and end-users, as well as the various database languages used for data manipulation and control. Additionally, it discusses data independence, emphasizing the ability to change schemas without affecting other levels of the database structure.

Uploaded by

Patel Shubham
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/ 12

Unit 2: Concepts of DBMS

2.1 Component of Data Base Management System

Components of DBMS:

There are the following components of DBMS:

1. Software
2. Hardware
3. Procedures
4. Data
5. Users

Software

 The main component of a Database Management System is the software. It is the set of
programs that are used to manage the database and control the overall computerized
database.
 The DBMS software provides an easy-to-use interface to store, retrieve, and update
data in the database.
 This software component is capable of understanding the Database Access Language
and converts it into actual database commands to execute or run them on the database.

Hardware

 This component of DBMS consists of a set of physical electronic devices such as


computers, I/O channels, storage devices, etc that create an interface between
computers and the users.
 This DBMS component is used for keeping and storing the data in the database.

Procedures

Created By: Krupa Patel Page 1


 Procedures refer to general rules and instructions that help to design the database and
to use a database management system.
 Procedures are used to setup and install a new database management system (DBMS),
to login and logout of DBMS software, to manage DBMS or application programs, to
take backup of the database, and to change the structure of the database, etc.

Data

 It is the most important component of the database management system.


 The main task of DBMS is to process the data. Here, databases are defined, constructed,
and then data is stored, retrieved, and updated to and from the databases.
 The database contains both the metadata (description about data or data about data)
and the actual (or operational) data.

Users

 The users are the people who control and manage the databases and perform different
types of operations on the databases in the database management system.

Three types of users play different roles in DBMS:

1) Application Programmers
2) Database Administrators
3) End-Users

1. Application Programmers

The users who write the application programs in programming languages (such as Java,
C++, or Visual Basic) to interact with databases are called Application Programmers.

2. Database Administrators (DBA)

A person who manages the overall DBMS is called a database administrator or simply
DBA.

3. End-Users

The end-users are those who interact with the database management system to
perform different operations by using the different database commands such as insert,
update, retrieve, and delete on the data, etc.

Created By: Krupa Patel Page 2


2.1.1. Query Language: DDL, DML, DCL
Database languages are used to read, update and store data in a database. Several such languages
can be used for this purpose; one of them is SQL (Structured Query Language).

The different types of Database Language are as follows :

Database
Languages

Data Definition Data Manipulation Transaction


Data Control
Language (DDL) Language(DML) Control Language
Language (DCL)
(TCL)

Create, Insert,
Alter, Update,
Drop, grant, rollback,
Delete,
Rename, revoke savepoint,
Select
Truncate commit

Created By: Krupa Patel Page 3


Data Definition Language

 Data Definition Language is used for defining the structure or schema of the database.
It is also used for creating tables, indexes, applying constraints, etc. in the database.
 The result of compilation of DDL statements is a set of tables that is stored in a special
file called data dictionary or data directory – which contains metadata (data about
data).
 A data dictionary is a file that contains metadata (data about data).

 This language is used by the conceptual schema to access and retrieve the records
from/to the database respectively, where these records describe entities, relationships,
and attributes.

There are the following Data Definition Languages (DDL) Commands:

 Create: This command is used to create a new table or a new database.

Syntax : Create table tablename (attribute1 datatype,….attributen datatype);


Example : Create table student(“Stud_id” integer,”stud_name” varchar(20));

 Alter: This command is used to alter or change the structure of the database table.

If we wan to add new column,


Syntax:
Alter table tablename

Created By: Krupa Patel Page 4


add column attribute datatype;
Example :
Alter table student
Add column “stud_add” varchar(200));

If we want to delete any column from table


Syntax:
Alter table tablename
drop column attribute);
Example :
Alter table student
drop column “stud_add”;

 Drop: This command is used to delete a table, index, or views from the database.

Syntax: drop table tablename;


Example : drop table student;

 Truncate: This command is used to delete the records or data from the table, but its
structure remains as it is.
 Rename: This command is used to rename an object from the database.

Syntax:
alter table tablename rename to new_tablename;
Example :
Alter table student
Rename to student1;

Created By: Krupa Patel Page 5


Data Manipulation Language
Data Manipulation Language is a language used to access or manipulate the data in the
database , not structure of table.

It allow user to insert, update, delete and retrieve data from the database.

DML is also known as query language. A query language is a specialized programming language
for searching and changing the contents of a database. A well-known example is the Structured
Query Language.

A query is a statement requesting the retrieval of information.

Data Manipulation Language is mainly of two types:

 Procedural DML / High-level DMLs :


o This type of DML describes what data is to be accessed and how to get that data.
o Procedural DML is embedded into a high-level programming language like java
etc.
o For example : PL/SQL

 Declarative DML or Non-procedural DML / Low-level DMLs :


o This type of DML only describes what data is to be accessed without specifying
how to get it.
o Declarative DMLs are easy to learn and use than Procedural DMLs.
o But in Declarative DMLs when the user doesn’t specify how to reach up to that
data, this is the responsibility of the database system to figure out itself how to
do so.
o For example: SQL

There are the following Data Manipulation Language (DML) Commands:

 Select: This command is used to retrieve or access the data from the database table.
o For Example : select * from student;
 Insert: This command is used to insert the records into the table.

Created By: Krupa Patel Page 6


o For example : insert into student values(‘001’,’karan’,’Althan’);
 Update: This command is used to change/update the existing data in a table.
o For Example : update student set stud_name = ‘Manan’ where stud_id=001;
 Delete: This command is used to delete one or all the existing records from the table.
o For Example: delete from student;

Data control language


Data Control Language is used to control privileges in the database. These commands used in
DDL and DML can further be authorized with DCL.

DCL is used to grant and revoke access permission from any database user.

To perform any operation in databases, such as for creating tables, sequences, or views, we
need privileges.

Some of the commands of DCL are:

Grant:

 Grant command gives user's access privileges to the database.


 It allows only a specific user to perform specific tasks.
Revoke:

 REVOKE command is used to cancel previously granted or denied permissions.


 This command withdraw access privileges given with the GRANT command.
 It takes back permissions from user.

Transaction Control Language


Transaction Control language is a language that manages transactions within the database.

It is used to execute the changes made by the DML statements.

There are the following Transaction Control Language (TCL) Commands:

 Commit: This command is used to save the transactions in the database.


 Rollback: This command is used to restore the database to that state which was last
committed.
 Savepoint :This command sets a savepoint within a transaction. It is used to temporary save a
transaction so that you can rollback to that point whenever you can rollback.

Created By: Krupa Patel Page 7


2.1.2. Database Users
Database users are the person who interacts with the database and takes benefit from the
database.

There will be different types of users depending on their needs and way of accessing the
database.

There are four types of Database Users:-

1) Naïve Users
2) Application Users
3) Sophisticated Users
4) Specialized Users

1)Naïve Users/Native Users/End Users :

 Naïve users are unsophisticated users who do not have any knowledge of the database.
 Their task is to just use to developed application and get the desired result.
 For example:
 The clerical staff in the bank is a naïve users. They don’t have any DBMS knowledge
but they still use the database and perform their given task.

2)Application Programmer :

 They are the developers who interact with the database by means of DML queries.
 These DML queries are written in the application programs like C, C++, JAVA, Pascal, etc.
These queries are converted into object code to communicate with the database.
 They are computer professionals. Application programmers are users who are responsible
for developing the application programs or user interface.
 For example :
 writing a C program to generate the report of employees who are working in a
particular department will involve a query to fetch the data from the database. It
will include an embedded SQL query in the C Program.

3) Sophisticated Users –
Created By: Krupa Patel Page 8
 They are database developers, who write SQL queries to select/insert/delete/update
data.
 They do not use any application or programs to request the database.
 They directly interact with the database by means of a query language like SQL.
 These users will be scientists, engineers, and analysts who thoroughly study SQL and DBMS
to apply the concepts to their requirements.
 In short, we can say this category includes designers and developers of DBMS and SQL.

4) Specialized Users –

 These are also sophisticated users, but they write special database application programs.
 They are the developers who develop the complex programs to the requirement.
 For example:
 Specialized users create applications such as computer-aided design, expert systems,
and knowledge bases that can store more complicated data types than any simple
application program.

Created By: Krupa Patel Page 9


Database Administrator (DBA)
 A Database Administrator is a person or a group of people who are responsible for
managing all the activities related to the database system.
 The DBA job requires a high level of expertise by a person or group of people.
 The DBA coordinates all activities of the database system.
 They used specialized software to store and organized data
 They have all the permission.

Role and Responsibility of DBA :

1. Schema Definition:

 The DBA defines the logical Schema of the database.A Schema refers to the overall logical
structure of the database.
 According to this schema, a database will be developed to store required data for an
organization.

2. Storage Structure and Access Method Definition:

 The DBA decides how the data is to be represented in the stored database.

3. Assisting Application Programmers:

 The DBA assists application programmers to develop application programs.

4. Physical Organization Modification:

 The DBA modifies the physical organization of the database to reflext the changing
needs of the organization or to improve performance.

5. Approving Data Access:

 The DBA determines which user needs access to which part of the database.
 According to this, various types of authorizations are granted to different users.

6. Monitoring Performance:

 The DBA monitors the performance of the system. The DBA ensures that better
performance is maintained by making changes in physical or logical schema if required.

7. Backup and Recovery:

 Database should not be lost or damaged.

Created By: Krupa Patel Page 10


 The DBA ensures this periodically backing up the database on magnetic tapes or remote
servers.
 In case of failure, such as virus attack database is recovered from this backup.

2.1.3. Data Independence


Data Independence is the ability to change a schema at one level without affecting a schema at
the next higher level.

There are two levels of data independence based on three levels of abstraction.

1) Physical Data Independence


2) Logical Data Independence

Physical Data Independence :

This is defined as the ability to change the physical level without affecting the logical level
or conceptual level is called Physical Data Independence.

 The change in physical level may include the following –


 A new storage device like – magnatic tap, hardisk etc.
 A new data structure of storage
 Modifying indexes
 A different data acess method
 Changing the location of the database

Created By: Krupa Patel Page 11


Logical Data Independence :

This is defined as the ability to change the logical (conceptual) schema without changing
the external schema (user View) is called logical Data Independence.

 For example :
The addition or removal of new entities, attributes, and relationships to the
conceptual schema should be possible without having to change the existing external
schema or having to rewrite existing application programs.

============================

Created By: Krupa Patel Page 12

You might also like