Skip to content

Chapter 1 of 8

Foundations of SQL and Relational Databases

SQL, or Structured Query Language, is the standardized language used to manage relational databases—databases that organize data into tables connected through defined relationships. A relational database is managed by software called an RDBMS, with popular implementations including PostgreSQL, MySQL, SQLite, Oracle, and SQL Server. Each of these systems speaks a common core of SQL but often extends it with proprietary features known as dialects.

A table is the fundamental unit of storage in a relational database. It consists of rows and columns: a row represents a single record, while a column represents an attribute or field shared by every row in the table. To make rows addressable and to link tables together, SQL uses keys. A primary key uniquely identifies each row and cannot be NULL, while a foreign key in one table references the primary key of another, establishing a relationship between them. More advanced key types include composite keys (formed from multiple columns acting together) and candidate keys (any column or set that could serve as the primary key).

The reliability of these relationships is governed by referential integrity, which ensures that every foreign key points to an existing primary key. Underpinning everything is the requirement that each cell in a well-designed table hold a single atomic value—introducing the first rule of normalization explored in the next chapter.

All chapters
  1. 1Foundations of SQL and Relational Databases
  2. 2Database Design and Normalization
  3. 3Querying Data: Clauses and Filtering
  4. 4Joins and Set Operations
  5. 5Aggregates and Window Functions
  6. 6Data Modification and Schema Management
  7. 7Programmable SQL and Advanced Features
  8. 8Performance, Transactions, and Operations

Drill it

Reading is not remembering. These come from the SQL Mastery deck:

Q

What is SQL?

Structured Query Language — a standardized language for managing relational databases.

Q

What is a relational database?

A database storing data in tables with relationships between them.

Q

What is RDBMS?

Relational Database Management System.

Q

Name common RDBMS.

PostgreSQL, MySQL, SQLite, Oracle, SQL Server.