15/06/2026
Everything will get better after this difficult time. π₯°
Teaching | development | innovation
15/06/2026
Everything will get better after this difficult time. π₯°
02/06/2026
π SQL Interview Series #10 β What are Aggregate Functions in SQL?
Aggregate Functions are used to perform calculations on a set of values and return a single result. They are essential for summarizing and analyzing data in SQL.
πΉ COUNT() β Returns the number of rows
πΉ SUM() β Returns the total sum of values
πΉ AVG() β Returns the average value
πΉ MIN() β Returns the smallest value
πΉ MAX() β Returns the largest value
π Example Use Cases:
β
Count total orders
β
Calculate total revenue
β
Find average sales
β
Get highest and lowest values
β
Generate business reports and analytics
π‘ Remember:
Aggregate Functions summarize data and return a single value. When combined with `GROUP BY`, they can calculate results for each group instead of the entire dataset.
---
π SQL Interview Series #10 β Aggregate Functions αααα»α SQL ααΊααΆα’αααΈ?
Aggregate Functions ααΊααΆαα»αααΆααααααααΎαααααΆααααααΆααΎαααα»ααα·αααααααα½α α αΎααααα αΆααααααααααα½αα
πΉ COUNT() β ααΆααα
ααα½α Rows
πΉ SUM() β ααΌαααα»ααααααααΆααα’αα
πΉ AVG() β ααααΆαααααααααα
πΉ MIN() β αααααααααΌα
αααα»α
πΉ MAX() β ααααααααααααα»α
π α§ααΆα αααααΆαααααΎααααΆααα
β
ααΆααα
ααα½α Order ααα»α
β
ααααΆααααΆααα
αααΌαααα»α
β
ααααΆααΆααααααΆααααα
β
αααααααααααααααα»α αα·αααΆααααα»α
β
αααααΎααααΆαααΆααα αα·ααα·ααΆααα·αααααα
π‘ ααΆαα
αΆαα
Aggregate Functions ααααΎαααααΆαααααααααα·αααααα αα·ααααα αΆααααααααααα½αα αα
αααααααΎααΆαα½α `GROUP BY` ααΆα’αΆα
ααααΆαααααααααααΆαααααα»αααΈαα½ααααΆαα
31/05/2026
π SQL Interview Series #9 β What is the purpose of the GROUP BY clause?
The `GROUP BY` clause is used to organize rows with the same values into groups, allowing aggregate functions such as `COUNT()`, `SUM()`, and `AVG()` to calculate results for each group instead of the entire dataset.
π Why use GROUP BY?
β
Group similar records together
β
Generate summaries per category
β
Work with aggregate functions
β
Create meaningful reports and analytics
Example:
Without `GROUP BY`, `SUM(amount)` returns the total sales of all customers.
With `GROUP BY customer_id`, `SUM(amount)` returns the total sales for each customer individually.
π‘ Think of it this way:
`GROUP BY` = Divide data into groups
Aggregate Functions = Calculate results for each group
---
π SQL Interview Series #9 β GROUP BY Clause ααΆααααααααα’αααΈ?
`GROUP BY` ααααΌαααΆαααααΎαααααΆααααΆαααα·αααααααααααΆααααααααΌα
ααααΆα
αΌαααΆαααα»α ααΎααααΈα±αα Aggregate Functions ααΌα
ααΆ `COUNT()`, `SUM()` αα·α `AVG()` α’αΆα
ααααΆαααααααααααΆαααααα»αααΈαα½αα αααα½αα±ααααααΆααΎαα·ααααααααΆααααΌαα
π α ααα»α’αααΈααααΌαααααΎ GROUP BY?
β
ααΆαααα·ααααααααααααααααΆααΆαααα»α
β
αααααΎααααΆαααΆαααααααααααΆααααααα
β
ααααΎααΆαα½α Aggregate Functions
β
αα½ααα·ααΆααα·ααααααααΆαααΆααααααΆααααα½α
α§ααΆα αααα
ααΎαα·αααααΎ `GROUP BY` αα `SUM(amount)` ααΉαααΌααα·ααααααααΆααα’ααα
ααΎααααΎ `GROUP BY customer_id` ααΆααΉααααα αΆαα
ααα½αααα»ααααααΆααα’αα·αα·ααααααΆααααααα‘ααααΈααααΆα
π‘ ααΆαα
αΆαα
`GROUP BY` = αααα
αααα·ααααααααΆαααα»α
Aggregate Functions = ααααΆαααααααααα»ααααα»αααΈαα½αα
31/05/2026
π SQL Interview Series #7 β Main Types of SQL Commands
SQL is more than just querying data. It provides different categories of commands to define, manipulate, secure, and manage database transactions.
πΉ DDL (Data Definition Language)
Used to define and modify database structures.
Commands: CREATE, ALTER, DROP, TRUNCATE
πΉ DML (Data Manipulation Language)
Used to retrieve and manipulate data.
Commands: SELECT, INSERT, UPDATE, DELETE
πΉ DCL (Data Control Language)
Used to control user permissions and access.
Commands: GRANT, REVOKE
πΉ TCL (Transaction Control Language)
Used to manage transactions and maintain data integrity.
Commands: COMMIT, ROLLBACK, SAVEPOINT
π Quick Summary:
β
DDL β Structure
β
DML β Data
β
DCL β Security
β
TCL β Transactions
Understanding these command categories is a fundamental skill for every Backend Developer, Database Administrator, and Software Engineer.
π SQL Interview Series #7 β ααααααααααΆααααα SQL Commands
SQL αα·ααααααΆαααααΉαααααΆαααααααααα·αααααα (Query) ααα»αααααααα ααΆααααΌαααΆααααα
ααααΆαααααα Command ααααααααααΆαααααΆααααααααααα Database ααΆααααΌαα
πΉ DDL (Data Definition Language)
ααααΎαααααΆαααααααΎα αα·ααααααααα
ααΆαααααααα Databaseα
Commands: CREATE, ALTER, DROP, TRUNCATE
πΉ DML (Data Manipulation Language)
ααααΎαααααΆααααααααα αααααα αααααα αα·ααα»ααα·ααααααα
Commands: SELECT, INSERT, UPDATE, DELETE
πΉ DCL (Data Control Language)
ααααΎαααααΆααααααααααααα·αααα· αα·αααΆαα
αΌαααααΎ Databaseα
Commands: GRANT, REVOKE
πΉ TCL (Transaction Control Language)
ααααΎαααααΆααααααααααα Transaction αα·ααααααΆαα»αααΆαααααΉαααααΌααααα·ααααααα
Commands: COMMIT, ROLLBACK, SAVEPOINT
π ααΆαα
αΆαα
β
DDL β Structure (αα
ααΆαααααααα)
β
DML β Data (αα·αααααα)
β
DCL β Security (αα·αααα·ααααΎααααΆαα)
β
TCL β Transactions (ααααα·ααααα·ααΆα)
ααΆααααααΉαααΈ SQL Command Types ααΊααΆααΌαααααΆαααααΉααααααΆαα Backend Developer, Database Administrator αα·α Software Engineer αααααααΌαα
29/05/2026
π SQL Interview Series #6 β Understanding SQL Joins
SQL Joins are one of the most important concepts in relational databases. They allow you to combine data from multiple tables using a related column, helping you answer real-world business questions.
πΉ INNER JOIN
Returns only records that exist in both tables.
πΉ LEFT JOIN
Returns all records from the left table and matching records from the right table. Unmatched rows return NULL values.
πΉ RIGHT JOIN
Returns all records from the right table and matching records from the left table. Unmatched rows return NULL values.
πΉ FULL OUTER JOIN
Returns all records from both tables. Missing matches are filled with NULL values.
π Quick Summary:
β
INNER JOIN = Matching data only
β
LEFT JOIN = All left + matching right
β
RIGHT JOIN = All right + matching left
β
FULL JOIN = Everything from both tables
Mastering joins is essential for backend development, reporting, analytics, and database design.
π SQL Interview Series #6 β ααααααααα’αααΈ SQL Joins
SQL Join ααΊααΆαααααΉαααααΆαααα½ααα
αααα»α Relational Database αααα’αα»ααααΆαα±ααααΎαααααΆαααα·ααααααααΈααΆααΆαα
αααΎαααΆαα½αααααΆααΆαααα Key α¬ Column αααααΆααααααααΆα
πΉ INNER JOIN
ααΆααααααα·αααααααααααΆααα
αααα»αααΆααΆαααΆααααΈαα
πΉ LEFT JOIN
ααΆααααα·ααααααααΆααα’ααααΈααΆααΆαααΆαααααα αα·ααα·αααααααααααααΌααααααΈααΆααΆαααΆαααααΆαα ααααα·αααΎαα·αααΆαααΆαααααΌαααα ααΉααααα αΆαααΆ NULLα
πΉ RIGHT JOIN
ααΆααααα·ααααααααΆααα’ααααΈααΆααΆαααΆαααααΆα αα·ααα·αααααααααααααΌααααααΈααΆααΆαααΆααααααα ααααα·αααΎαα·αααΆαααΆαααααΌαααα ααΉααααα αΆαααΆ NULLα
πΉ FULL OUTER JOIN
ααΆααααα·ααααααααΆααα’ααααΈααΆααΆαααΆααααΈα α αΎαααααααααααα·αααΆαααΆαααααΌαααα ααΉααααα αΆαααΆ NULLα
π ααααααααααΈα
β
INNER JOIN = αα·αααααααααααααΌααααααααΆ
β
LEFT JOIN = αα·ααααααααΆααα’ααααΈααΆαααααα
β
RIGHT JOIN = αα·ααααααααΆααα’ααααΈααΆαααααΆα
β
FULL JOIN = αα·ααααααααΆααα’ααααΈααΆααΆαααΆααααΈα
ααΆααααααΉαα’αααΈ Join ααΊααΆααααΆαα
αΆαααΆα
ααααααΆαα Backend Developer, Data Analyst αα·α Software Engineer αααααααΌαα
29/05/2026
SQL Interview Series #5 β WHERE vs HAVING
Understanding the difference between WHERE and HAVING is essential for writing efficient SQL queries.
β
WHERE
Filters rows before grouping and aggregation.
Cannot be used with aggregate functions like COUNT(), SUM(), or AVG().
Helps reduce the dataset before processing.
β
HAVING
Filters grouped results after GROUP BY.
Designed for conditions involving aggregate functions.
Useful when you need to filter summarized data.
π Remember:
WHERE = Row-level filtering
HAVING = Group-level filtering
Mastering when to use each clause will help you write cleaner, faster, and more scalable SQL queries.
SQL Interview Series #5 β ααΆααα»αααααΆαααΆα WHERE αα·α HAVING
ααΆααααααΉαααΈ WHERE αα·α HAVING ααΊααΆααΌαααααΆαααααΆαααααααΆααααΆαααααα SQL Query α±ααααΆαααααα·αααααΆαα
β
WHERE
ααααΎαααααΆαα Filter αα·ααααααααΆαααααΆαα Row αα»ααααααααΎ Grouping α¬ Aggregationα
αα·αα’αΆα
ααααΎ Aggregate Functions ααΌα
ααΆ COUNT() , SUM() α¬ AVG() ααΆαααα
αα½αααΆααααααααα·αααααααα»αααα Database ααααΎαααΆαα
β
HAVING
ααααΎαααααΆαα Filter αααααααααααΆααααΈ GROUP BYα
α’αΆα
ααααΎααΆαα½α Aggregate Functions ααΆαα
ααΆααααααααΆααααΆααααα½ααα·αα·ααααααααααααααΆααααααααα½α
α
π ααΆαα
αΆαα
WHERE = Filter ααΆα Row
HAVING = Filter ααΆα Group
ααΆαααααΎαααααΎ Clause ααααΉαααααΌα ααΉαααααΎα±αα Query ααααα’αααααΆαααΆαααα’αΆα ααΏα αα·αααΆαααααΆααα
ααα Project ααΆααααααα
29/05/2026
π NestJS Multiple Middleware
NestJS allows multiple middleware to run sequentially using the `apply()` method.
```ts
consumer
.apply(cors(), helmet(), logger)
.forRoutes(CatsController);
```
β
`cors()` runs first
β
`helmet()` runs next
β
`logger` runs after that
β
Finally, the request reaches the controller
Middleware executes in the same order it is provided inside `apply()`.
Always remember:
If middleware doesnβt send a response, call `next()` β otherwise the request will hang.
π Multiple Middleware αα
αααα»α NestJS
NestJS α’αα»ααααΆαα²αα middleware α
αααΎαααααΎαααΆαααΆαααααΆαααααααααΎ `apply()` methodα
```ts
consumer
.apply(cors(), helmet(), logger)
.forRoutes(CatsController);
```
β
`cors()` ααααΎαααΆααα»ααα
β
`helmet()` ααααΎαααΆααααααΆαα
β
`logger` ααααΎαααΆααααααΆααααα
β
α
α»αααααα request αα
ααα controller
Middleware ααΉαααααΎαααΆαααΆαααααΆαααααααΆαααΆαααα
αααα»α `apply()`α
ααΌαα
αα
αΆαααΆα
ααΎ middleware αα·αααΆα send response αα ααααΌαα α
`next()` ααΎαα·αααΌα
αααααα request ααΉαααΆαα (hanging request)α
28/05/2026
π NestJS Middleware & Dependency Injection
NestJS middleware fully supports Dependency Injection (DI).
Just like controllers and providers, middleware can inject services and dependencies from the same module through the constructor.
β
Cleaner architecture
β
Reusable business logic
β
Better scalability
β
Easy service access inside middleware
π NestJS Middleware αα·α Dependency Injection
NestJS middleware ααΆαααα Dependency Injection (DI) ααααααα
ααΌα
ααΆ controller αα·α provider ααα middleware α’αΆα
inject service α¬ dependency ααΈ module ααΌα
ααααΆααΆαααΆαααα constructorα
β
αααα
α code ααΆαααα’αΆα
β
Reusable business logic
β
ααΆααααα½α scale project
β
α’αΆα
ααααΎ service αα
αααα»α middleware ααΆα
27/05/2026
π Express.js Middleware Basics
Middleware is the core of Express.js request handling.
β
Execute code
β
Modify request & response
β
End the request-response cycle
β
Pass control using next()
Always remember:
If you donβt send a response, call next() β otherwise the request will hang.
π ααΌαααααΆαααααΉα Express.js Middleware
Middleware ααΊααΆααααΌααααα»αααΆαααααααααα request αα
αααα»α Express.jsα
β
ααααΎαααΆα code
β
αααααα request αα·α response
β
αααα
αα request-response cycle
β
αααααα
middleware αααααΆαααααααααΎ next()
ααΌαα
αα
αΆαααΆα
ααΎ middleware αα·αααΆα send response αα ααααΌαα α
next() ααΎαα·αααΌα
αααααα request ααΉαααΆαα (hanging request)α
26/05/2026
π What are ERD Styles?
ERD styles are different ways to visually represent data relationships in a database. Each style uses its own symbols and notation to show entities, attributes, and connections.
π‘ Common ERD styles:
Chen Style β Uses shapes like rectangles, ovals, diamonds π·
Crowβs Foot β Uses table format with βmanyβ fork notation πΎ
Bachman Style β Uses arrows to show relationships β‘οΈ
IDEF1X β Advanced model with detailed structure βοΈ
Barker Style β Similar to Crowβs Foot with optional lines π
π Simple idea:
Different styles, same goalβclearly show how data is connected in a system.
π₯ Choose the style that fits your project, tools, and team.
π ERD Styles ααΆα’αααΈ?
ERD Styles ααΊααΆαα·ααΈαααααααααααΆαααααα αΆαααααΆαααααααα·αααααααααα»α database αααααααΎαααααΆ αα·ααα
ααΆααααααα»ααααααΆα
π‘ αααααα ERD Stylesα
Chen Style β ααααΎααΆα rectangle, oval αα·α diamond π·
Crowβs Foot β ααααΎααΆααΆα αα·ααααααΆ βmanyβ πΎ
Bachman Style β ααααΎαααα½ααααα αΆαααααΆαααααα β‘οΈ
IDEF1X β αα
ααΆαααααααααααα’α·α αα·αααααα·αααααα βοΈ
Barker Style β ααΌα
Crowβs Foot ααΆααααααΆαα dashed π
π αααα·αααΆααααα
Style αα»ααααααΆ ααα»ααααααΆααααααααααΌα
ααααΆβαααα αΆααα·ααααααα²ααααΆααααα
π₯ ααααΎαααΎα style αααααΆαααααΉα project αα·ααααα»αααΆαααΆαα