IBM has a free DB2 for just this sort of thing – it is called DB2 Express. Check the IBM web site WWW.IBM.COM and search within it for DB2 Express.
Depending on what you want to learn about DB2, this may or may not be what you are after. A product will only go so far as a learning tool – you will also need to do some reading and other research for things like RDBMS theory and practice, normalization, coding techniques, strong points and weak points of the RDBMS and the platform you are running on, good application design, and all sorts of performance topics including the internals of DB2; the RDS, DM, DM, init parms, etc.
Or, I suppose one could just install it and use it. I work with a lot programmers who think DB2 is nothing more than an access method. They treat relational data like it was tape files. I hope you don’t turn into one of them.