Hi,
I’m wondering what’s the best solution for such a task. “Column” or “row” oriented approach? I’m not sure whether “row” approach fulfill 1N criteria but seems is more flexible (not fixed number of columns, here ‘element’) however, not necessarily easy to construct (many UNIONs, I guess). Here the example what I’ve managed to get - “row”. I use the “column” approach term for database structure as in the course, so ‘title’, ‘excerpt’, ‘author’, ‘language’, etc are column names.
SELECT pc.core_id, e.element, pc.content, a.author, l.language
FROM post_core as pr
INNER JOIN post_content as pc ON pr.core_id = pc.core_id
INNER JOIN author AS a ON pr.author_id = a.author_id
INNER JOIN element as e ON pc.element_id = e.element_id
INNER JOIN language as l USING(language_id)
WHERE l.language = "jp" AND a.author = "Marta";