ABHISHEK GHOSH_DBMS WITH SQL_MIC401B
ABHISHEK GHOSH_DBMS WITH SQL_MIC401B
MODERN STUDIES
1|Page
Table of contents :
Abstract
Introduction.
What is Database?
Conclusion.
Reference.
2|Page
ABSTRACT:
Databases are essential for efficiently storing,
managing, and retrieving large volumes of
data. They utilize both software and hardware
components. The software provides an
interface that enables users or applications to
interact with the database, while the hardware
consists of servers and storage systems
responsible for physically storing and
organizing the data, either in memory or on
physical devices like hard drives.
3|Page
INTRODUCTION:
4|Page
What is a Database?
A database is a structured collection of data
stored electronically. It allows users to easily
access, manage, and update data. For example,
a phone contact list on our smartphone is a
small database. It keeps track of names, phone
numbers, and addresses, allowing us to search
and access this information quickly when
needed. Databases are widely used in
businesses, websites, and applications to store
and manage large volumes of data efficiently.
5|Page
Types of Database
Languages in DBMS:
Database languages are specialized languages
used to interact with a database. They allow
users to perform different tasks such as
defining, controlling, and manipulating the
data. There are several types of database
languages in DBMS, categorized into the
following four main types:
6|Page
1.DDL (Data Definition Language)
The DDL stands for Data Definition Language,
Which is used to define the database's internal
structure and Pattern of the Database. It is used to
define and modify the structure of the database
itself, including the tables, views, indexes, and
other schema-related objects. It deals with the
creation and modification of database schema, but
it doesn't deal with the data itself.
7|Page
CREATE Command
The CREATE is a DDL command used to
create databases, tables, triggers and other
database objects.
Syntax
CREATE TABLE Students (
column1 INT,
column2 VARCHAR(50),
column3 INT
);
Example:
8|Page
2. DCL (Data Control Language)
DCL stands for Data Control Language. It is used
to control the access permissions of users to the
database. DCL commands help grant or revoke
privileges to users, determining who can perform
actions like reading or modifying data. DCL
commands are transactional, meaning they can be
rolled back if necessary.
Syntax
9|Page
GRANT privileges
ON object
TO user_or_role [WITH GRANT OPTION];
Example:
GRANT SELECT, INSERT ON students TO
user;
3.DML (Data Manipulation Language)
The DML (Data Manipulation Language) is used
toto manage and manipulate data within a
database. With DML, you can perform various
operations such as inserting, updating, selecting,
and deleting data. These operations allow you to
work with the actual content in your database
tables.
10 | P a g e
MERGE: Performs an "upsert" operation, which
means updating existing records or inserting new
ones if they don’t exist.
CALL: Executes stored procedures or functions.
LOCK TABLE: Prevents other users from
accessing the table while changes are being made.
EXAMPLE:
MERGE INTO Employees AS target
USING New_Hires AS source
ON target.EmployeeID = source.EmployeeID
WHEN MATCHED THEN
UPDATE SET target.Name = source.Name,
target.Salary = source.Salary
WHEN NOT MATCHED THEN
INSERT (EmployeeID, Name, Salary)
VALUES (source.EmployeeID, source.Name,
source.Salary);
Table 1. Employees Table (Before Merge):
Employee Table
Conclusion:
12 | P a g e
In conclusion, database languages play a
crucial role in managing and manipulating
data in a database management system
(DBMS). There are different type of
database language like DDL, DCL, DML,
and TCL. The DDL language is used for
used for defining the database's internal
structure and Pattern of the Database. The
DCL commands are used to control the
data from the user means They can provide
control of the Database, Table, and Data.
The DML commands are used to
manipulate the Data in the Table like
Inserting, updating, and deleting the Data
finally the TCL commands are used to
save and restore the previous state of the
Database.
13 | P a g e
Reference:
1.Safari.
2.Chorme.
3.pinterest.
14 | P a g e
THANK YOU
15 | P a g e