Learned this from a friend. The types are null, integer, real, text, and blob. My friend describes them thusly:

  • Null stores nothing, but like, actively nothing, as opposed to the absence of a thing.
  • Integer is a signed integer, up to 8 bytes.
  • Real is always an 8-byte float.
  • Text is an arbitrary-length UTF-8 or UTF-16.
  • Blob is an arbitrary-length anything-else. But I hope you remembered what you put there. Because it sure isn’t gonna tell you. Oh, and it doesn’t have strong typing, so if you ask for it back as an integer, it’ll quite happily give you it back as an integer, especially if that doesn’t make sense!
You are viewing a single thread.
View all comments
4 points
*

“Null” is not a distinct data type. It’s a specific value that a data type can contain.

permalink
report
reply
4 points
*

Ok, but is a Null Integer the same as a Null Text value? I’m really asking, I don’t know.

permalink
report
parent
reply
5 points
*

Conceptually, as in what the null represents at the DB level, yes. Logically, at the software level, I’d say sort of, but not really. It’s complicated. Does it make sense to compare values of fundamentally different types?

permalink
report
parent
reply
3 points

In a system like Java’s where everything derives from a common object class one can say null is a valid value of object type, so any two null values are equivalent. With ANSI nulls, even null isn’t equivalent to null.

permalink
report
parent
reply

Today I learned

!todayilearned@lemmy.ml

Create post

Community stats

  • 145

    Monthly active users

  • 158

    Posts

  • 872

    Comments

Community moderators