Re: Untitled

From Светлана Шаронова, 2 Months ago, written in SQL, viewed 137 times. This paste is a reply to Untitled from Светлана Шаронова - view diff
URL http://codebin.org/view/addb13ca Embed
Download Paste or View Raw
  1. SELECT  c.name AS name_category,
  2.         COUNT(m.film_id) AS total_films
  3. FROM movie AS m
  4. LEFT JOIN film_actor AS fa ON m.film_id = fa.film_id
  5. LEFT JOIN actor AS a ON fa.actor_id = a.actor_id
  6. LEFT JOIN film_category AS fc ON fc.film_id = m.film_id
  7. LEFT JOIN category AS c ON fc.category_id = c.category_id
  8. WHERE fa.actor_id IN
  9. (
  10.     SELECT fa.actor_id
  11.     FROM film_actor AS fa
  12.     LEFT JOIN movie AS m ON fa.film_id = m.film_id
  13.     WHERE m.release_year>2013
  14.     GROUP BY fa.actor_id
  15.     HAVING COUNT(fa.film_id)>7
  16. )
  17. GROUP BY name_category
  18. ORDER BY total_films DESC, name_category

Replies to Re: Untitled rss

Title Name Language When
Re: Re: Untitled Commodious Monkey sql 2 Months ago.

Reply to "Re: Untitled"

Here you can reply to the paste above