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

idnamedepartmentsalary
1JohnHR40000
2AliceIT60000
3BobIT55000

Basic SQL Query

To retrieve all data from a table:

sql
SELECT * FROM employees;

Explanation:

  • SELECT defines what data to retrieve
  • * means all columns
  • FROM specifies the table

Selecting Specific Columns

sql
SELECT 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

Retrieve all columns

Retrieve all columns from the employees table.

Solve Mission
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