Views

The article describes the views in the Sakila sample database.

There are 7 views defined in the Sakila database. The following describes each views.

  1. actor_info

    The actor_info view provides a list of all actors, including the films they performed, broken down by category.

    The actor_info view incorporates data from the film, actor, category, film_actor and film_category tables.

  2. customer_list

    The customer_list view provides a list of customers, concatenates the customer’s first name and last name, and merges the address information into one view.

    The customer_list view incorporates data from the customer, address, city and country the tables.

  3. film_list

    The film_list view contains a formatted view of the film table, with a list of actors in each film separated by commas.

    The film_list view incorporates data from the film, category, film_category, actorand film_actor tables.

  4. nicer_but_slower_film_list

    The nicer_but_slower_film_list view contains the film formatted view of the table, with a list of actors in each film separated by commas.

    The nicer_but_slower_film_list view differs from the film_list view in the list of actors. The lettercase of the actor names is adjusted so that the first letter of each name is capitalized, rather than having the name in all-caps.

    As its name implies, the nicer_but_slower_film_list view perform additional processing, and therefore takes longer to return data than the film_list view.

    The nicer_but_slower_film_list view incorporates data from the film, category, film_category, actor and film_actor tables.

  5. sales_by_film_category

    The sales_by_film_category view provides a list of aggregate sales for a single film category.

    Because a film can be included in multiple categories, it is not recommended to add up the rows of this view to calculate total sales.

    The sales_by_film_category view incorporates data from the category, payment, rental, inventory, film, film_category and category tables.

  6. sales_by_store

    The sales_by_store view provides a list of total sales broken down by store.

    The sales_by_store view returns the store location, manager name, and total sales.

    The sales_by_store view incorporates data from the city, country, payment, rental, inventory, store, address and staff tables.

  7. staff_list

    The staff_list view provides a list of all employees, including address and store information.

    The staff_list view incorporates data from the staff and address table.