(78) And [mention] David and Solomon, when they judged concerning the field - when the sheep of a people overran it [at night], and We were witness to their judgement. (79) And We gave understanding of the case to Solomon, and to each [of them] We gave judgement and knowledge. And We subjected the mountains to exalt [Us], along with David and [also] the birds. And We were doing [that]. (80) And We taught him the fashioning of coats of armor to protect you from your [enemy in] battle. So will you then be grateful? (81) And to Solomon [We subjected] the wind, blowing forcefully, proceeding by his command toward the land which We had blessed. And We are ever, of all things, Knowing. (82) And of the devils were those who dived for him and did work other than that. And We were of them a guardian.
(15) And We had certainly given to David and Solomon knowledge, and they said, "Praise [is due] to Allah, who has favored us over many of His believing servants.
There were two women with their sons. A wolf came and took the son of one of them. One said to her companion: The wolf only took your son. The other said: It only took your son. So they brought suit before David, and he ruled in favor of the elder. Then they went to Solomon, son of David, and told him. So he said: Bring me a knife so I can split him between them. So , the younger one said: Don’t do it, may Allah have mercy on you. He is her son. So he ruled that the child belonged to the younger.