I’m pretty new at MySQL and database structure and I was wondering if anyone could help with the best way to design this database. The application is essentially an online exercise book. It will have exercises for students to complete and have the results stored in the database.
A Parent will be able to view their child’s answers, while the Teacher can view their entire class’ results.
I have 3 different types of users, Teachers, Parents and Students. each student is linked to a Parent, and each student is linked to a class. A Teacher is linked to multiple classes.
My current structure for users can be seen here;

Should I create a single Users table and have a UserType field? If so how do I go about linking the student to a class and parent?
I have created a schema for this:-
sqlfiddle here
Also before insertion check if the record exists for user and parent in info table.