How to constrain data
Include the providerid column (and appropriate values) in the UserRating table.
Make (userid, providerid) a unique key for the UserRating table.
Make (id, providerid) a unique key of CreditRating.
Make (ratingid, providerid) a foreign key of UserRating, referencing (id, providerid) in the CreditRating table.


Also, make (providername, typename) a unique key of Provider, if you haven't already. Or better yet, normalize them into separate provider and type tables, with a many-to-many join as appropriate.