Skip to content

SQL

Universal Rules of SQL syntax

  • It can be written in single / multiple line. But must end with ;.
  • SQL allow using space or new line to increase readability.
  • SQL syntax of MySQL is not case-sensitive. But encourage to using Capital Letter.

Types of SQL syntax

Types of SQL syntax

Types of SQL SyntaxDescriptionKeywords
DDL - Structural Blueprint (Databases & Tables)Use to define database, tables, index, ...CREATE, ALTER, DROP, RENAME
DML - Content Management (Data Entries)Use for add, update, delete operation towards DBINSERT, UPDATE, DELETE
DQL - Finds the dataUse for query, find data record on DB.SELECT
DCL - Access controlUse for control DB, create user and control the access permissionSHOW, DESCRIBE, EXPLAIN