IVM connect to Database

Hi, I just started to use FreePBX and had a question, Can FreePBX do: Client call, enter " a number " on the phone keypad, FreePBX compare “a number” with a MySQL database, and responds by a automatic message depending on the databse result?