Skip to content

Computer Science · Ch 9 — Structured Query Language (SQL)

Introduction

9.1

Introduction

We have already seen that a Relational Database Management System (RDBMS) is the software that manages data organised into relations (tables). The previous chapter explained the purpose of an RDBMS — to store data securely, maintain relationships between tables, and allow efficient retrieval. Now we move from theory to practice: how do we actually create, fill, and ask questions of a database?

The textbook introduces this chapter by naming the major RDBMS available today. These include MySQL, Microsoft SQL Server, PostgreSQL, and Oracle. Each of these systems lets you define a database made up of relations. More importantly, they all provide a way to interact with that data through queries — structured commands that tell the database what to do.

The focus of this chapter is MySQL, one of the most widely used open-source RDBMS. You will learn three core operations:

  • Creating a database and its tables (defining the structure)
  • Populating those tables with data (inserting records)
  • Querying the database (retrieving, filtering, and manipulating data)

In short, this chapter is where you begin writing actual SQL commands to build and work with a real database.