Data dependencies are a useful tool to design relational databases. In particular, functional and multivalued dependencies are used to obtain relation schemes that satisfy the 4th normal form, a property that is considered good enough for most applications. It is known that the class of sets of functional dependencies is learnable in the exact model of learning with queries. Also a subclass of multivalued dependencies, the class of consequent-restricted multivalued dependencies has been shown to be learnable in this model. Here, we present an algorithm that learns a generalization of both classes. We also show an algorithm that learns a non-trivial subclass of 2-quasi Horn formulas, closely related to the classes mentioned above.