Using Moodle create users and enroll them in courses via SQL
<p>I need to create an external application that creates, modifies and enrol users of Moodle.</p>

<p>I've been reading Moodle documentation but its more for front administrators that for developers. How can I do to create a user? which tables hold obligatory information about them? and how do I enrol existing users to Moodle?</p>