What are the differences between databases, data warehouses, and data mining?

What are the differences between databases, data warehouses, and data mining? When would you use one over another?