Logic

 

Logical operations can be used in queries.

 

For example

 

Parameters param = db.CreateParameters();

param["null"] = null;

param["name"] = "John"

 

var res = db.ExecuteQuery("SELECT BasicUser WHERE Name = @name AND Friends != @null");

 

AND truth table

 

Logical Conjunction

p

q

p . q

T

T

T

T

F

F

F

T

F

F

F

F

 

 

OR truth table

 

Logical Disjunction

p

q

p + q

T

T

T

T

F

T

F

T

T

F

F

F

 

 

XOR truth table

 

Exclusive Disjunction

p

q

p  q

T

T

F

T

F

T

F

T

T

F

F

F