MP3JOSS

MySQL: ROLLUP

MySQL: ROLLUP

Choose Download Format

Download MP3 Download MP4

Details

TitleMySQL: ROLLUP
AuthorBro Code
Duration3:50
File FormatMP3 / MP4
Original URL https://youtube.com/watch?v=6FwQBS3jV_I
🎵 Support the artists — buy the original for the best audio quality! 🎵

Description

#MySQL #tutorial #course

-- ROLLUP, extension of the GROUP BY clause
-- produces another row and shows the grand-total (super-aggregate) value

SELECT SUM(amount) AS "daily_sales", order_date
FROM transactions
GROUP BY order_date WITH ROLLUP;

SELECT COUNT(transaction_id) AS "# of orders", order_date
FROM transactions
GROUP BY order_date WITH ROLLUP;

SELECT COUNT(transaction_id) AS "# of orders", customer_id
FROM transactions
GROUP BY customer_id WITH ROLLUP;

SELECT SUM(hourly_pay) AS "hourly_pay", employee_id
FROM employees
GROUP BY employee_id WITH ROLLUP;

🎧 Just For You

🎵 Bundy Vision - Media Puzzle 🎵 Midnight Sun - Zara Larsson 🎵 Whim Whamiee - Pluto & Ykniece 🎵 Get Lucky - Daft Punk Feat. Pharrell… 🎵 Gangnam Style - Psy 🎵 Blinding Lights - The Weeknd 🎵 Someone Like You - Adele 🎵 Wake Me Up - Avicii 🎵 The Door - Teddy Swims 🎵 Abracadabra - Lady Gaga 🎵 Deck The Halls - Nat King Cole 🎵 Bad Dreams - Teddy Swims