Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Sshashank0743 authored Sep 26, 2022
1 parent df4e1b4 commit 81f8220
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions NULL/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## NULL Values

As promised in the last lesson, we are going to quickly talk about NULL values in an SQL database. It's always good to reduce the possibility of NULL values in databases because they require special attention when constructing queries, constraints (certain functions behave differently with null values) and when processing the results.

An alternative to NULL values in your database is to have data-type appropriate default values, like 0 for numerical data, empty strings for text data, etc. But if your database needs to store incomplete data, then NULL values can be appropriate if the default values will skew later analysis (for example, when taking averages of numerical data).

Sometimes, it's also not possible to avoid NULL values, as we saw in the last lesson when outer-joining two tables with asymmetric data. In these cases, you can test a column for NULL values in a WHERE clause by using either the IS NULL or IS NOT NULL constraint.

0 comments on commit 81f8220

Please sign in to comment.