1. Learn
  2. /
  3. Projects
  4. /
  5. Applying SQL to Real-World Problems

Connected

Exercise

Make this query easier to read - Part II

In this exercise you will work on making the query below easier to read.

select 
  category as FILMCATEGORY, 
  avg(length) as AverageLength
from film as f
inner join category as c
  on f.film_id = c.film_id
where release_year >= 2005
  and release_year <= 2010
group by category;

Instructions 1/4

undefined XP
    1
    2
    3
    4

Question

Which of these strategies should you employ to improve the readability of this query?

  • (1) Capitalize SQL commands.
  • (2) Use new lines & indentation.
  • (3) Use snake_case.
  • (4) Use IN instead of many OR statements.
  • (5) Use BETWEEN when possible.

Possible answers