1. Introduction to relational databases
Relational databases are introduced through PostgreSQL and the core concepts used in SQL-based systems. The section clarifies the division of SQL into DQL, DML, DDL, and DCL, and also covers connecting to the server and an existing database.
- concepts related to SQL databases using PostgreSQL as an example,
- division of the SQL language into DQL, DML, DDL, DCL,
- connecting to the SQL server and the existing database.
2. Detailed overview of available software for managing relational databases
PG Admin provides the working environment for writing SQL and navigating PostgreSQL server resources. The section presents the code editor used for query creation and clarifies the role of key server objects such as tables, views, and stored procedures.
- SQL code editor – PG Admin in creating queries,
- server objects: tables, views and stored procedures.
3. Introduction to the DQL (Data Query Language) language and its key functions
At the start of query work, attention goes to how data is requested and how query tools support that process. This section introduces DQL, the use of a query designer in applications, and the basic SQL data types needed to build correct queries.
- Query designer in applications and creating a query to the database,
- basic data types in SQL and their application.
4. Discussion of various operators used in SQL queries
Effective filtering in SQL depends on choosing operators that match the intended condition logic. The section covers comparison and pattern operators, combining criteria with AND, OR, and NOT, and the practical meaning of NULL versus NOT NULL in queries.
- operators in SQL =, <>, >=, <=, IN, BETWEEN AND, LIKE,
- criteria in queries and combining multiple criteria using AND, OR, NOT,
- the concept and application of NULL and NOT NULL.
5. Detailed discussion of table join operations in SQL using various types of joins
Relations between tables determine how data from separate sources can be returned as one result. This section explains the linking element between tables and compares INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, FULL OUTER JOIN, and CROSS JOIN.
- the concept of relationships between database tables and the element connecting the tables,
- inner join INNER JOIN, RIGHT OUTER JOIN and LEFT OUTER JOIN,
- full join FULL OUTER JOIN and cross join CROSS JOIN.
6. Overview of built-in functions in SQL that allow performing advanced operations on data
Built-in SQL functions make it possible to transform values directly inside a query. The scope includes text operations such as LEFT, RIGHT, TRIM, SUBSTRING, UPPER, LOWER, and CONCAT, along with ROUND, date and time functions, and type conversion with CAST() and CONVERT().
- operations on character strings LEN, LEFT, RIGHT, MID, REPLACE, TRIM, SUBSTRING, UPPER, LOWER and concatenation of text strings CONCAT,
- mathematical functions ROUND, time and date DATE, DATEADD DATEDIFF,
- conversion and type casting: CAST(), CONVERT().
7. In-depth discussion of the SELECT statement, which is the foundation of the SQL language
SELECT serves as the core mechanism for retrieving and shaping query results in SQL. The section covers column aliases with AS, expressions based on columns, sorting with ORDER BY, limiting rows with LIMIT, and removing duplicates through DISTINCT.
- column alias AS, operations on a column and sorting the result ORDER BY,
- limiting the number of records LIMIT and removing duplicates DISTINCT.
8. Introduction to aggregate queries
For reporting and summary analysis, raw rows must often be grouped into meaningful result sets. This section explains GROUP BY, the use of COUNT, MIN, MAX, SUM, and AVG, and the role of criteria when working with aggregated output.
- aggregation of results in queries using GROUP BY,
- functions COUNT, MIN, MAX, SUM, AVG and criteria in aggregated results.
9. Overview of methods for combining results of different SQL queries
Combining outputs from separate SQL statements is addressed through set operations rather than joins. Participants work with UNION, UNION ALL, INTERSECT, and MINUS to merge results, preserve duplicates when needed, or isolate common rows.
- combining tables using: UNION, UNION ALL,
- common parts and INTERSECT, MINUS.
10. Discussion of nested queries
When filtering or building logic depends on another query, nested statements become essential. The section shows how a subquery can serve as a WHERE condition, how one query can be based on another, and where optimization matters.
- query result as a WHERE condition in a query,
- a query based on another query and query optimization.
11. Introduction to the Data Modification Language (DML)
Working with table contents requires precise control over inserts, updates, and removals. This part covers INSERT, UPDATE, and DELETE, and also shows how SELECT INTO can write query results into a new table for further processing.
- updating data using UPDATE,
- adding records to a table using the INSERT command,
- deleting data using the DELETE command,
- outputting the query result to a table: SELECT INTO.
12. Discussion of the Data Definition Language (DDL) (Data Definition Language)
Database structure is created here through TABLE and VIEW definitions prepared both in PG Admin and directly in SQL. The section focuses on how DDL statements translate into concrete database objects and how these objects are managed in practice.
- construction of database objects TABLE, VIEW using PG Admin and SQL code.
13. Overview of advanced functions available in PostgreSQL
Window functions in PostgreSQL extend classic querying with calculations performed across related rows. The section explains OVER(), ROW_NUMBER(), and the use of PARTITION BY to number records within defined groups without collapsing the result set.
- window functions OVER() and numbering records using ROW_NUMBER(),
- numbering and partitioning records using PARTITION BY.