Null – Special Data Value

What is NULL ?

Null denotes that a data value which is not exist in the database. The term “NULL” has been coined by E.F.Codd.

Null usually represent Inapplicable or Missing information in the system. In SQL Server NULL is a keyword/reserved word.

 

Is Null as same as Zero ?

No, Missing or inapplicable information can’t be assumed as Zero value.

 

The price of a product can be a numeric  value or “Don’t know the price”. If we don’t know the value of price then it will be classified as null.

 

NULL Keyword

SQL server uses the keyword NULL to differentiate among other data values.

 

A simple example to understand about null

 

SQL  Code Snippet:

Declare @tabEmployee table (ID int, Namenvarchar(255), Department nvarchar(50), Salarydecimal(18,2))

 Insert into @tabEmployee (ID,Name,Department,Salary)

values (1000,’Sam’,’Sales’,50000),

(1001,’Mark’,’Operations’,Null),

(1002,’Tom’,Null,70000),

(1003,’Nancy’,”,90000)

Select ID ,Name,Department,Salary from@tabEmployee

 

Null for numeric data type:

Salary_Null

It has been observed that we don’t have the department information about the employee Mark. Hence a null has been presented to denote the missing information.

 

Null for string data type:

Department_Null

As we don’t know the  Department name for the employee Tom, it has been represented as NULL.

 

How to compare null value ?

As null is a special data value , it is not possible to compare using the equal sign.

Null_Compare

Hence we need a special operator to handle values with NULL. The “IS NULL” operator will be useful to compare against the NULL data values.

IS_NULL

The operator “IS NULL” can be used for string data types as well

IS_NULL_String

Is zero length string  or blank value is as same as Null ?

No,  The below mentioned query and result set confirms the fact that only nullable values can be compared using “IS NULL”.

NULL_Blank_String

Agile Estimates for SSRS Report Development

How to do Agile Estimates for SSRS report development?

Agile estimation is an art and it will take reasonable time to gain experience. These simple steps will help you out.

Step 1: Assess the complexity of the report by asking these high level questions

  1. How many sources have been involved?
  2. How many datasets need to be developed (Apprx) ?
  3. How many Tablix / Table can be expected ?
  4. How many parameters are needed to be generate the report ?
  5. Presentation and formatting requirements
  6. How many no of Sub Reports / Drill Down reports are associated with this report ?

Step 2: Now decide the story point (or use the T-shirt size estimation techniques)

 

General Guidelines from experts:

  • As a general practice, it is accepted that the Development team will be in a better position to estimate after Sprint-2  or 3. Only after this time, the Sprint velocity can be used for future sprint planning.
  • Avoid estimating like an expert. Always assume that a developer who has got reasonable experience will be doing the development.
  • As a team, make use of the Sprint retrospectives and learn from mistakes.

Frequently Asked Questions:

  1. How to do the estimation for Sprint-1 ?

You could use previous experience to come up with a rough estimation.

Learn more about SQL Server

How do we improve our SQL knowledge and access what we know ?

The following links will help to improve SQL Server knowledge

http://www.sqlservercentral.com/

You will learn about a specific topic in SQL Server. The stairway series are an excellent way to accelerate knowledge in no time.

 

https://www.mssqltips.com/

You can find a solution to an uncommon problem here. Quick and easy to read tip in a page.

 

http://blog.sqlauthority.com/

An SQL server encyclopaedia !. I can’t even imagine how he is able to write about each and every feature about SQL server.

 

Joes 2 Pros Book Series

A SQL book has been written in easy to understandable format. I love Rick Morelan’s examples for every concepts.

 

http://beyondrelational.com/puzzles/

The SQL puzzles are a great way to access your knowledge. Its fun J. Take a challenge a day to improve your confidence.

 

Online SQL Test

I have written a post about online SQL Test

Free Online SQL Server Questions / Test

I have composed a set of basic SQL server questions below. This would help you to validate your understandings in the area of RDBMS, SQL Server, Data Types, SQL Functions, etc.

Please leave a comment, if you would like to add more questions.

SQL Server Questions -1