如何为数据库中的空字段存储空值(NA)?

I have a website which has a lot of different fields. Some of the fields are optional while some are mandatory. i want to store (NA) in DB for empty values. is this possible?

You can set default value as NA for the respected columns. So when the value not comes then default will be used.

Default the values that are null. ie Age defaults to 0

Set the default value as Null for the respective field. Try using PHPMyAdmin or any MySQL tool to do the same or write SQL Query

I would save the empty value as NULL, and handle it from the javascript.

NULL=empty so it is essentially what you need.

NA=not applicable which is conceptually something different.

Unless your columns are of character type, so the value NA could be the default one, but from a semantic perspective it wouldn't mean anything..

I hope this helps.