SQL Series: Part 1 — SQL Basics and Order of Execution

What is SQL (Structured Query Language)?

Harris Wan
2 min readJul 16, 2024

SQL Explained in Simple Terms:

Simply think of it as a way for users like you to communicate with databases and perform various operations from creating, modifying, querying data, and much more.

Key Components of SQL:

  1. DDL (Data Definition Language) : create, modify, and delete the structure of database objects , such as tables, indexes, views, and schemas

Example:

CREATE TABLE orders (
order_id INT PRIMARY KEY,
order_date DATE NOT NULL,
total_amount DECIMAL(10,2)
);

2. DML (Data Manipulation Language): interact and manipulate data stored within the database

Example:

SELECT * FROM orders

3. DCL (Data Control Language): manage user permissions and access control within a database system

Example:

GRANT SELECT ON orders TO user

4. TCL (Transaction Control Language): manage transactions within a database system

Example:

BEGIN TRANSACTION;
INSERT INTO orders (order_id, order_date, total_amount)
VALUES (1001, '2024-07-16', 150.00);
COMMIT;

SQL Order of Execution

--

--

Harris Wan

Data Analyst | Shares about data and Help you break into data!