I have two MySQL tables describing data that can be extended into subclasses, one that describes the parent class data and another one describing metadata fields as one-to-many relationships.
Example rows from table page:
id | name
-----+-----------------------
123 | Example page
999 | Another page
Example rows from table page_metadata:
page_id | key | value
--------+------------+----------------
123 | picture | test.jpg
123 | video | example.avi
123 | sound | sound.mp3
999 | picture | something.jpg
Question: Is there some way to fetch all this data in this format?
id | name | picture | video | sound
-----+------------------+---------------+-------------+------------------
123 | Example page | test.jpg | example.avi | sound.mp3
999 | Another page | something.jpg | NULL | NULL