Test Royalty fee sql statement