Exercise 5 for Intro to Database Management Systems