Implementing a star schema with fact and dimension tables