Instruction
Good job! Now, let's look at another example that's a bit more complicated. We have the same table and two views:
CREATE TABLE gym ( id integer PRIMARY KEY, name varchar(32), city varchar(32), monthly_fee decimal(5, 2), max_capacity integer );
CREATE VIEW big_gyms_london AS SELECT id, name, max_capacity FROM gym WHERE city = 'London' AND max_capacity > 50;
CREATE VIEW big_gyms_london_avg AS SELECT AVG(max_capacity) FROM big_gyms_london;
The view big_gyms_london is dependent on the gym table, but the big_gyms_london_avg view is dependent on the big_gyms_london view. What happens if we try to delete the big_gyms_london view?
Exercise
Run the template query, which attempts to delete the big_gyms_london view.
As you can see, the query failed.



