No history yet

Introduction to SQL

The Language of Data

Databases are everywhere. They power everything from your social media feed to your bank account. But how do we communicate with them? How do we ask a database to store new information, find a specific record, or update an existing one? We use a special language called SQL.

SQL, or Structured Query Language, is designed to "talk" to databases.

Think of SQL as a universal translator for databases. Just as pilots around the world use English to communicate with air traffic control, programmers and data analysts use SQL to communicate with most databases.

SQL works with a specific kind of database called a relational database. The name sounds complex, but the idea is simple. A relational database organizes data into tables, which are a lot like spreadsheets. Each table has columns (like 'Name' or 'Email') and rows, where each row represents a single item, like one customer or one product.

A Language with History

SQL isn't new. Its story begins in the early 1970s at IBM. Researchers were working on a new way to store data based on the “relational model,” an influential idea from a computer scientist named Edgar F. Codd. They needed a way for people to actually use these new databases.

They developed a language they called SEQUEL, which stood for Structured English Query Language. They wanted it to be straightforward, using commands that resembled plain English. The name was later shortened to SQL, but the core idea remained: create a simple, powerful way to manage data.

Over the decades, SQL became incredibly popular. Different companies built their own database systems, but most of them used SQL as the primary way to interact with them. To keep things from getting chaotic, official standards were created. The American National Standards Institute (ANSI) adopted a standard for SQL in 1986, and the International Organization for Standardization (ISO) followed in 1987. These standards are updated every few years to add new features, ensuring that while database systems might differ, the basic SQL they understand stays consistent.

What SQL Actually Does

SQL commands can be grouped into a few main categories based on what they do. You don't need to memorize them now, but it's helpful to see the big picture.

CategoryPurposeExample Commands
Data Query Language (DQL)Used to ask questions and retrieve data.SELECT
Data Definition Language (DDL)Used to create and manage the database's structure.CREATE TABLE, ALTER TABLE
Data Manipulation Language (DML)Used to add, delete, and change data.INSERT, UPDATE, DELETE
Data Control Language (DCL)Used to manage permissions and access to the data.GRANT, REVOKE

At its heart, SQL allows you to perform four fundamental actions on data, often remembered by the acronym CRUD:

  • Create: Add new data.
  • Read: Retrieve existing data.
  • Update: Modify existing data.
  • Delete: Remove data.

Nearly every application that relies on a database, from a simple mobile game to a massive e-commerce site, uses these four operations constantly. SQL is the language that makes it all happen.

Ready to see how well you've grasped these foundational ideas?

Quiz Questions 1/5

What is the primary purpose of SQL (Structured Query Language)?

Quiz Questions 2/5

A relational database organizes data into a structure of: