Well, the question is practically self-explanatory, but still, I will elaborate. The Borg queen says in Voyager, that she herself came from species 125, which means, she must not have been the first, or she would have called her species as species 1 (or even species 0) assuming of course, that the numbering is done based on the sequential encounters rather than, well, probably the "degree" of usefulness of the species (or even the degree of worthiness, if there is even such a thing). So, my question is, is my assumption of the Borg providing sequential numbering based on the sequence in which the species are encountered correct?
Many computer databases use simple IDs which are typically string versions of numbers, which act as unique values to identify that entity. Most time they're assigned automatically when the system creates a new entry in a given table. It's possible the Borg have some database with a root table containing all the species most important data - things like their name, the stardate first encountered, the star system first encountered (a field referencing another table by the ID of the record for the star system in question). Then they'd have other database tables with other kinds of information that links back to IDs of these species, for various purposes - a table that stores DNA samples, a table that stores holographic representation and/or images/videos, tables that have technological data they've assimilated, etc.
So the Borg encounter some ship they've never seen. They scan it, board it, interface with it, possibly take a biological sample and/or a sample of the ship itself (EG in "Q, Who?"). Once they can't find any records for the samples in question, they create new species entries which are then given the ID based on the next available sequential value in that table, and the same for the samples they take. Usually there's some sort of processing queue or table locking in place to ensure that competing entries aren't given the same ID - this is done day-to-day in even our own computer systems.