I think you'll find yum install Z does nothing. Try it and see.
In the same way, if you don't have Z installed, yum update Z would do nothing.
Before you say that's silly, think about these forms
yum install (it may need to be yum install *) and
The former will install everything in the repos, the latter just update what you already have installed