🔍A sub query in SQL is a query placed inside another query, providing additional filtering or calculations.
🧩Scalar sub queries return a single value, such as the average salary, which can be used for comparison or calculations.
🔄Scalar sub queries can be used in different clauses of SQL, including the WHERE and FROM clauses, for filtering and joining data.
🔢Scalar sub queries are processed independently and return a single row and column, making them efficient for specific data manipulations.
✨Using scalar sub queries in SQL queries enhances flexibility, allowing dynamic calculations and filtering based on changing data.