MySQL Where Clause

Great day Everyone, This tutorial is all about MySQL Where Clause I will tell you and teach you all you need to know about the MySQL Where Clause As a programmer you need to know MySQL Where Clause so let’s get started:

A WHERE Clause is added to MySQL query, the MySQL engine compares each record in the table with the condition specified in the WHERE Clause.The MySQL engine display only those records that satisfy the specified condition.

Syntax:

SELECT * FROM tablename where condition;

MySQL table(tblemployee)

id Emp_Name Emp_Code Emp_Designation Emp_joinnig_date
1 Clive Dela Cruz 10806121 Software Developer 2018-02-01
1 Andrew Braza 10806860 Software Testing 2015-10-15
1 Clide Marcellana 10806865 HR 2016-12-22
1 Rey Tejada 13406121 Accountant 2019-03-01

Ex:

Select Emp_Name  from tblemployee where id=1;

Output

Clive Dela Cruz

Operators in the where clause :

Operator Description
= Equality
!= Inequality
< Less than
<= Less than or equal
> More than
>= More than or equal
Between min Within the range
AND max min to max
IS NULL Is a NULL Value
IS NOT NULL Is not a null value

Comparison operators are used in a query with a WHERE clause to test if a specified condition is met. When the evaluation is TRUE the query will return the data, otherwise nothing will be returned.

That’s it! I hope you learn something today about MySQL Where Clause 

If you have any comments or suggestions about MySQL Where Clause Please message us Directly:

Other Articles you might read also:

 

Leave a Comment