DSA Factory
Curriculum
DBMS

SQL queries

About 29 steps, from the first idea to a mastery test.

  1. Stage 0Reading a tableFree
    1. 1Pick the columns you need7 min
    2. 2Keep only the rows that pass7 min
    3. 3Combine conditions8 min
    4. 4Sort and keep the top few8 min
  2. Stage 1Shaping the resultsFree
    1. 1Show each value once6 min
    2. 2NULL means unknown9 min
    3. 3Match text with patterns8 min
    4. 4Compute new columns9 min
  3. Stage 2Counting and groupingFree
    1. 1Summarise with COUNT, SUM and AVG9 min
    2. 2One answer per group9 min
    3. 3Filter the groups8 min
    4. 4Rank the groups9 min
  4. Stage 3Joining tablesFree
    1. 1Bring two tables together9 min
    2. 2Keep the rows with no match10 min
    3. 3Join a table to itself9 min
    4. 4Join through a link table10 min
  5. Stage 4Subqueries and window functionsFree
    1. 1A query inside a query9 min
    2. 2Does a matching row exist?9 min
    3. 3Build the answer in steps with WITH9 min
    4. 4Rank within a group11 min
    5. 5Running totals and the row before10 min
  6. Stage 5Changing dataFree
    1. 1Add rows with INSERT8 min
    2. 2Change rows with UPDATE8 min
    3. 3Remove rows with DELETE8 min
    4. 4Insert or update9 min
  7. Stage 6MasteryFree
    1. 1The second highest, with ties10 min
    2. 2Find the duplicates10 min
    3. 3Streaks of consecutive days12 min
    4. 4Top N in each group11 min
Start freeTry a step first