Lesson 1 of 20

Introduction to SQL

What is SQL?

SQL (Structured Query Language) is a standard programming language designed for managing and manipulating data stored in relational databases. It was originally developed at IBM in the early 1970s and has since become the universal language for working with databases.

SQL allows you to create databases, define tables, insert data, query information, update records, and delete data. Nearly every application that stores data — from small mobile apps to massive enterprise systems — relies on SQL behind the scenes.

Unlike general-purpose programming languages, SQL is a declarative language. You tell the database what you want, and the database engine figures out the most efficient way to retrieve it.

  • Declarative language: You describe the result you want, not the step-by-step process to get it
  • Standardized: SQL follows the ANSI/ISO standard, so most syntax works across different databases
  • Powerful: A single SQL query can process millions of rows of data in seconds
  • Essential: SQL is the most widely used language for data management in the world
Example
-- This is a SQL comment
-- SQL statements end with a semicolon

-- A simple SQL query to retrieve data
SELECT 'Hello, SQL World!' AS greeting;

-- Select today's date
SELECT CURRENT_DATE AS today;
Notes
  • SQL is pronounced either as 'S-Q-L' (individual letters) or 'sequel'. Both pronunciations are widely accepted and correct.

Relational Databases & RDBMS

A relational database organizes data into tables (also called relations), where each table is made up of rows and columns. Think of it like a spreadsheet — each row is a record, and each column is a field or attribute.

An RDBMS (Relational Database Management System) is the software that lets you create, manage, and query relational databases using SQL. Different RDBMS products exist, each with slight variations in syntax, but the core SQL remains the same.

  • MySQL: Open-source, widely used in web applications (WordPress, Facebook's early days)
  • PostgreSQL: Advanced open-source database known for reliability and powerful features
  • SQLite: Lightweight, file-based database perfect for mobile apps and small projects
  • Microsoft SQL Server: Enterprise-grade database from Microsoft
  • Oracle Database: Highly scalable enterprise database used by large corporations
Notes
  • For this course, we will use standard SQL syntax that works across most RDBMS platforms. Where differences exist, we will note them.

Where is SQL Used?

SQL is used virtually everywhere data is stored and retrieved. Whether you are building a website, analyzing business data, or developing a mobile app, understanding SQL is a fundamental skill.

From social media platforms to banking systems, SQL powers the data layer of modern technology.

  • Web Development: Storing user accounts, blog posts, product listings, and orders
  • Data Analytics: Running reports, calculating metrics, and generating business insights
  • Mobile Apps: Managing local data with SQLite or connecting to cloud databases
  • Finance: Tracking transactions, balances, and regulatory compliance data
  • Healthcare: Managing patient records, appointments, and medical histories
Notes
  • According to the Stack Overflow Developer Survey, SQL consistently ranks among the top 3 most used languages worldwide.