The device which is deleted from UIM Hub will still have the data on the database server ,How to delete the unwanted Qos and other data from the database server in bulk
Deleting a machine from IM does not delete the machine from DB. You will need to run a DELETE against cm_computer_system table and that should delete corresponding entries in all cm* tables.
Unforuntately, QoS tables are not dynamic. Please try the SQL scripts attached.