create or replace view current_movie_showtimes as
  select m.name,
         m.rating_id,
         m.length_minutes,
         ms.*,
         t.name as theatre_name,
         t.zip_code,
         z.latitude,
         z.longitude
  from movie_showtimes ms
  join movies m on (ms.movie_id = m.id)
  join theatres t on (ms.theatre_id = t.id)
  join zip_codes z on (t.zip_code = z.zip)
 where (ms.start_time - now() < '1 week'::interval and ms.start_time > now();
