Say I've a query like this
SELECT DISTINCT customer_name
FROM borrower
WHERE customer_name in (SELECT customer_name FROM depositor)
We can consider above as two queries
A
SELECT DISTINCT customer_name
FROM borrower
WHERE customer_name
B
SELECT customer_name
FROM depositor
Which executes first? Is this rule the same for all sub queries?
What types of sub queries can we write? Give me some pointers to get started with a tutorial link.