0% found this document useful (0 votes)
7 views3 pages

Give All SQL Commands in A PDF of DDL, DML, DCL, TCL

The document provides an overview of SQL commands categorized into DDL, DML, DCL, and TCL, along with key commands and case studies for each category. DDL includes commands like CREATE, ALTER, and DROP; DML covers INSERT, UPDATE, and DELETE; DCL involves GRANT and REVOKE; and TCL features COMMIT, ROLLBACK, and SAVEPOINT. Each section includes practical case studies to illustrate the application of these commands.

Uploaded by

Rajath MS
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)
7 views3 pages

Give All SQL Commands in A PDF of DDL, DML, DCL, TCL

The document provides an overview of SQL commands categorized into DDL, DML, DCL, and TCL, along with key commands and case studies for each category. DDL includes commands like CREATE, ALTER, and DROP; DML covers INSERT, UPDATE, and DELETE; DCL involves GRANT and REVOKE; and TCL features COMMIT, ROLLBACK, and SAVEPOINT. Each section includes practical case studies to illustrate the application of these commands.

Uploaded by

Rajath MS
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/ 3

give all sql commands in a pdf of ddl,dml,dcl,tcl

with appropriate case studies


Here’s a structured overview of SQL commands across DDL, DML, DCL, and TCL with case
studies:

DDL (Data Definition Language)


Used to define/modify database structures.

Key Commands:
CREATE: Creates tables/databases.
CREATE TABLE Employees (id INT, name VARCHAR(50)); -- [^4][^5]

ALTER: Modifies table structure.


ALTER TABLE Employees ADD salary DECIMAL(10,2); -- [^4][^5]

DROP: Deletes tables/databases.


DROP TABLE Employees; -- [^4][^5]

Case Study: Designing a Students table with columns id, name, and age [1] [2] .

DML (Data Manipulation Language)


Manages data within tables.

Key Commands:
INSERT: Adds data.
INSERT INTO Customers (id, name) VALUES (1, 'Alice'); -- [^1][^5]

UPDATE: Modifies data.


UPDATE Employees SET salary = 60000 WHERE id = 101; -- [^7][^9]

DELETE: Removes data.


DELETE FROM Employees WHERE department_id = 5; -- [^7][^9]

Case Study: Updating salaries for employees in the Sales department [3] [4] .

DCL (Data Control Language)


Manages user access.

Key Commands:
GRANT: Provides privileges.
GRANT SELECT, UPDATE ON Customers TO user1; -- [^1][^5]

REVOKE: Removes privileges.


REVOKE SELECT ON Customers FROM user1; -- [^1][^5]

Case Study: Restricting user1 from modifying the Orders table [5] [2] .

TCL (Transaction Control Language)


Manages transactions.

Key Commands:
COMMIT: Saves changes permanently.
COMMIT; -- [^4][^7]

ROLLBACK: Reverts changes.


ROLLBACK; -- [^4][^7]

SAVEPOINT: Sets a rollback point.


SAVEPOINT sp1; -- [^7]

Case Study: Rolling back an erroneous bulk DELETE operation [3] .

Example Database (Case Study)


Using a Customers table [6] :

SELECT id, name, salary FROM Customers WHERE salary > 2000; -- [^12]
This query retrieves high-earning customers, demonstrating SELECT with a WHERE clause [6] .
For a detailed PDF, compile these commands with expanded examples from the sources [5] [1] [2]
[3] [6] .

1. https://www.scribd.com/document/833757095/SQL-Ddl-Dml-Tcl-Commands-With-Examples
2. https://k21academy.com/microsoft-azure/data-engineer/sql-commands/
3. https://trainings.internshala.com/blog/different-types-of-sql-commands/
4. https://www.edureka.co/blog/sql-commands
5. https://www.programiz.com/sql/commands
6. https://www.sathyabama.ac.in/sites/default/files/course-material/2020-10/UNIT-II_15.pdf

You might also like