The document outlines the four types of SQL commands: DDL for defining database structure, DML for manipulating data, DCL for managing permissions, and TCL for transaction control. It also explains the ACID properties that ensure safe transactions: Atomicity, Consistency, Isolation, and Durability. Each command type includes examples and functions relevant to database management.
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 ratings0% found this document useful (0 votes)
5 views1 page
SQL Commands and ACID Properties
The document outlines the four types of SQL commands: DDL for defining database structure, DML for manipulating data, DCL for managing permissions, and TCL for transaction control. It also explains the ACID properties that ensure safe transactions: Atomicity, Consistency, Isolation, and Durability. Each command type includes examples and functions relevant to database management.
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/ 1
SQL Command Types (DDL, DML, DCL, TCL) with ACID Properties
SQL Commands:
1. DDL - Data Definition Language
Used to define or change the structure of the database. - CREATE: Makes a new table or database. Example: CREATE TABLE students (id INT, name VARCHAR(100)); - ALTER: Changes a table (add/remove columns). - DROP: Deletes a table or database. - TRUNCATE: Deletes all data in a table, but keeps its structure.
2. DML - Data Manipulation Language
Used to work with the data inside the tables. - INSERT: Adds new data. Example: INSERT INTO students (id, name) VALUES (1, 'Rahul'); - UPDATE: Changes existing data. - DELETE: Removes specific rows. - SELECT: Fetches data from a table.
3. DCL - Data Control Language
Used to manage permissions. - GRANT: Gives access. Example: GRANT SELECT ON students TO user1; - REVOKE: Removes access.
4. TCL - Transaction Control Language
Used to manage changes in groups (transactions). - COMMIT: Saves changes. - ROLLBACK: Undoes changes since last commit. - SAVEPOINT: Marks a place to rollback to later.
ACID Properties (Simple Explanation):
ACID Properties (for safe transactions):
- Atomicity: All actions in a transaction happen, or none do. - Consistency: Data stays correct before and after the transaction. - Isolation: Each transaction runs separately from others. - Durability: Once committed, changes are saved even if power fails.