Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The CTO has formed a data science team to study the prolificness of each publish

ID: 3843716 • Letter: T

Question

The CTO has formed a data science team to study the prolificness of each publisher and has made you the head of that team. As the team's leader, you have been asked to create a SQL view so that the rest of the team can look at the data and draw meaningful conclusions without having to deal with all of its underlying complexity. The view should show the following information: Publisher id. Publisher name. Publisher website. Number of articles the publisher's posters have posted. a) Create the desired view (PublisherView) by writing an appropriate CREATE VIEW statement. CREATE VIEW PublisherView.../* Q6.a*/; b) Show the usefulness of your view by writing a SELECT query against the view that prints the publisher name and website for the most prolific publisher (i.e., the publisher that has published the most articles).

Explanation / Answer

Solution:

1)

CREATE VIEW [Publisher] AS

SELECT PublisherID, PublisherName, PublisherWebsite, COUNT(articleID) AS articles FROM PUBLISHER WHERE 1

The above given query for view will create a view named as publisher which will show id, name, website of the publisher along with the number of articles the publisher poster posted.

b)

SELECT PublisherName, PublisherWebsite FROM Publisher WHERE (SELECT MAX(aricles) FROM Publisher WHERE 1).

The above query will get the most prolific publisher with most numbers of articles posted by the poster.

I hope this helps. Don't forget to give a thumbs up if you like this.