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:

Copyinsert into t (col1, col2)
    values ('2021-05-25 11:58:41.000', NULL);

and:

Copyinsert 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 Overflow
🌐
w3resource
w3resource.com › sql › insert-statement › insert-null.php
Sql inserting NULL values - w3resource
2 weeks ago - -- INSERT INTO statement begins INSERT INTO agents -- Specifies the table 'agents' where the data will be inserted VALUES ("A001","Jodi","London",.12,NULL); -- Specifies the values to be inserted into each column of the table: -- "A001" will be inserted into the 'agent_code' column (assuming it's a string data type) -- "Jodi" will be inserted into the 'agent_name' column -- "London" will be inserted into the 'working_area' column -- .12 will be inserted into the 'commission' column (assuming it's a numeric data type) -- NULL will be inserted into the 'salary' column, assuming it allows NULL values ... This SQL code attempts to perform an INSERT operation into the 'agents' table.
Discussions

sql server 2012 - How can i insert data into a NULL record in a column that allows NOT NULLS? - Database Administrators Stack Exchange
I hope my questions makes sense but what i am trying to do (which in my mind is obscenely simple which makes it more frustrating that i cant figure it out) is to change a column that consists of NU... More on dba.stackexchange.com
🌐 dba.stackexchange.com
November 7, 2016
Inserting Null Values into SQL Server
Hi all, I’m trying to insert and update rows in a SQL Server database with NULL values. The issue that I’m having is that I continuously receive an error message with no additional information. I have ensured that the table allows for NULL values in those columns and I have tried using ... More on community.n8n.io
🌐 community.n8n.io
1
0
October 9, 2023
Insert NULL instead of blank if form fields left empty
Use prepared statements. More on reddit.com
🌐 r/PHPhelp
21
3
July 14, 2021
Insert data into the column which is having null values.
Hi, I have a column called "Classification_CD" .This column is having NULL values.I want to insert the data into this column. I tried to write the query as follows. But it is showing the me... More on forums.oracle.com
🌐 forums.oracle.com
February 16, 2011
🌐
GeeksforGeeks
geeksforgeeks.org › sql › how-to-insert-rows-with-null-values-in-sql
How to Insert Rows with NULL Values in SQL? - GeeksforGeeks
July 23, 2025 - Step 6: Display all the rows of the WORKER table including the 0(zero) values. ... Thus, in this way, we can insert NULL values into a table.
🌐
Microsoft Learn
learn.microsoft.com › en-us › sql › t-sql › language-elements › null-and-unknown-transact-sql
NULL and UNKNOWN (Transact-SQL) - SQL Server | Microsoft Learn
To test for null values in a query, use IS NULL or IS NOT NULL in the WHERE clause. You can insert null values into a column by explicitly stating NULL in an INSERT or UPDATE statement, or by leaving a column out of an INSERT statement.
🌐
Quora
quora.com › How-do-you-add-null-values-in-SQL
How to add null values in SQL - Quora
Answer (1 of 3): NULL values are handled differently depending on whether they are in the context of a tuple or a set. In the case of a tuple: (e.g. 1 + NULL), the result is always NULL. This is because if any part of a tuple is missing or unknown then the entire tuple cannot be known and hence m...
🌐
W3Schools
w3schools.com › sql › sql_isnull.asp
W3Schools.com
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST · SQL HOME SQL Intro SQL Syntax SQL Select SQL Select Distinct SQL Where SQL Order By SQL And SQL Or SQL Not SQL Insert Into SQL Null Values SQL Update SQL Delete SQL Select Top SQL Aggregate Functions SQL Min() SQL Max() SQL Count() SQL Sum() SQL Avg() SQL Like SQL Wildcards SQL In SQL Between SQL Aliases SQL Joins SQL Inner Join SQL Left Join SQL Right Join SQL Full Join SQL Self Join SQL Union SQL Union All SQL Group By SQL Having SQL Exists SQL Any SQL All SQL Select Into SQL Insert Into Select SQL Case SQL Null Functions SQL Stored Procedures SQL Comments SQL Operators
Find elsewhere
🌐
Iamtimcorey
blog.iamtimcorey.com › im-getting-a-cannot-insert-the-value-null-into-column-id-message-in-sql
I’m Getting a Cannot Insert the Value NULL Into Column ‘ID’ Message in SQL – IAmTimCorey Blog
You look at your SQL statement first, to see if that is the issue. Here is what mine looks like: Pretty simple, right? Now if you look at the table, you see the following: OK, so there is the Id column that it says is the problem but it is the primary key and an int. Doesn’t that mean it will automatically count up as we insert records? Hint: nope. Now that we know the issue, let’s discuss the options. Your first instinct might be to try to insert an Id in the Id column manually.
🌐
Tutorialspoint
tutorialspoint.com › home › sql › sql null values
Understanding SQL NULL Values
November 29, 2009 - Here, NOT NULL signifies that column should always accept an explicit value of the given data type. You can insert NULL values into the columns where we did not use NOT NULL. Let us create a table with the name CUSTOMERS in the SQL database using the CREATE statement as shown in the query below −
🌐
Reddit
reddit.com › r/phphelp › insert null instead of blank if form fields left empty
r/PHPhelp on Reddit: Insert NULL instead of blank if form fields left empty
July 14, 2021 -

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

🌐
W3Schools
w3schools.com › sql › sql_insert.asp
SQL INSERT INTO Statement
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST · SQL HOME SQL Intro SQL Syntax SQL Select SQL Select Distinct SQL Where SQL Order By SQL And SQL Or SQL Not SQL Insert Into SQL Null Values SQL Update SQL Delete SQL Select Top SQL Aggregate Functions SQL Min() SQL Max() SQL Count() SQL Sum() SQL Avg() SQL Like SQL Wildcards SQL In SQL Between SQL Aliases SQL Joins SQL Inner Join SQL Left Join SQL Right Join SQL Full Join SQL Self Join SQL Union SQL Union All SQL Group By SQL Having SQL Exists SQL Any SQL All SQL Select Into SQL Insert Into Select SQL Case SQL Null Functions SQL Stored Procedures SQL Comments SQL Operators
🌐
SQL Shack
sqlshack.com › working-with-sql-null-values
Working with SQL NULL values
May 19, 2021 - This article will explain what problems can occur when working with SQL NULL values ​​and it also gives some solution recommendations to overcome these issues. In terms of the relational database model, a NULL value indicates an unknown value. If we widen this theoretical explanation, the ...
🌐
Oracle
forums.oracle.com › ords › apexds › post › insert-data-into-the-column-which-is-having-null-values-2452
Insert data into the column which is having null values.
February 16, 2011 - Hi, I have a column called "Classification_CD" .This column is having NULL values.I want to insert the data into this column. I tried to write the query as follows. But it is showing the me...
🌐
Rocket Software
docs.rocketsoftware.com › bundle › unidatausingsql_ug_824 › page › tbe1685022307385.html
Inserting empty strings and the null value
Skip to main contentSkip to search · Powered by Zoomin Software. For more details please contactZoomin · Log in to get a better experience · Login · Rocket Software · 77 4th Avenue Waltham, MA 02451 USA · Products · About · Contact · Resources
🌐
Xojo Programming Forum
forum.xojo.com › targets › web
MSSQLServerDatabase ExecuteSQL insert NULL values - Web - Xojo Programming Forum
August 15, 2022 - When inserting a record into an MS SQL Server database, I check if the controls contain any data or not. If not, I would like to insert NULL values into the related columns in the database. For example, if WebTextField = “”, then insert NULL literal into the database.
🌐
Scriptcase
forum.scriptcase.net › applications › forms
how to insert null instead of 0 for integer data type? - Forms - Scriptcase Low-code
September 3, 2014 - Hi all, Im using scriptcase v8 and oracle as database. When creating a form, i will have items withe integer data type via front end (number in oracle back end). but there are occasions where i don’t need this field to be filled yet. i would just like to submit the form and make the field null.
🌐
Tech Nexus
tdev.umb.edu › view › post › sql-how-to-insert-a-null-value
sql how to insert a null value
September 5, 2024 - This article will guide you through the steps and methods of inserting null values into your database tables. A null value in SQL represents the absence of a value or a placeholder where no data exists. It is important to differentiate between a null value and an empty string ('') or a number like 0.
🌐
Scaler
scaler.com › home › topics › sql › null value in sql
NULL Value in SQL - Scaler Topics
March 28, 2024 - NULL can be inserted in any column by using the assignment operator "=". Also, to test whether a NULL is present or not we have to use certain operators, for example, IS NULL and IS NOT NULL.
🌐
GeeksforGeeks
geeksforgeeks.org › sql › how-to-set-a-column-value-to-null-in-sql
How to Set a Column Value to Null in SQL? - GeeksforGeeks
NULL: It represents the NULL value in SQL. WHERE: This statement has an optional part that specifies which rows should be updated. column_name: The name of the column you want to update should be replaced here. Firstly, let's create a table using the CREATE TABLE command: -- create a table CREATE TABLE students (Sr_No integer,Name varchar(20), Gender varchar(2)); -- insert some values INSERT INTO students VALUES (1, 'Nikita', 'F'); INSERT INTO students VALUES (2, 'Akshit', 'M'); INSERT INTO students VALUES (3, 'Ritesh', 'F'); INSERT INTO students VALUES (4, 'Himani', 'F'); -- fetch some values SELECT * FROM students ;
Published   July 23, 2025