SQL (Structured Query Language) is the standard language used to communicate with relational databases.SQL is the tool that lets you create, read, update and delete data.
SQL allows you to:
1.Query data - retrieve specific information from one or more tables.
2.Insert data - add new records.
3.Update data - modify existing records.
4.Delete data - remove records.
5.Define structure - create and modify tables, indexes and relationships.
6.Control access - manage who can view or change data.
Basic Rules of SQL
a)SQL statements end with a semicolon (;)
Each statement is a complete instruction and the semicolon signals its end.
b)Keywords are not case-sensitive
SELECT, select, and Select all work the same but it's standard practice to write keywords in uppercase.
Identifiers i.e table and column names are written in lowercase for readability.
c)Table and column names should be meaningful and consistent
Avoid ambiguous names and use consistent casing e.g. snake_case across your schema.
d)String values are enclosed in single quotes
Example: WHERE name = 'John' - not double quotes.
e)Every table should have a primary key
A primary key uniquely identifies each row and cannot contain NULL or duplicate values.
f)Data types must be respected
Columns are defined with specific types (INT, VARCHAR, DATE, etc.) and inserted data must match.
g)NULL represents "unknown" or "missing," not zero or empty
Comparisons with NULL require special operators like IS NULL rather than =.
h)The order of clauses in a query is fixed
i)Comments improve readability
Single-line: -- comment
Multi-line: /* comment */
An example:
This query retrieves the first and last names of all employees in the Sales department, sorted alphabetically by last name.
SQL remains foundational because nearly every modern application relies on structured data storage. Understanding SQL gives you the ability to interact directly with the backbone of most software systems regardless of the programming language used in it.

Top comments (0)