i was wondering if someone could guide me to any references about how moodle interacts with database?
I'm not sure how much information you are looking for.
In outline, it uses and abstraction library call adodb. On top of that there is a Moodle specific database layer providing a large number of regularly used database functions. You will find this in lib/datalib.php and is probably the best place to start looking.
In outline, it uses and abstraction library call adodb. On top of that there is a Moodle specific database layer providing a large number of regularly used database functions. You will find this in lib/datalib.php and is probably the best place to start looking.