Skip to content

Instantly share code, notes, and snippets.

@uncoded-ro
Last active February 10, 2020 06:13
Show Gist options
  • Save uncoded-ro/c1078ca92d7975cfc4a9664b96c0da50 to your computer and use it in GitHub Desktop.
Save uncoded-ro/c1078ca92d7975cfc4a9664b96c0da50 to your computer and use it in GitHub Desktop.
CREATE
OR REPLACE
DEFINER = airman@'localhost'
SQL SECURITY DEFINER
VIEW sakila.view_films_catagory AS
SELECT c.name, COUNT(f.film_id) AS no_films
FROM sakila.category c LEFT OUTER JOIN sakila.film_category USING(category_id)
LEFT OUTER JOIN sakila.film f USING(film_id)
GROUP BY c.category_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment