SQL FOUNDATIONS:Introduction to SQL
Understand what SQL is and learn to read data using simple SELECT queries.
What is SQL
SQL (Structured Query Language) is used to interact with databases. It allows you to:
- Retrieve data
- Insert data
- Update data
- Delete data
It is widely used in backend systems, analytics, and technical interviews.
What is a Database
A database is a collection of structured data stored in tables.
Each table consists of:
- Rows (records)
- Columns (fields)
Example table: employees
Basic SQL Query
To retrieve all data from a table:
sqlSELECT * FROM employees;
Explanation:
SELECTdefines what data to retrieve*means all columnsFROMspecifies the table
Selecting Specific Columns
sqlSELECT name, salary FROM employees;
This returns only selected columns instead of the full table.
Key Concept
SQL is used to query data by specifying:
- What data you want
- Where to get it from
Introduction to SQL Missions
Solve exercises in sequence to unlock the next mission.
1
2
Select name and salary
Retrieve only the name and salary columns.
Locked
3
Select department only
Retrieve only the department column.
Locked
4
Salary then name
Retrieve salary and name, in that order.
Locked
5
Employee names only
Retrieve all employee names as a single column result.
Locked