Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql> select category.name, count(rental_id) from category join film_category on (category.category_id = film_category.category_id) join film on (film_category.film_id = film.film_id) join inventory on (film.film_id = inventory.film_id) join rental on (inventory.inventory_id = rental.inventory_id) group by category.name ;
- +-------------+------------------+
- | name | count(rental_id) |
- +-------------+------------------+
- | Action | 1112 |
- | Animation | 1166 |
- | Children | 945 |
- | Classics | 939 |
- | Comedy | 941 |
- | Documentary | 1050 |
- | Drama | 1060 |
- | Family | 1096 |
- | Foreign | 1033 |
- | Games | 969 |
- | Horror | 846 |
- | Music | 830 |
- | New | 940 |
- | Sci-Fi | 1101 |
- | Sports | 1179 |
- | Travel | 837 |
- +-------------+------------------+
- 16 rows in set (1.49 sec)
- mysql> set ndb_join_pushdown = 1;
- Query OK, 0 rows affected (0.00 sec)
- mysql> select category.name, count(rental_id) from category join film_category on (category.category_id = film_category.category_id) join film on (film_category.film_id = film.film_id) join inventory on (film.film_id = inventory.film_id) join rental on (inventory.inventory_id = rental.inventory_id) group by category.name ;
- +-------------+------------------+
- | name | count(rental_id) |
- +-------------+------------------+
- | Action | 1112 |
- | Animation | 1166 |
- | Children | 945 |
- | Classics | 939 |
- | Comedy | 941 |
- | Documentary | 1050 |
- | Drama | 1060 |
- | Family | 1096 |
- | Foreign | 1033 |
- | Games | 969 |
- | Horror | 846 |
- | Music | 830 |
- | New | 940 |
- | Sci-Fi | 1101 |
- | Sports | 1179 |
- | Travel | 837 |
- +-------------+------------------+
- 16 rows in set (0.42 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement