For example, you can add the following code to the addon.xml file
<functions>
<item for="install">fn_my_addon_install</item>
<item for="uninstall">fn_my_addon_uninstall</item>
</functions>
Then just create corresponding functions in the func.php file where corresponding requests to database can be done
Alternative way - to specify SQL requests in the addon.xml file directly
<queries>
<item for="install">UPDATE ?:payment_processors SET processor_script = 'aaa.php' WHERE processor_script = 'bbb.php';</item>
<item for="uninstall">UPDATE ?:payment_processors SET processor_script = 'bbb.php' WHERE processor_script = 'aaa.php';</item>
</queries>