ChatDB: Augmenting LLMs with Databases as Their Symbolic Memory