I understand that SQL uses three valued logic but I am having trouble understanding how to use this in practice, especially why TRUE || NULL = True and FA
TRUE || NULL = True
FA
To use a nullable variable you just need to check NULL conditions (using IS NULL) before checking the value.
IS NULL
e.g. IF @a IS NOT NULL AND @a = 1
IF @a IS NOT NULL AND @a = 1