Deleting Objects
Prev | Chapter 2. CommonSQL Tutorial | Next

## Deleting Objects

Now that we know how to create objects in our database, manipulate them and query them (including using our predefined relations to save us the trouble writing alot of SQL) we should learn how to clean up after ourself. It's quite simple really. The function `DELETE-INSTANCE-RECORDS` will remove an object from the database. However, when we remove an object we are responsible for making sure that the database is left in a correct state.

For example, if we remove a company record, we need to either remove all of it's employees or we need to move them to another company. Likewise if we remove an employee, we should make sure to update any other employees who had them as a manager.

Prev | Up | Next
Finding Objects | Home | Conclusion