Villager trading in Minecraft: professions, workstations, best trades
A novice farmer pays 1 emerald for 22 Carrots, 26 Potatoes, 20 wheat or 15 Beetroots; later for 6 Pumpkins or 4 Melons.

A Melon is a green fruit block that grows from a melon stem and wild in jungles.
It is made with the Crafting Table from 9 × Melon Slice. It is mined with an axe and drops Melon Slice. It can be composted: each one has a 65% chance to add a layer to a Composter.
Breaking it gives three to seven Melon Slices, more with Fortune, or the block itself with Silk Touch; nine slices craft it back. It is one of the easiest automatic farms: an observer and a piston can harvest the block as soon as it appears.
9 × Melon Slice → Melon
// Slots with several items cycle through every accepted option.
A novice farmer pays 1 emerald for 22 Carrots, 26 Potatoes, 20 wheat or 15 Beetroots; later for 6 Pumpkins or 4 Melons.
At the Crafting Table: 9 × Melon Slice give 1 × Melon. Mined with Silk Touch, the block drops itself; without it, it drops Melon Slice. Bought by Villager: Farmer (Journeyman).
It is a fruit block that breaks into melon slices.
The fastest tool is the axe.
Yes. Each Melon put in a Composter has a 65% chance to add a layer (the first layer in an empty Composter always works). After 7 layers the Composter gives Bone Meal.
No: when a piston pushes it, it breaks and drops as an item.