Insert Null Values in the Columns with the NOT NULL

Can We Insert Null Values in the Columns Other Than Ones with the NOT NULL Constraint? Yes, we can insert null values in the columns other than the columns with not null constraint. Let us see how we can achieve this.

Let’s use the same table created in Example, Now we will insert null values in the other columns.

INSERT INTO w3wiki(gfg_id,name,courses,score,questions_solved)
VALUES(05,'Harsh',NULL,35,25);

Output:

w3wiki table with Null Values

As we can see courses is a simple columns with no constraints, therefore we can enter null values in them.

SQLite NOT NULL Constraint

SQLite is a very lightweight and embedded Relational Database Management System (RDBMS). It requires very minimal configuration and it is self-contained. It is serverless, therefore it is a perfect fit for mobile applications, simple desktop applications, and embedded systems. While it may not be a good fit for large-scale enterprise applications, it can offer simplicity, and portability and can be easy to use. In this article, we are going to cover its NOT NULL Constraint and its different aspects.

Similar Reads

NOT NULL Constraint

SQLite possesses some useful constraints. NOT NULL Constraint is one of its constraints. This constraint ensures that a column or columns do not accept any NULL/Undefined values. In simple words, it makes the applied column accept only Not Null values. This helps in data integrity and prevents the insertion of incomplete information in the table....

Examples of NOT NULL Constraint

Let us discuss some of the implementations of NOT NULL Constraint....

Insert Null Values in the Columns with the NOT NULL

Can We Insert Null Values in the Columns Other Than Ones with the NOT NULL Constraint? Yes, we can insert null values in the columns other than the columns with not null constraint. Let us see how we can achieve this....

Conclusion

NOT NULL constraint in SQLite allows us to make a column in our table to accept only not null values. It helps to maintain data integrity and prevents the insertion of in complete data in our table. We can apply NOT NULL Constraint in one or more than one column in our table. This constraint enforces that the desired column to accept not null values however other columns can accept null values....