I am extracting data from my Wordpress database to analyse site structure. Works pretty good so far but I would like to include the posts main category in the table to enable further analysis. This is my current query:
SELECT post_name, post_content FROM wp_posts WHERE post_type='post' AND post_status='publish'
How can I enhance this query to include the main category in the result? I am pretty simple when it comes to SQL queries and would love to learn more.