Here you go.
I took the liberty to modernise the query to use sys.dm_exec_sessions rather than the old sysprocesses. sysprocesses will give you inflated values when there is parallel processing going on. I also added a filter to remove system processes.
SELECT DB_NAME(database_id) as DatabaseName,
COUNT(*) as NumberOfConnections,
SUM(COUNT(*)) OVER (ORDER BY COUNT(*) DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
FROM sys.dm_exec_sessions
WHERE is_user_process = 1
GROUP BY DB_NAME(database_id)
ORDER BY NumberOfConnections DESC