Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL SQL management 2009-2014 The following query is executing very slowly on a large amount of data. Would an Index help to speed it up?

SQL

SQL management 2009-2014

The following query is executing very slowly on a large amount of data.

Would an Index help to speed it up? If so, which columns should be indexed? Explain why an index can help but doesn't always.

SELECT c.cinema_name, s.price*SUM(t.ticket_id) AS 'total' FROM Cinema c INNER JOIN MovieSession s ON c.cinema_id = s.cinema_id INNER JOIN Ticket t ON t.ticket_id = s.ticket_id GROUP BY s.price, c.cinema_name HAVING SUM(t.ticket_id) > 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

8. Identify challenges of intercultural marriages.

Answered: 1 week ago