Posted - 11/09/2013 : 05:31:14
| I have two tables
table description: each row of the table contains information about a unique pageview made by a user
fields:pageview_timestamp, article_id, visitor_ip_address, visitor_user_id, browser, referrer
table description: each row of the table contains information about a unique comment made
fields:commented_article_id, commenting_user_id, comment_creation_timestamp, comment_text
Visitors read articles that they can comment on, in an ongoing process. Therefore, the number of comments on an article when a pageview occurs will vary, it can be different for the same article being read at different times.
Write an SQL query to tell the average number of comments that are present on an article when apageview of that article on the website occurs.