David had a son named Solomon (Sulaiman), who was intelligent and wise from childhood. When the following story took place, Solomon was eleven years old.
One day, David was sitting, as usual, solving the problems of his people when two men, one of whom had a field, came to him. The owner of the field said: "0 dear Prophet! This man's sheep came to my field at night and ate up the grapes and I have come to ask for compensation." David asked the owner of the sheep: "Is this true?" He said: 'Yes, sir." David said: "I have decided that you give him your sheep in exchange for the field." Solomon, to whom Allah had given wisdom in addition to what he had inherited from his father, spoke up: "I have another opinion. The owner of the sheep should take the field to cultivate until the grapes grow, while the other man should take the sheep and make use of their wool and milk until his field is repaired. If the grapes grow, and the field returns to its former state, then the field owner should take his field and give back the sheep to their owner."
David responded: "This is a sound judgment. Praise be to Allah for gifting you with wisdom. You are truly Solomon the Wise."