Wednesday, January 15, 2025
HomeProgrammingSQL Commands - DDL, DML, DCL, TCL.

SQL Commands – DDL, DML, DCL, TCL.

SQL commands are categorized into four types:

  1. DDL (Data Definition Language):
    • Defines and modifies database structure.
    • Commands: CREATE, ALTER, DROP, TRUNCATE.
    • Example: CREATE TABLE students (id INT, name VARCHAR(50));
  2. DML (Data Manipulation Language):
    • Handles data manipulation within tables.
    • Commands: INSERT, UPDATE, DELETE, SELECT.
    • Example: INSERT INTO students VALUES (1, 'John');
  3. DCL (Data Control Language):
    • Manages access permissions.
    • Commands: GRANT, REVOKE.
    • Example: GRANT SELECT ON students TO user1;
  4. TCL (Transaction Control Language):
    • Controls transactions.
    • Commands: COMMIT, ROLLBACK, SAVEPOINT.
    • Example: COMMIT;
RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x