SELECT Tags.TagName, COUNT(*) as PostCount, AVG(CAST(Post...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Open Data

Q&A for developers and researchers interested in open data

SELECT 
    Tags.TagName,
    COUNT(*) as PostCount,
    AVG(CAST(Posts.Score as FLOAT)) as AvgScore,
    SUM(Posts.ViewCount) as TotalViews,
    'https://travel.stackexchange.com/questions/' + CAST(Posts.Id as VARCHAR) as SampleQuestionURL
FROM Posts
LEFT JOIN PostTags ON Posts.Id = PostTags.PostId
LEFT JOIN Tags ON PostTags.TagId = Tags.Id
WHERE Tags.TagName IN ('booking', 'online-booking', 'cancellation', 'customer-service', 'expedia')
    AND Posts.PostTypeId = 1  -- Questions only
GROUP BY Tags.TagName, Posts.Id
ORDER BY PostCount DESC;

Enter Parameters

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