SQL statements for managing RCAC rules