From the course: Querying Microsoft SQL Server 2019

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Understand NULL values

Understand NULL values - SQL Server Tutorial

From the course: Querying Microsoft SQL Server 2019

Start my 1-month free trial

Understand NULL values

- [Narrator] Null values in a table represent data that's not available or is unknown. Since null literally means nothing, you can't use the same comparison operators to filter records in a select statements where clause, like you would when comparing numbers or text strings. It just doesn't make any sense to ask for records where a null is equal to something or not equal, or greater than some other value. That's why SQL Server gives us two alternate ways to work with records that contain null values. Let's take a look by creating a new query that retrieves data from the WorkOrder table. I'll select the WorkOrderID, ScrappedQty, and ScrapReasonID columns. And it'll be from the Production.WorkOrder table. When I execute the query, that'll pull information about over 72,000 work orders from the database. We can see in the results that many of these work orders were completed without issue, and the number of items that…

Contents