What is SQL?
SQL stands for Structured Query Language. It is a standard language used to communicate with databases. SQL is used to store, retrieve, update, and delete data in relational databases like MySQL, PostgreSQL, SQL Server, Oracle, and others.
Why Use SQL?
SQL helps you:
- Create and manage database structures (tables, views, etc.)
- Insert, update, and delete data
- Retrieve specific data using queries
- Control access to the database
🧩 Basic SQL Commands with Examples
1. CREATE TABLE – Make a new table
CREATE TABLE Students (
ID INT,
Name VARCHAR(100),
Age INT
);
2. INSERT INTO – Add data into a table
INSERT INTO Students (ID, Name, Age)
VALUES (1, 'Alice', 20);
3. SELECT – Get data from a table
SELECT * FROM Students;
-- Shows all students
SELECT Name, Age FROM Students WHERE Age > 18;
-- Shows students older than 18
4. UPDATE – Change existing data
UPDATE Students
SET Age = 21
WHERE ID = 1;
5. DELETE – Remove data from a table
DELETE FROM Students
WHERE ID = 1;
6. DROP TABLE – Delete a table completely
DROP TABLE Students;
Summary
- SQL is the language of databases.
- It works with tables to manage structured data.
- It uses commands like
SELECT
, INSERT
, UPDATE
, DELETE
, CREATE
, and DROP
.
Would you like to try writing some SQL queries yourself or want more practice examples?