Both approaches are nonsense - neither is good for anything.
This is a typical 1:N (one to many) situation:
Teacher(id, name)<br />
Class(id, teacher_id, name)
Still, let's suppose you stick to this horrible approach. Let
T
be the original table and
T1
,
T2
the two resultant ones.
Simply issue these:
INSERT INTO T1(teacher, cls1, cls2, cls3, cls4, cls5) SELECT teacher, cls1, cls2, cls3, cls4, cls5 FROM T;
INSERT INTO T2(teacher, cls6, cls7, cls8, cls9, cls10) SELECT teacher, cls6, cls7, cls8, cls9, cls10 FROM T;
Of course, you will need to create the
T1
and
T2
tables.