you forgot to add the " . TABLE_PREFIX . " in the xml for those of us that use prefix's like myself
Edit: also in the uninstall code to remove the usergroup database info your plugin added you put DELETE instead of DROP..
Edit2: well it looks like in the affiliateadmin.php you put a ton of spaces after the table prefix codes all over the place which cause many errors...