When creating a table, just add NOT NULL to the column description, e.g.
CREATE TABLE ( ID INT NOT NULL default '0' );
Then, if no data is specified for the field, it is set to the default value of 0, which will be retrieved when the SELECT query is run.
source share