Thank you for valuable advice! Now I see that this can solve my problem.
I would like to ask for one more. On my site courses on disciplines (such as History, Mathematics and so on) are metacourses. For each real academic group of students I created separate course (not metacourse) and real students are assigned into that courses. Then courses for academic groups of students are assigned as child courses to each of the discipline courses. I found that when I create group inside a course then that group is also created inside the metacourse. But when I remove group course from metacourse the empty group in metacourse still exists and contains zero students. I`m using Moodle 1.9.5. Is it normal or is there any fix for this?