Q:

Not Understanding Where Statement

I am new to SQL, I'm looking through some code for a small database for a medical office. What does the following mean and what will it do...Patient I get, its a field in the DB. This code is repeated for each of the fields.
WHERE ( LOWER ( "Patient" ) LIKE ( '%' || LOWER ( :Patient ) || '%' )

A:

It does a case insensitive comparison looking for rows where the "Patient" column contains the substring passed in the :Patient parameter.
LOWER converts both sides to lower case.
|| is the ANSI SQL string concatenation operator.
% in a LIKE pattern is a wildcard meaning "match any set of zero or more characters".
So if :Patient was Smith the expression works out as
WHERE LOWER ( "Patient" ) LIKE '%smith%'

