SQL Fundamental for Beginner || Structured Query Language

Pradip Chaurel
ILLUMINATION
Published in
2 min readAug 15, 2023
Image created by the author

SQL stands for Structured Query Language and is a programming language used for managing and manipulating relational databases. It plays the role of primary communication between software applications and databases.

SQL is an essential tool for data management, retrieval, and modification. It is widely used across various industries.

Here is the key component of SQL:

  1. Data Definition Language (DDL): This component is used to define and manage database structures like creating databases, tables, indexes, and constraints.

CREATE: Used to create a database, table, index, etc.

ALTER: Modify the structure of existing objects such as adding and dropping columns.

DROP: Delete database objects like tables, indexes, and views.

TRUNCATE: Removes all the records from the table but not the table structure.

2. Data Manipulation Language (DML): DML is used to manipulate the data within the tables.

SELECT: Used to retrieve data from the table.

INSERT: Used to add new records into a table.

UPDATE: Used to modify existing records in a table.

DELETE: Used to remove records from a table.

3. Data Control Language (DCL): DCL command is used to manage user access and permissions within the databases.

GRANT: Assigns specific privileges to users, allowing them to perform certain actions on the database.

REVOKE: Removes previously granted privileges from users.

4. Data Query Language (DQL): DQL mainly focuses on querying and retrieving data from databases. The primary DQL command is the SELECT statement.

Here are the basic commands that you can practice in order to learn SQL.

  1. SELECT — To retrieve data.
  2. WHERE — Used to filter the data.
  3. ORDER BY — Order output data in ascending or descending order.
  4. GROUP BY — Used to group the rows.
  5. HAVING — Filter grouped data
  6. AND, OR, NOT — Combine conditions in where clause
  7. INSERT INTO — Add new records into a table.
  8. UPDATE — Modify the existing record.
  9. DELETE — Remove records from a table
  10. Aggregate Function — SUM(), COUNT(), AVG(), MIN(), MAX()
  11. Joins — INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN

I hope this article helps understand the basics of SQL and commands. I am open to suggestions from readers so if you have anything to say you can comment or you can email me.

Stay tuned, Stay focused, and keep learning….🚀🚀

--

--

Pradip Chaurel
ILLUMINATION

I am Pradip 🙎‍♂️, a computer engineering 💻 graduate. I am passionate about data science 📈 and I would love to share knowledge through writing 📝✍️.