I have the following two tables, a product has many products names:
+----------+
| products |
+----------+
| id | sku |
+----+-----+
| 1 | 123 |
| 2 | 456 |
| 3 | 789 |
+----+-----+
+-------------------------------+
| product_names |
+------------+--------+---------+
| product_id | locale | name |
+------------+--------+---------+
| 1 | en | paper |
| 1 | it | carta |
| 2 | en | rock |
| 2 | it | sasso |
| 3 | en | scissor |
| 3 | it | forbice |
+------------+--------+---------+
What I need, if possible in MySQL, is to create a view that generate a virtual table like this (locales are fixed):
+------------------------------+
| products_with_names |
+----------+---------+---------+
| id | sku | name_en | name_it |
+----+-----+---------+---------+
| 1 | 123 | paper | carta |
| 2 | 456 | rock | sasso |
| 3 | 789 | scissor | forbice |
+----+-----+---------+---------+
Is possible to create this kind of view? Is it a good idea in terms of performance?