SQL & Database Fundamentals
From what a table is through to reading execution plans: query, join, aggregate, design and tune relational data.
Prerequisites
None. This course assumes no prior knowledge of the subject.
Technologies
About this course
Almost every application Anvi builds stores its important data in a relational database. Being able to query that data directly is what lets you confirm what your code did rather than guessing from the UI.
The course starts from the genuine beginning: what a table is, what a key means, why relationships exist. It then works up through joins, grouping, subqueries and window-style analysis to indexing and query tuning.
Design is covered alongside querying, because most slow queries are a symptom of a schema that made the query hard to write in the first place.
Course roadmap
All 22 lessons are written and available.
Module 01
Database Foundations
What a relational database is and the vocabulary everything else builds on.
- 01What Is a Database?Explain what a relational database gives you that a file does not.12 min
- 02Tables, Rows and ColumnsDescribe how data is organised and choose sensible column types.14 min
- 03Primary and Foreign KeysIdentify rows uniquely and link tables reliably.15 min
- 04RelationshipsModel one-to-many and many-to-many relationships between tables.15 min
Module 02
Reading and Changing Data
The four operations you will use constantly, and how to target exactly the rows you mean.
- 01SELECTRetrieve columns and rows, and alias results readably.14 min
- 02Filtering with WHERETarget exactly the rows you mean, including null handling.18 min
- 03Sorting and LimitingOrder results and return only the rows you need.13 min
- 04INSERT, UPDATE and DELETEChange data safely, always checking the affected rows first.17 min
Module 03
Combining and Summarising
Answer questions that span tables, and reduce many rows to the numbers someone asked for.
- 01JoinsCombine tables with inner, left, right and full joins, and predict the row count.22 min
- 02Grouping and AggregationSummarise rows into totals and counts, and filter groups with HAVING.18 min
- 03SubqueriesUse a query inside another, and know when a join is clearer.17 min
- 04Common Table ExpressionsBreak a complex query into readable named steps.16 min
Module 04
Views, Procedures and Transactions
Reusable query logic in the database, and keeping related changes consistent.
- 01ViewsName a query for reuse, and understand what a view does not do.15 min
- 02Stored ProceduresEncapsulate logic in the database, weighing the trade-offs.18 min
- 03FunctionsWrite reusable scalar and table-valued functions.16 min
- 04Transactions and IsolationKeep related changes consistent and choose an isolation level deliberately.20 min
Module 06
Design and Security
Structure a schema so queries stay simple, and control who can reach the data.
On completion
What you should take away
- SQL is declarative: you describe the result, the engine decides the method
- Joins are about matching rows, and predicting the row count prevents most surprises
- Transactions are how you keep related changes consistent
- Indexes are the main tool for query performance, and execution plans tell you whether they are used
- Schema design determines how hard your queries have to work
Recommended next course
Entity Framework Core
Work with a database through C# objects while staying aware of the SQL underneath, including the performance traps that catch most teams.
Continue to EF CoreHave a project worth talking through?
Tell us what you're building or what's slowing your current system down. We'll give you a direct read on scope and approach.