On screen all we know is that Pike only commanded the Enterprise
To be a bit anal-retentive, onscreen facts don't include Pike "only" commanding that ship - merely him commanding that ship.
He did command the Enterprise
just before Kirk did, so there'd be fairly little time for him to have another ship before he goes teaching cadets and gets crippled; and he did seem a bit wet behind the ears in "The Cage" where he already had the Enterprise
. But there's still plenty of time for him to do other things with Spock (things possibly involving Spock's established historical colleagues Leila Kalomi and Gary Mitchell), and onscreen indication that he did do other things besides commanding starships (namely, participating in those cadet cruises).
Since Pike's dramatic role in "The Menagerie" is to be another Kirk, a scary example of what could have happened to our main hero, we could well speculate that he also started very young, his possible first command was similarly insignificant, and that he then stayed for years or decades with a legendary ship, being ultimately promoted out of that command and into a junior Admiral post because he was a public hero figure. But Pike's story could have been different, too.