Validating Spatial Integrity Constraints through SQL Queries