Introducing SQL Comparison and Logical operators

  July 06,2012   Read: 639 Times

Hello friend, welcome to my today's post on MySQL. In my last tutorial, we learned about "4 Major SQL command categories". Hope you enjoyed that tutorial. Today we are going to learn about "Introducing SQL Comparison and Logical operators". So, Let's start -

There are two type of SQL Operators, namely Comparison Operators and Logical Operators. These operators are used mainly in the WHERE clause, HAVING clause to filter the data to be selected. Now go for details -

SQL Comparison Operators:

Comparison operators are used to compare the column data with specific values in a condition. Comparison Operators are also used along with the SELECT statement to filter data based on specific conditions.

The below table describes each comparison operator.

= equal to
<>, !=  is not equal to
< less than
> greater than
>= greater than or equal to
<= less than or equal to

SQL Logical Operators:

There are three Logical Operators namely, AND, OR, and NOT. These operators compare two conditions at a time to determine whether a row can be selected for the output.

When retrieving data using a SELECT statement, you can use logical operators in the WHERE clause, which allows you to combine more than one condition.

Was this information useful? What other tips would you like to read about in the future?  Share your comments, feedback and experiences with us by commenting below!

  You might also like...

  Installing MySQL on Linux

  Installing mysql on windows

  How to use field Alias name in SQL query

  4 Major SQL command categories

  Mysql database introduction

Share:

  Author: Md Mahbub Alam Khan (255 Posts)

Md Mahbub Alam Khan is the Editor and Founder of CoolAJAX Web Blog. You can follow CoolAJAX on Twitter , on Facebook or you can subscribe via RSS .

Write For Us & Be An Exclusive Post Author!

comments powered by Disqus