SQL Logical Operators


The logical operators are used to find smaller, greater, equal values from same column.


1) Equal to

It is used to find data from a table according to the 'equal to' condition.


Syntax -

Select * from table_name where column_name  column_data;

equal to operator

2) Not equal to

It is used to find data from a table according to the 'not equal to' condition.


Syntax -

Select * from table_name where column_name  != coumn_data;

not equal to operator

3) Greater than or less than

It is used to find data from a table according to the 'greater than or less than' condition.


Syntax -

  • Select * from table_name where column_name  > column_data;
  • Select * from table_name where column_name  < column_data;
aql greater than or less than operators

 4) Greater than equal to or less than equal to

It is used to find data from a table according to the 'greater than equal to or less than equal to' condition.


Syntax -

  • Select * from table_name where column_name  > = column_data;
  • Select * from table_name where column_name  < = column_data;
sql greater than equal to or less than equal to operators

5) Data of anyone

It is used to find data of anyone from a table.


Syntax -

Select * from table_name where column_name  in ( ‘name1’, ‘name 2’,………. );

sql data find from column

                                             OR

Select * from table_name where column_name  = ‘name1 or  column_name  = ‘name 2 or  ……….);

sql data find from column