I am using MySQL version 5.7.31, but just installed a MySQL server version 8 in case its needed
I have a table containing a range of information about an entity, like this:
+------+-----+
| Name | Age |
+------+-----+
| Bob | 22 |
| Jack | 15 |
| Jane | 25 |
+------+-----+
In another table i have the information of which skills belongs to which combination of name and age like this:
+-------------+------+-----+
| Skill | Name | Age |
+-------------+------+-----+
| programming | Bob | 22 |
| programming | Jane | 25 |
| marketing | Jane | 25 |
+-------------+------+-----+
Which makes me able to select all skills for Jane, 25 - returning 2 rows. However i am required to put these into separate columns for each entity in a final view like below and i am struggling to figure out how to do this. The view should continue working when i get additional rows supplied in the tables shown above
+------+-----+-------------+-----------+--------+
| Name | Age | skill1 | skill2 | skill3 |
+------+-----+-------------+-----------+--------+
| Bob | 22 | programming | Na | Na |
| Jack | 15 | Na | Na | Na |
| Jane | 25 | programming | marketing | Na |
+------+-----+-------------+-----------+--------+