An analysis of SQL integrity constraints from an entity-relationship model perspective