We creating a node module, database operations for insert, update, and delete are handled by the node module. You don't have to do anything. However, coding for the database operations of your custom fields is your problem. To insert, you implement hook_insert(). hook_update() for updates and hook_delete() to delete row(s).
It is common to use the results of one query as input for another. For example, you created a node and you need to store the generated node id in another table. Unfortunately, this operation cannot be performed in the insert, update, and delete hooks since node's own database operations are performed after the hooks have done their work.