The "DB" is pretty dumb, it doesn't really concern itself with this. It's up to the interpreter of the data (map renderers, GIS software etc.) to understand that it is a single road, split into several segments.

You could of course use a relation to mark all these segments as belonging to a single road, but that is usually an overkill for common features like roads.

As pointed out by Breki, the DB itself does not care, because it will not interpret the data.

However, the general consensus is that yes, if a single street needs to consist of several ways (e.g. because parts are tagged differently), then that is no problem. As a matter of fact, many, many longer streets in the OSM database have more than one way. Software using OSM will generally understand that it's really just one street, as long as you make sure that you

tag all ways with exactly the same name (pay attention to spelling, expand abbreviations)

ways making up the street are connected to each other

Most OSM editors will help you with this, by providing a way to copy all tags from one point/way to another, and by making it easy to connect ways.