π’ Day 1/30 SQL, Python, ETL, Data Modelling Challenge (FREE Solutions!) π
Solutions for Feb 24th, 2025 CHALLENGE AVAILABLE FOR FREE
πΉ Difficulty Level: Easy
πΉ Theme: SQL : CTEs, Python: Lists, ETL: Staging, and Data Modelling: Primary vs. Foreign Keys
π‘ Not subscribed yet? Get daily challenges + expert breakdowns delivered straight to your inbox!
1οΈβ£ SQL Challenge - Day 1/30
π Concept Focus: Common Table Expressions (CTEs) & Aggregation
π Topic: Understanding how CTEs work in SQL and how to use them for grouping and counting unique values.
Challenge Recap:
sql
WITH department_counts AS (
SELECT department, COUNT(*) as num_employees
FROM employees
GROUP BY department
)
SELECT COUNT(*) FROM department_counts;β What will be the output?
π A) Total number of employees
π B) Total unique departments β
π C) Sum of all employees across departments
π D) SQL Error
β Correct Answer: B) Total unique departments
π Reasoning:
The CTE groups employees by department and counts the number of employees in each department.
The final query counts the number of rows in the CTE, which equals the number of unique departments.
If you had HR, IT, and Finance, the result would be 3.
π’ Try running this query on OneCompiler (PostgreSQL)!
π Python Challenge - Day 1/30
π Concept Focus: Python Lists & Mutability
π Topic: Understanding how Python handles lists and references
Challenge Recap:
python
list_1 = [1, 2, 3]
list_2 = list_1
list_2.append(4)
print(list_1) β What will be the output?
π A) [1, 2, 3]
π B) [1, 2, 3, 4] β
π C) [4, 1, 2, 3]
π D) Error
β Correct Answer: B) [1, 2, 3, 4]
π Reasoning:
Lists in Python are mutable and assigned by reference.
list_2 = list_1makes both variables point to the same list in memory.Appending to list_2 also modifies list_1!
π’ Run this on OneCompiler (Python) and test what happens!
β‘ ETL Challenge - Day 1/30
π Concept Focus: Staging Tables in ETL Pipelines
π Topic: Understanding the role of staging tables in data transformation
Challenge Recap:
β Which of the following best describes the role of staging tables in an ETL pipeline?
π A) They store raw data before transformation β
π B) They contain final transformed data ready for reporting
π C) They replace the need for a data warehouse
π D) They permanently delete unnecessary records
β Correct Answer: A) They store raw data before transformation
π Reasoning:
Staging tables act as temporary storage before data transformation.
They prevent changes to source data and help with data validation before loading into the final warehouse.
π Data Modeling Challenge - Day 1/30
π Concept Focus: Primary Keys & Foreign Keys in Relational Databases
π Topic: Understanding how tables relate using PKs and FKs
Challenge Recap:
β Which statement about Primary Keys & Foreign Keys is TRUE?
π A) A table can have multiple primary keys
π B) A foreign key must always be unique
π C) A primary key uniquely identifies records in a table β
π D) A foreign key creates a new table
β Correct Answer: C) A primary key uniquely identifies records in a table
π Reasoning:
Primary Keys (PKs) ensure uniqueness within a table.
Foreign Keys (FKs) reference a PK from another table to enforce relationships.
π’ Try this on OneCompiler (PostgreSQL) by creating PK & FK relationships!
π Whatβs Next?
π₯ Enjoying these challenges? Get 30 days of FREE challenges. For exclusive paid deep dives for these challenges upgrade yourself to Upgrade now for Full Access! π
π Want full breakdowns + runnable SQL & Python code? Upgrade now for Full Access! π
π‘ What stood out the most to you today? Drop your thoughts in the comments!π
π₯ How did you score on todayβs challenge? Be honestβ
β
4/4? Youβre a beast!
π€ 1/4? No worries! We all start somewhere.
π Winners with top scores get a shoutout + visibility in my LinkedIn communityβwhere recruiters & data engineers are always watching.
Engage, comment, and use this as your networking space! π Less engagement = your missed opportunity. Not ME. Take charge! ππ₯
π¬ Drop Your Score in the Comments!


