When would you use a CTE versus a subquery in SQL?
Answer with a practical comparison and explain the cases where each approach is preferable. Keep the response focused on readability, reuse, and query structure.
| Column | Type | Description |
|---|---|---|
| idPK | INT | Placeholder primary key |