SQL Implementation of membership repository