It depends on the database engine, as well as the type of column.
At least SQLite stores each empty column as a "null type" that does not accept any additional space (each record is serialized into one memory location for storage, so in this case there is no room for a non-empty value). With these optimizations, NULL has very little storage overhead. (SQLite also has optimizations for values ββ0 and 1 - database developers do not play!) See 2.1 Record format for details.
Now things can get a lot more complicated, especially with updating and potentially fragmenting the index. For example, in SQL Server, space can be reserved for column data depending on the type. For example, int null will still reserve space for an integer (and also somewhere there is a "null" flag), however varchar(100) null does not seem to reserve space (this last bit from memory, so warned!).
Happy coding.
user166390
source share