Are there any consequences for using default values, such as empty rows, when inserting rows into the database. The problem is with the use of zeros, which they must check when using data in the application, while the default value can be processed much easier.
The NULL value in the database must be reserved for "unknown" that does not match the empty one. Therefore, as long as the default values you use reflect the nature of the underlying data (that is, they are not "unknown"), I would recommend using the default values.
. . -, :)
. null - , . , . , , . , " ". varchar, , , ( , , , , .) null , , , , , , . . :
select count(myfield), myfield2 from mytable group by myfield2
, , .
, , , .
, . . 0, - NULL. NULL , , 0 , - - .
NULL , FK.
, , , SQL- , , , , .
. . , , ..
NULL ('') , COLUMN NULL COLUMN = ''. COLUMN = NULL , COLUMN NULL, NULL NULL, , IS NULL-.
, NULL , , NULL, NULL. NULL , , .
- , . , NULL . , , , .
, .
, ,
Source: https://habr.com/ru/post/1702162/More articles:Command to provide a list of JREs installed on the system - javaASP.NET Controls and General Elements - genericsAm I the discoverer of a bug in the WPF engine? - wpfВозврат объекта JSON из PageMethod с пользовательским форматированием - jsonDoes Perl use a monkey patch to view patches? - scopeThe standard queue of the template library of the C ++ standard library throws an exception with the message "Invalid heap" - c ++LINQ to SQL Query Query - sqlDownload the context / servlet when starting in Tomcat * WITHOUT * changing the deployment descriptor (web.xml) - tomcatКак оценить производительность Ethernet? - performanceModel view controller - language-agnosticAll Articles