enrolments and role assignments are completely separate (you can have a role in a course without being enrolled in it). In normal use, this distiction is transparent. But it's the role_assignment table you want. You also need to understand Moodle's contexts. This is where the fun starts.
General help
Help with querying the Moodle database: getting user role in each course
Ši diskusija buvo užrakinta, todėl jūs negalite pateikti atsakymus joje.