SQL Commands

SQL Commands

SQL commands are grouped into 4 major categories depending on their functionality.
  1. Data Definition Language (DDL)
  2. Data Manipulation Language (DML)
  3. Transaction Control Language (TCL)
  4. Data Control Language (DCL)

Data Definition Language (DDL)

Data definition statement are used to define the database structure or table. These SQL commands are used for creating, modifying, and dropping the structure of database objects. The commands are CREATE, ALTER, DROP, RENAME, and TRUNCATE.

Data Manipulation Language (DML)

Data manipulation statement are use for managing data within table object. These SQL commands are used for storing, retrieving, modifying, and deleting data. These Data Manipulation Language commands are: SELECT, INSERT, UPDATE, and DELETE.

Transaction Control Language (TCL)

Transaction control statement are use to apply the changes permanently save into database. These SQL commands are used for managing changes affecting the data. These commands are COMMIT, ROLLBACK, and SAVEPOINT.

Data Control Language (DCL)

Control statements are used to give privileges to access limited data. These SQL commands are used for providing security to database objects. These commands are GRANT and REVOKE.

There is another fifth category which is

Session Control Statements (SCS)

Session control statement are manage properties dynamically of a user session. ALTER SESSION and SET ROLL are the statements included.

List of Most Important SQL Commands

  1. SELECT - extracts data from a database
  2. INSERT INTO - inserts new data into a database
  3. UPDATE - updates data in a database
  4. DELETE - deletes data from a database
  5. CREATE DATABASE - creates a new database
  6. ALTER DATABASE - modifies a database
  7. CREATE TABLE - creates a new table
  8. ALTER TABLE - modifies a table
  9. DROP TABLE - deletes a table

List of All SQL Commands

  1. CREATE DATABASE
  2. CREATE TABLE
  3. CREATE INDEX
  4. CREATE VIEW
  5. DROP DATABASE
  6. DROP INDEX
  7. DROP TABLE
  8. SELECT
  9. SELECT *
  10. SELECT DISTINCT
  11. SELECT INTO
  12. SELECT TOP
  13. WHERE
  14. INSERT INTO
  15. INNER JOIN
  16. UPDATE
  17. DELETE
  18. AND|OR
  19. ALTER TABLE
  20. AS (alias)
  21. BETWEEN
  22. LIKE
  23. IN
  24. EXISTS
  25. GROUP BY
  26. ORDER BY
  27. HAVING
  28. LEFT JOIN
  29. RIGHT JOIN
  30. FULL JOIN
  31. TRUNCATE TABLE
  32. UNION
  33. UNION ALL
  34. REVOKE
  35. COMMIT
  36. ROLLBACK
  37. SAVEPOINT
  38. GRANT
All these commands will be explained in greater detail in upcoming tutorials.

Comments