Introduction
A scalar subquery in SELECT lets you get a single value from another table or query to use in each row of your main query. It helps add extra info without joining tables.
When you want to show a related value from another table for each row, like the latest order date for each customer.
When you need to calculate a small summary value, like the average score, to show alongside each record.
When you want to add a single value result from a query inside your main query without making it complex.
When you want to compare each row's value with a single value from another query.