
Data types and functions - Assignments
1. Calculate the average number of movies of actors
Complete the following query to determine the average number of movies in which actors appear.
- Use the
SELECTandFROMstatements. - Use the
AVG()function.
2. Find the maximum number of movies an actor appears in
Complete the following query to find the maximum number of movies in which an actor appears.
- Use the
SELECTandFROMstatements. - Use the
MAX()function.
3. Obtain the initial of the first name of actors
Complete the following query to obtain the initial (first letter) of each actor's first name.
- Use the
SELECTandFROMstatements. - Use the
LEFT()function.
4. (Extra) Compose an actor's name
Write a query to obtain in one column the initial, a period, and the last name of the actors.
An example of how a name should look:
L. Abernathy
- Use the
SELECTandFROMstatements. - Use the
CONCAT()function. - Use the
LEFT()function.
5. (Extra) Compose an actor's name, with the number of movies
Write a query to obtain in one column the initial, a period, the last name, and in parentheses the number of movies, of the actors.
An example of how this should look:
L. Abernathy (1)