SQL Multi-Level Funding Aggregation with Ties

Given the following tables:

Villages(
  VillageID   INT PRIMARY KEY,
  VillageName VARCHAR(255)
)

Projects(
  ProjectID   INT PRIMARY KEY,
  VillageID   INT,
  ProjectName VARCHAR(255)
)

Fun...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: