Can someone tell me how NULL values represented in a database.I assume that most databases must be using the same representation for NULL values.If not so, can you tell me about atleast one implementation.
I have googled this without much success.
I wouldn’t assume this, since database people put a lot of thought into how to make layouts (and everything else) as efficient as possible. There’s a good chance one of them came to a different opinion to the others.
I know both SQLServer and PostgreSQL use a null bitmap per row. I know it’s optional in PostgreSQL – so skipped entirely if there are no nullable fields, and don’t know if that’s the case with SQLServer.
So, e.g. a ten-column row with the 3rd and 9th fields being null could have a bitmap entry of
0000000100000100=0x0103. Or maybe it’d be the other way around (0010000010000000=0x2080) , I honestly don’t know.I wouldn’t assume it was true of any other database though.