Given a company id, fetch all its shops including the shops of its children companies

Job ID: 34895916

Budget: ₹600 – ₹1,500 INR

More details 1:1, the database is Postgres - the task is to find the list of all shops including children companies of a given company (parent company). The query needs to be as efficient as possible.
Related categories: SQL PostgreSQL