0% found this document useful (0 votes)
5 views

CA1_DBMS

The document provides an overview of database languages, which serve as tools for interacting with databases, allowing users to store, retrieve, and manage data efficiently. It categorizes these languages into four types: Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), and Transaction Control Language (TCL), each with specific functions and commands. The importance of database languages is highlighted in various industries, emphasizing their role in data integrity, security, and efficient data management.

Uploaded by

fast forward
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

CA1_DBMS

The document provides an overview of database languages, which serve as tools for interacting with databases, allowing users to store, retrieve, and manage data efficiently. It categorizes these languages into four types: Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), and Transaction Control Language (TCL), each with specific functions and commands. The importance of database languages is highlighted in various industries, emphasizing their role in data integrity, security, and efficient data management.

Uploaded by

fast forward
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Database

Languages in
DBMS
Presented by
Name- Saideep Mukhopadhyay
Roll no-11200222017
Subject: Database Management System
Subject code: PCC-CS601
.
Introduction to Database
Languages
• Definition: Database languages are specialized tools that
allow users to interact with databases. Think of them as a
bridge between the user and the database management
system (DBMS). They enable us to perform tasks like
storing, retrieving, updating, and managing data efficiently.
• Importance:
• Essential for managing and handling data
efficiently. They provide the tools needed to create,
organize, update, and retrieve data in a structured way.
• Supports the preservation of data security and integrity.
• Allows interaction with relational database.
• Database languages like DDL (Data Definition
Language) allow users to create, modify, and delete the
structure of databases, tables, and other objects. For
example, creating a table to store employee details.
Types of Database Languages
• Database languages are categorized int four types:

• Data Definition Language (DDL) –It is used to create


schema, tables, indexes, constraints, etc. in the database.
• Data Manipulation Language (DML) – With DML, you
can perform various operations such as inserting, updating,
selecting, and deleting data. You can operate with the actual
data in your database tables thanks to these actions.
• Data Control Language (DCL) – plays a crucial role in
managing access and security within a database. Its
primary purpose is to control who can access or modify the
data.
• Transaction Control Language (TCL) – essential part of
maintaining database transactions to guarantee data
consistency and integrity.
Code(SQL)
CREATE TABLE Employees (
Data Definition Language (DDL) EmployeeID INT PRIMARY KEY,
• Definition: A database's structure may be defined and managed FirstName VARCHAR(50),
using Data Definition Language (DDL), a subset of Structured Query LastName VARCHAR(50),
Language (SQL). It focusses on building, changing, and removing Age INT,
database objects like schemas, tables, and indexes. Department VARCHAR(50)
• Key Characteristics: Does not handle data itself, only the ALTER TABLE Employees
);
database structure. ADD Email VARCHAR(100);
• Commands do not use rollback mechanisms (except for ALTER in DROP TABLE Employees;
some cases) TRUNCATE TABLE Employees;
• DDL Commands:
• CREATE – Creates tables, views, indexes, or databases.
CREATE TABLE students (id INT PRIMARY KEY, name
VARCHAR(50), age INT)
• ALTER – Modifies existing database structures.
ALTER TABLE students ADD COLUMN email VARCHAR(100);

• DROP – Deletes tables, views, or databases.


DROP TABLE students;
• TRUNCATE – Removes all records while keeping the structure.
TRUNCATE TABLE students;
Data Manipulation Language
(DML)
• Definition: Data in a database can be managed and altered using the
DML (Data Manipulation Language). You can insert, update, select, and
delete data, among other tasks, using DML. You can operate with the
actual data in your database tables thanks to these actions.
• Key Characteristics:
• Operates on the data inside tables.
• Supports rollback and commit operations.
• DML Commands:
• INSERT – Adds new data to a table.
INSERT INTO students (id, name, age) VALUES (1, 'John Doe',
20);
• UPDATE – Modifies existing records.
UPDATE students SET age = 21 WHERE id = 1;
• DELETE – Removes records from a table.
DELETE FROM students WHERE id = 1;
• SELECT – Retrieves data from a database.
Difference Between DDL and DML
Data Control DCL sql code:
GRANT SELECT, INSERT ON Employees TO
Language(DCL)
• Definition:A subset of SQL (Structured Query Language)
User1; -- Allows User1 to read and insert data
into the Employees table.
called Data Control Language (DCL) is used to manage
database data access. It focusses on giving or taking
away user permissions so that only people with permission REVOKE INSERT ON Employees FROM User1;
can see, edit, or handle data. DCL is essential to -- Removes User1's permission to insert data.
preserving a database's integrity and security.
• Key Characteristics of DCL:
• Access Control: It manages user permissions and privileges
within the database.
• Security: It ensures that sensitive data is protected from
unauthorized access.
• Role-Based Access: Permissions can be assigned to
individual users or roles (groups of users).
• DCL Commands:
• GRANT: Gives users specific permissions to perform actions
(e.g., read, write, delete).
• REVOKE: Removes previously granted permissions from
Transaction Control Key Commands:
COMMIT: Saves all changes made during a
Language (TCL) transaction permanently.
ROLLBACK: Undoes all changes made during a
• Definition:A subset of SQL (Structured Query transaction, reverting the database to its
previous state.
Language) called Transaction Control Language SAVEPOINT: Creates a point within a
(TCL) is used to control database transactions. transaction to which you can roll back, allowing
TCL guarantees the consistent and dependable partial undo of changes.
Auto-Commit: In some databases, changes are
execution of transactions, which are series of automatically committed unless explicitly rolled
activities carried out as a single logical unit of back.
work. By regulating when modifications are SQL CODE
saved or reversed, it contributes to data BEGIN TRANSACTION;
UPDATE Accounts SET Balance = Balance - 100
integrity maintenance. WHERE AccountID = 1;
• Key Characteristics: Transaction UPDATE Accounts SET Balance = Balance +
100 WHERE AccountID = 2;
Management It guarantees that a collection of COMMIT; -- Saves the changes permanently.
SQL operations is handled as a single entity.
• Data Integrity: It ensures that transactions
are successfully committed or, in the event of
an error, completely reversed.
SQL (Structured Query Language)
encompasses all four database languages:
• DDL (CREATE, ALTER)
• DML (INSERT, SELECT)
• DCL (GRANT, REVOKE)
• TCL (COMMIT, ROLLBACK)
SQL as a
Database Example Queries:
Language • CREATE TABLE employees (id INT PRIMARY KEY,
name VARCHAR(100), salary DECIMAL(10,2));
• INSERT INTO employees (id, name, salary) VALUES
(1, 'Emma Watson', 75000.00);
• UPDATE employees SET salary = 80000.00 WHERE
id = 1;
• COMMIT;
• GRANT SELECT ON employees TO manager;
Data Integrity & Security – Ensures
reliable and secure database
operations.

Efficient Data Management – Helps


Importance of in processing large-scale data.
Database
Languages Essential for IT Professionals –
Used by developers, data analysts,
and database administrators.

Standardized Across RDBMS –


Works in MySQL, PostgreSQL, Oracle,
SQL Server.
REAL WORLD APPLICATIONS
• Business and Retail:

i)Inventory Management:
Database languages are used to track stock levels, manage orders, and update product information in real-
time.
ii)Customer Relationship Management (CRM):
Storing and retrieving customer data, purchase history, and preferences to improve customer service and
marketing.
• Banking and Finance

i)Transaction Processing:
Managing deposits, withdrawals, and transfers using TCL to ensure data consistency and integrity.
ii)Loan and Credit Management:
Storing customer loan details, credit scores, and repayment schedules.
• Healthcare

i)Patient Records Management:


Storing and retrieving patient medical histories, test results, and treatment plans securely using DCL.
ii)Appointment Scheduling:
CONCLUSION
• Database languages are the backbone of modern data management systems, enabling
users to interact with databases efficiently and effectively.
• They guarantee that databases are well-structured, safe, and easily accessible by offering
the means to define, modify, control, and retrieve data.
• Database languages are used to handle data effectively, enhance operations, and provide
better services in a variety of industries, including healthcare, banking, e-commerce, and
entertainment. In today's data-driven world, they are crucial for managing massive
amounts of data, guaranteeing accuracy, and upholding security.
• To sum up, database languages are an essential part of every database system since they
are tools that are used to manage and leverage data. Their function in defining, modifying,
protecting, and evaluating data guarantees that businesses may function efficiently and
make wise choices.
• Database languages are essential for interacting with and managing databases.
• They offer the resources needed to efficiently define, modify, regulate, and safeguard data.

You might also like