A database is a defined space stored in the system, grouping user objects. This space can be split into several files organized in groups.
In SQL Server you have a limit of 32,767 databases per instance and each database can store more than 2 billion objects, reaching a physical size up to 524,272 terabytes!!!
In this post, I will explain a little more deeply the physical structure of a SQL Server data file. Unfortunately, I cannot write all the assumptions, behaviours and details about this theme, but you will read a good overview of a file structure and a good start point to understand, and read more, about indexes internals, file fragmentation, transaction log internals and so on…
Continue reading here.