SQL: Querying, Modelling and Running a Database
Query, model and protect a relational database with SQL, from SELECT to window functions, up to PostgreSQL in production (indexes, transactions, permissions, backups), based on a real Moroccan online store.
A MasterLinux course · Original text
What you will learn
- Understand the relational model (tables, rows, keys) and where PostgreSQL, MySQL/MariaDB, SQLite and SQL Server fit
- Write precise SELECT queries with filters, sorting, limits and correct handling of NULL
- Create solid tables with the right types and constraints (primary key, NOT NULL, UNIQUE, CHECK, DEFAULT)
- Modify data safely with INSERT, UPDATE and DELETE, including transactions
- Produce dashboards with GROUP BY, HAVING, joins, subqueries, CTEs and UNION
- Model a normalized online store (1NF, 2NF, 3NF) with foreign keys
- Calculate rankings, running totals and monthly revenue with window functions and dates
- Run PostgreSQL in production — indexes and EXPLAIN, isolation, roles and GRANT, JSONB, parameterized queries, pg_dump and pg_restore
Course content
14 lessons · 13 h 45 minSection 1 — First steps in SQL
Section 2 — Querying and modelling
- Agrégations : COUNT, SUM, AVG, GROUP BY et HAVING 50 min
- Jointures : INNER, LEFT, RIGHT, FULL et auto-jointure 55 min
- Sous-requêtes, CTE (WITH) et opérations ensemblistes (UNION, INTERSECT, EXCEPT) 55 min
- Modéliser : clés étrangères, normalisation (1FN, 2FN, 3FN) et schéma d'une boutique 1 h
- Fonctions de fenêtre (ROW_NUMBER, RANK, SUM OVER) et dates 1 h
Section 3 — PostgreSQL and performance
Section 4 — Security and backups
Section 5 — Project
Requirements
- Able to use a computer and a text editor
- Terminal basics help for the labs (the “Fundamentals” course is recommended)
- No prior database knowledge required
Who is this course for?
- Web and mobile developers who need to write reliable queries for their applications
- System administrators who host and back up PostgreSQL or MySQL databases
- Students (BTS, DUT, bachelor’s degree, engineering schools) who want a practical, solid foundation in SQL
- Business owners, accountants and analysts who want to pull their own figures from their store’s database