Database Design and Advanced SQL Course

Free online course · 8 lessons

Write advanced SQL with subqueries, CTEs and window functions, design schemas with ER modeling and normalization, and manage indexes, transactions, views, privileges and NoSQL alternatives. After the course you can design and tune a database for a real application.

What you need first

By Studeli

Start with lesson 1

What you will learn in 8 lessons

Every lesson includes all nine study tools

  • Study Guide
  • Summary
  • Walkthroughs
  • Practice Questions
  • Flashcards
  • Explain It
  • Key Terms
  • Cheat Sheet
  • Concept Map
  1. Answer multi-step questions with subqueries and common table expressions, and combine result sets with UNION, INTERSECT and EXCEPT.

    5 learning goals
    1. 1.Answer questions with nested subqueries
    2. 2.Compare rows with correlated subqueries and existence tests
    3. 3.Combine result sets with set operations
    4. 4.Organize queries with common table expressions
    5. 5.Query hierarchies with recursive CTEs
  2. Rank, number and compare rows with window functions, and compute running totals and moving averages.

    5 learning goals
    1. 1.Explain what window functions compute
    2. 2.Rank and number rows
    3. 3.Compute running totals and moving averages with window frames
    4. 4.Compare rows with LAG, LEAD and value functions
    5. 5.Build reliable analytical queries
  3. Model a domain with entities, attributes and relationships, draw an ER diagram and translate it into tables.

    6 learning goals
    1. 1.Describe a domain with entities, attributes and keys
    2. 2.Model relationships and their constraints
    3. 3.Draw and read ER diagrams in Chen and crow's foot notation
    4. 4.Model weak entities and type hierarchies
    5. 5.Map an ER model to relational tables
    6. 6.Design and check a complete model
  4. Identify update anomalies and functional dependencies, normalize tables to third normal form and BCNF and decide when to denormalize.

    5 learning goals
    1. 1.Recognize redundancy and update anomalies
    2. 2.Reason with functional dependencies and keys
    3. 3.Normalize tables step by step to third normal form
    4. 4.Reach BCNF with lossless, dependency-preserving designs
    5. 5.Decide when and how to denormalize
  5. Explain how B-tree and hash indexes speed up queries, read a query plan and choose indexes for a workload.

    5 learning goals
    1. 1.Explain how indexes speed up queries
    2. 2.Read query plans with EXPLAIN
    3. 3.Judge when an index helps using selectivity
    4. 4.Design composite and covering indexes
    5. 5.Choose indexes for a workload
  6. Group statements into ACID transactions, choose isolation levels and explain how locking and multiversion concurrency control prevent anomalies.

    5 learning goals
    1. 1.Group SQL statements into reliable transactions
    2. 2.Recognize concurrency problems and choose an isolation level
    3. 3.Control concurrency with locks and resolve deadlocks
    4. 4.Explain multiversion concurrency control and snapshot isolation
    5. 5.Explain how logging lets a database recover from failures
  7. Create views, stored procedures and triggers, manage users and privileges and prevent SQL injection with parameterized queries.

    5 learning goals
    1. 1.Build and use views
    2. 2.Write stored functions and procedures
    3. 3.Automate rules with triggers
    4. 4.Control who can do what in a database
    5. 5.Prevent SQL injection
  8. Compare document, key-value, wide-column and graph databases with relational ones, and choose a data model for a given workload.

    6 learning goals
    1. 1.Explain how non-relational data models differ from the relational model
    2. 2.Model data in document databases and key-value stores
    3. 3.Model data in wide-column stores and graph databases
    4. 4.Distribute data with replication and sharding
    5. 5.Reason about consistency trade-offs in distributed databases
    6. 6.Choose data models for workloads and combine them

What to take next

More Programming courses
Before this: SQL Basics (Beginner)

You want to answer questions from data stored in a database, for example as an analyst, developer or office professional, and have not written SQL before.

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started