Hi,
If I understand correctly, you have stale projects in your instance that are bloating your database. What's not clear to me is whether these are independent projects, or branches. If they are branches, then you should be able to delete them via Administration > Projects > Management. Search for the common project name, select all the old branches and Delete.
Note that robust branch management is on our roadmap for the next LTS (E.T.A. October), so that once you get your instance cleaned up, this should become easier to manage in the future.
Also, because this must be said, NEVER MANIPULATE YOUR SONARQUBE DATABASE DIRECTLY. Instead, treat it as a black box, and make all changes through web services, analysis, or the UI.
Ann