The Talmud is a combination of the oral law- Mishnah, and its commentaries, the Gemorrah. It gives the law and case law and discussion of all the possibilities of applying the law, and thus serves the same as law books and case studies in secular law.
In other words- the purpose of the Talmud is to teach us the law, discuss the law and give guidelines for the application of the laws.