SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
-- DROP INDEX idx_title ON film; -- Step 1. Explain the query SELECT * FROM film WHERE title = 'ALONE TRIP'; EXPLAIN SELECT * FROM film WHERE title = 'ALONE TRIP'; -- Step 2. Create an index idx_title on the title column CREATE INDEX idx_title ON film(title); -- Step 3. Explain the query of step 1 again EXPLAIN SELECT * FROM film WHERE title = 'ALONE TRIP'; -- Step 4. Explain the query SELECT * FROM film WHERE title > 'ALONE TRIP'; EXPLAIN SELECT * FROM film WHERE title > 'ALONE TRIP'; -- Step 5. Explain the query SELECT rating, count(*) FROM film GROUP BY rating; EXPLAIN SELECT rating, count(*) FROM film GROUP BY rating; -- Step 6. Create an index idx_rating on the rating column CREATE INDEX idx_rating ON film(rating); -- Step 7. Explain the query of step 5 again EXPLAIN SELECT rating, count(*) FROM film GROUP BY rating;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear