Identifying dependencies that hold in relational databases is essential to produce good databases designs. In particular, functional and multivalued dependencies are used to obtain relation schemes that satisfy the 4th normal form, a property that is considered satisfactory 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. In this paper, we present an algorithm that learns a class that contains sets of both functional and multivalued dependencies under some restrictions imposed on the antecedents of dependencies. We also show, as a by-product, an algorithm that learns a non-trivial subclass of 2-quasi Horn formulas, closely related to the class just mentioned.