They are different. When you enclose something in single quotes, it becomes a string -- this is true of all keywords in SQL, including NULL.
When you use just NULL, it is the SQL keyword, and it is compatible with all types.
So, these are quite different:
insert into t (col1, col2)
values ('2021-05-25 11:58:41.000', NULL);
and:
insert into t (col1, col2)
values ('2021-05-25 11:58:41.000', 'NULL');
'NULL' is a string and only compatible with a string type. You should get a type-conversion error if the column is not a string.
The one caveat is if you are storing the values in a text file for loading into the database. In such a file, strings may or may not be delimited with single quotes, depending on the structure of the file.
Answer from Gordon Linoff on Stack OverflowInsert NULL instead of blank if form fields left empty
Insert data into the column which is having null values.
MSSQLServerDatabase ExecuteSQL insert NULL values
how to insert null instead of 0 for integer data type? - Forms - Scriptcase Low-code
Videos
I am trying to insert my form data into mysql table there are two required fields and others can be left empty but the problem is the empty fields are inserting blank in sql table instead of NULL value. How do i do this? Here is pastebin code link