Combining Relational Algebra, SQL, Constraint Modelling, and Local Search