SHARE
TWEET

Untitled

a guest Jul 18th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.        s.name,
  3.        COUNT(p.film_id) `films count`,
  4.        COUNT(p.id) `amount count`,
  5.        SUM(p.amount) `sum amount`,
  6.        AVG(p.amount) `avg amount`
  7. FROM films
  8. JOIN studios s ON films.studio_id = s.id
  9. JOIN payments p ON films.studio_id = s.id
  10. WHERE p.actor_id = 1
  11. GROUP BY p.actor_id;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top