Who wrote the book of Psalms?
The Psalms have many authors. David is credited with roughly half, but others include Asaph, the sons of Korah, Solomon, and Moses.
The book of Psalms is a collection written over centuries, not by one person. The superscriptions attribute many psalms to David, one (Psalm 90) to Moses, several to Asaph and the sons of Korah, and some to Solomon. A number of psalms are anonymous.
So while David is the most prominent contributor, calling him the sole author would be inaccurate.
Scripture references
Psalm 90:1