1. What is a database ?

A database is a set of organized data.

A database may take the form of a text file or a spreadsheet. For professional use, database systems are preferred over text files or spreadsheets though.

2. What is SQL ?

SQL is a programming language to query a database.

3. What is a RDBMS ?

A relational database management system (RDBMS) is a software.

Oracle, MySQL, MariaDB, PostgreSQL and SQLite are RDBMS’s implementing SQL, just to name a few.

4. Standard

SQL is standardized since 1986 by ANSI and since 1987 by ISO. Many versions have been released since then. Many RDBMS’s already existed before SQL was standardized, that’s why some SQL features are still implemented in a different way across the RDBMS’s.

5. How does SQL work ?

SQL operates on sets. Let’s illustrate that.

Let $\mathbf{U}$ be the set of students registered at the University of Lausanne as Figure 1.1 illustrates. Let $\mathbf{G}$ be the set of the male students and $\mathbf{H}$ be the set of students registered at the faculty of HEC (Business School), both as subsets of $\mathbf{U}$. Let $\mathbf{G \cap H}$ – the intersection of $\mathbf{G}$ and $\mathbf{H}$ – be the set of the male students registered at the faculty of HEC which is part of the University of Lausanne.

Intersection of sets

Figure 1.1 : SQL operates with sets

By applying a filter to $\mathbf{G \cap H}$ a new subset of it is generated. As an example of filter let’s select only from it the students in their first year of study. From that subset, we can extract data such as the last name, first name and citizenship of each one.

The first part of the present course all along, the various concepts will be illustrated through examples based on the database schema depicted in Figure 1.2. This is a very simple database containing data about the employees, the department each one is part of, the launched projects and the employees allocation among these projects.

Database schema

Figure 1.2 : Database schema

Recap

SQL is a programming language to query a database.

For querying a database using SQL, this is all about sets construction and data extraction therefrom.