Name of 4 Vedas are:
- Rig Veda
- Yajur Veda
- Sama Veda
- Atharva Veda
As per the Mahabharata Vedas were divided into 4 categories by Krishna Dvaipayana commonly known as Vyasa. Majorly he is credited for the re-organization of the Vedas for the ease of the common understanding. The exact date of origin of Vedas cannot be traced as it was passed orally since ancient times. The common time period assigned for its written form is 1500–1000 BCE.
Rig Veda is the first kind of Veda that provides the hymns in the praise of Indic Deities. However, each of the hymns is written in the Vedic Meters called Chhandas which appears as some form of code. The meaning of the hymn as a praise for the Deities changes when the hymns are broken as per the metaphysics of the code. For example, the hymns for the Indra become the hymns for the senses in the coded language. Agni becomes digestive fire, and Vayu becomes your breath.
All these relations are explained in the philosophical texts of Upanishads. One of the Rig Vedic Upanishad is Aitareya Upanishad. However, there can be various other interpretations of the same hymn. For example, in a general way, Indra is said to be the king of the Devtas but in the human body, Indra is the sense organs. There is a direct metaphysical relation between the Indra of the body and Indra of the Dhyu Loka (Conscious Plane).
Yajur Veda is the 2nd in the 4 Vedas. The meaning of the word Yajur is sacred offering or sacrifice. It is mostly done in the fire. Yajur Veda also contains many Upanishads. However, Yajur Veda is for the Rituals related to the sacrificial offerings. This is just like, to achieve something you have to sacrifice something based on the holy law of Karma. Yajur Veda is a guide of Karma.
Sama Veda is the 3rd in the 4 Vedas. It is derived from the word Saman meaning mystical melody. This Veda is used for invoking the mystical Deities within the body through Natural Rythm. Maximum hymns of the Sama Veda are from the Rig Veda only but having defined rules to sing. Everything in the world including both living and nonliving things has some form of melody.
Atharva Veda is the final in the 4 Vedas. It is the most mystical in the Vedas. Atharva Veda contains different hymns for various purposes from medical treatment to metaphysics.