There is the following table describing for each ID the results of tests. Under each subject column there is a grade of either teacher 1 or teacher 2 according to the column to the right of it and under the teacher 1 or teacher 2 columns the name of the teacher who brought the grade from the column to the left.
id | Math | teacher 1 | Math | teacher 2 | English | teacher 1 | teacher 2 | teacher 2 |
---|---|---|---|---|---|---|---|---|
123 | 60 | David | 56 | Tad | 85 | Dana | 90 | Judi |
567 | 80 | Charls | 75 | Rubi | 82 | Toni | 100 | Ron |
891 | 70 | Miki | 90 | Lusi | 75 | Ella | 70 | Bob |
I want to transfer the data from the table above to the table according to the following format:
id | subjct | teacher's_name | grade |
---|---|---|---|
123 | Math | David | 60 |
123 | Math | Tad | 56 |
123 | English | Dana | 85 |
123 | English | Judi | 90 |
567 | Math | Charls | 80 |
567 | Math | Rubi | 75 |
567 | English | Toni | 82 |
567 | English | Ron | 100 |