SELECT Tags.TagName as Region, COUNT(DISTINCT Posts.Id) a...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Lifehacks Meta

Q&A about the site for people looking to bypass life's everyday problems with simple tricks

-- Query 2: Regional Travel Challenges Analysis
-- Helps understand market-specific issues (relevant to Questions 1 and 2)
SELECT 
    Tags.TagName as Region,
    COUNT(DISTINCT Posts.Id) as QuestionCount,
    AVG(Posts.Score) as AvgScore,
    SUM(Posts.ViewCount) as TotalViews,
    COUNT(DISTINCT Answers.Id) as AnswerCount
FROM Posts
LEFT JOIN PostTags ON Posts.Id = PostTags.PostId
LEFT JOIN Tags ON PostTags.TagId = Tags.Id
LEFT JOIN Posts Answers ON Posts.Id = Answers.ParentId
WHERE Tags.TagName IN ('india', 'usa', 'europe', 'asia', 'australia')
    AND Posts.PostTypeId = 1
GROUP BY Tags.TagName
ORDER BY QuestionCount DESC;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results