Hi Marina
There are a few tables around course completions - the users grades for current course completion are stored inhttps://db-schema.totaralearning.com/t12-release/tables/app_course_completion_crit_compl.html and the historic course https://db-schema.totaralearning.com/t12-release/tables/app_course_completion_history.htmlhttps://db-schema.totaralearning.com/t18-release/tables/app_course_completion_history.html . The schema links above show how the tables are related.
Regards