SQL AND, OR and NOT Operators are used to get selected data from the SQL TABLE.
The AND operator is used to filter data according to TRUE all the conditions.
SELECT * FROM table-name WHERE
`column1`='value1'
AND `column2`='value2'
AND `column3`='value3'
AND `column4`='value4'
The OR operator is used to filter data according to TRUE any one condition.
SELECT * FROM table-name WHERE
`column1`='value1'
OR `column2`='value2'
OR `column3`='value3'
OR `column4`='value4'
The NOT operator is used to filter data according to FALSE conditions.
SELECT * FROM table-name WHERE
NOT `column1`='value1'
SELECT * FROM table-name WHERE
NOT `column1`='value1'
AND NOT `column2`='value2'
SELECT * FROM table-name
WHERE (`column1`='value1' AND `column2`='value2')
OR (`column3`='value3' AND `column4`='value4')
SELECT * FROM table-name
WHERE (`column1`='value1' OR `column2`='value2')
AND (`column3`='value3' OR `column4`='value4')
SELECT * FROM table-name
WHERE `column1`='value1'
AND (`column2`='value2' OR `column3`='value3')
SELECT * FROM table-name WHERE
NOT `column1`='value1'
AND NOT `column2`='value2'
SELECT * FROM table-name WHERE
NOT `column1`='value1'
OR NOT `column2`='value2'