Drupal is one of leading framework for rapid web application development. It has evolved and matured enought to compete with leading web frameworks.
One of the core task in web development is deployment via contiuous integration from dev to staging to production. And performaing database maintenance is a real pain for developers.
For instance, you have a live webapplication and you want to push some database changes to production. Some would approach it by writing sql statements and running those against database. some would clone live database and push updates, which are really dirty and risky ways to maintaining database.
Drupal provide a way to maintain all database maintenance related task through code. which can versioned and deployment via continuous integration without hickups. And you can easily roleback if something is not right.

Enough talk, lets get into real stuff to see how you can acheive this with drupal.
You require following conrtib module in addition to drupal core:

1) Features
“The features module enables the capture and management of features in Drupal. A feature is a collection of Drupal entities which taken together satisfy a certain use-case.”
It also provide a UI to easily manage them.
2) Context
3) ContextUI
4) Context Layout
“Context allows you to manage contextual conditions and reactions for different portions of your site. You can think of each context as representing a “section” of your site. For each context, you can choose the conditions that trigger this context to be active and choose different aspects of Drupal that should react to this active context.

Think of conditions as a set of rules that are checked during page load to see what context is active. Any reactions that are associated with active contexts are then fired.”

database maintenance task can be managed via function hook_update_N. You can read more about hook_update_n here.