IBM Interview Question

What is CAP theorem? How does it apply to various databases?