title: Combined trigger in SQL
body: <p>I have these tables:</p>
  
  <ul>
  <li>Movie ( mID, title, year, director )</li>
  <li>Reviewer ( rID, name )</li>
  <li>Rating ( rID, mID, stars, ratingDate )   </li>
  </ul>
  
  <p>and some views:</p>
  
  <ul>
  <li><p>View <code>LateRating</code> contains movie ratings after January 20, 2011. The view contains the movie ID, movie title, number of stars, and rating date. </p>
  
  <pre><code>create view LateRating as 
    select distinct R.mID, title, stars, ratingDate 
    from Rating R, Movie M 
    where R.mID = M.mID 
    and ratingDate &gt; '2011-01-20' 
  </code></pre></li>
  <li><p>View <code>HighlyRated</code> contains movies with at least one rating above 3 stars. The view contains the movie ID and movie title. </p>
  
  <pre><code>create view HighlyRated as 
    select mID, title 
    from Movie 
    where mID in (select mID from Rating where stars &gt; 3) 
  </code></pre></li>
  <li><p>View <code>NoRating</code> contains movies with no ratings in the database. The view contains the movie ID and movie title. </p>
  
  <pre><code>create view NoRating as 
    select mID, title 
    from Movie 
    where mID not in (select mID from Rating)  
  </code></pre></li>
  </ul>
  
  <p>Here's my data set : <a href="https://prod-c2g.s3.amazonaws.com/db/Winter2013/files/viewmovie.sql" rel="nofollow">https://prod-c2g.s3.amazonaws.com/db/Winter2013/files/viewmovie.sql</a></p>
  
  <p>I should write a single instead-of trigger that combines triggers to enable simultaneous updates to attributes mID, title, and/or stars in view LateRating.</p>
  
  <p>I can write simple triggers but this looks complex?How can I approach this problem?</p>