Order of precedence for sql in teradata is
NOT, Parenthesis AND, OR
Parenthesis,NOT, AND, OR
Parenthesis, OR ,NOT, AND
Parenthesis,NOT, OR, AND