David wrote Psalm 38 through Psalm 47 :)
We are not told of David's location when this Psalm was written.
Book one of the book of Psalms contains 41 psalms.
King David wrote Tihimim/Psalms
The family of Asaph wrote 12 psalms: Psalms 50Psalms 73-83The sons of Korah wrote 11 psalms: Psalms 42Psalms 44-49Psalms 84-85Psalms87-88Heman the Ezrahite coauthored Psalms 88 with the sons of Korah.Solomon wrote two psalms: Psalm 72Psalm 127Moses wrote Psalm 90Ethan the Ezrahite wrote 89
The family of Asaph wrote 12 psalms: Psalms 50Psalms 73-83The sons of Korah wrote 11 psalms: Psalms 42Psalms 44-49Psalms 84-85Psalms87-88Heman the Ezrahite coauthored Psalms 88 with the sons of Korah.Solomon wrote two psalms: Psalm 72Psalm 127Moses wrote Psalm 90Ethan the Ezrahite wrote 89
Asaph wrote 12 Psalms.
david
David
The tradition is that all of the unnamed Psalms were written by King David.
King David wrote Psalms 27.
The book of psalms is made of one book only.
King David wrote most or all of the psalms.