Search code examples
mysqlinnodb

what is the problem of "null" values in mysql or other dbs?


As far as I know, null can be indexed in InnoDB. But many colleagues say the null values are bad DB designs. So I don't know what is the problem of "null", is the 3rd value (eq, not eq, not known) problem or something else that stops people use nullable columns?


Solution

  • NULL is an essential piece of SQL. It indicates a value that does not exist.

    Avoiding NULL would lead into situations where you make up arbitary special values for items that does not exist (0, -1, empty strings etc). That would be bad design.