If you are writing complex nested subqueries, you might be better off using CTEs (common table expressions) to improve the readability!
CTE enables you to define a query and treat its output as a new table, allowing you to organize your queries in a hierarchical structure.