Data Analytics

Weekly Question: 13 Feb

Optional: This weeks weekly question is optional but working on it will probably help you prepare for Exam 1.

Come up with a query involving the moviedb where you use the group by or order by command. Explain to other readers on the blog what your command is trying to do and why you need to use a group by or order by command.

A sample response to the weekly question would look like this:

In this command, I seek to order by the length of the movie.

select title,length from moviedb.film order by length;

The command sorts the films in increasing order of their length. The order by statement statement sorts the titles in increasing order of their lengths.

Another command would be as follows:

In this command I seek to count the number of films that belong to different ratings.

select rating,count(*) from moviedb.film group by rating;

The command counts the number of the different films. Due to the group by statement, the count of the movies are grouped by the different ratings categories that exist.

 

8 Responses to Weekly Question: 13 Feb