Does deleting Clash of Clans also remove my base from the world to prevent attacks?

Firstly, the system doesn't know if you've deleted the app from your phone. The only thing it keeps track of is your user ID (or your Supercell ID), and the base(s) attached to it. So if you have not deactivated your account, your base will remain.

Secondly, if you had the intention of starting over to begin with (which is what I take from your statement of "I delete the game it erases my base from the system"), then having your base remain at it's current level, even if it does get raided repeatedly, it is ultimately more productive, no?

Unless you deactivate your account, your base will remain in the system, and it will be raided whenever it is available.