write the following query for mysql List the actor ID their

write the following query for mysql: .

List the actor ID, their first and last name of all actors and a count of the films they have done. Result set should be sorted ascending by the actor’s last name and new column should be named FilmCount. The objective you are to show here is how to use a subquery in an expression.

Solution

Query:

SELECT ID, firstname, lastname , COUNT(*) As FilmCount FROM MovieTable ORDER BY lastname ASC;

Explanation:

This query displays a table with columns ID, firstname, lastname, FilmCount .

FilmCount will have the count of all the movies done by the specific actor.

write the following query for mysql: . List the actor ID, their first and last name of all actors and a count of the films they have done. Result set should be

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site