Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

The value of NULL in MySQL

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

What is the actual value of NULL stored in the database by MySQL?
The database has to have some way to identify that the field value is NULL, so what value it uses to represent a NULL?
 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are you interested in it? As a developer you don't have to think about it. If you aren't a developer and interested in MySQL go to mysql.
 
Reehan Lalkhanwar
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I want to store non-english language in DB as bit values that my application can understand, I need to know if I have some constraints on if there are some ASCII values I have to avoid.
Moreover I thought it would not hurt to know.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's stored as an internal value. Nothing you can store in a nullable column will make it think it's null/not null.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Null does mean an unknown value. If you try to operate something like: 1 + (unknown), the result is surelly unkown. Likewise true && NULL is also NULL. Don't misundertood it with 0(zero) neither with false because these values values are different.
 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a database questions, not an ORM question.

Each database may implement this in any way they choose, so long as they follow the appropriate SQL specification.
However, it will be via some attribute of the column value, not through the value itself. If a column value is null, it has no value. If you supply a value (any value) for a column, it is no longer null. Don't think of null as a value, think of it more like a state.

Hope this helps,
 
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic