Pergunta de entrevista da empresa IBM

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