MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

MySQL

Where in MySQL
Previous Home Next

The Where command is used to filter the results according to the applied conditions. Here is the syntax of select statement.

SELECT expressions
FROM tables
WHERE columnname operatorvalue;

There are some operators used in Where clause which is given below:

OperatorDescription
=Equal
<>Not equal to(somtimes it may be written as !=)
>Greater than
<Less than
<=Less than equal to
>=Greater than equal to
andBoth conditions follow
orAny one condition follow
BetweenWithin a Range

 

Here given some example which follow above conditions

In the following examples i have created a new table from the existing database of name school off name studadr as image given below

Example

SELECT * 				//show all values
FROM studadr 				//studadr is tablemname
WHERE locatn = 'central' ;		//condition is given

output become

Example

SELECT * 			//show all values
FROM studadr			//studadr is a tablename
WHERE locatn != 'central' ;	//not equal to condition is given

output become

Example


SELECT * 			//show all values
FROM studadr			//studadr is a tablename
WHERE aid  > = 108 ;		//greater than equal to condition is given

output become

Example

SELECT * 					//show all values
FROM studadr					//studadr is a tablename
WHERE locatn ='noida' and state='delhi';	//AND conditions is given

output become

Note:

Both the conditions written on where clause should follow to get the output, if any one fails then no output will be shown.

Example

SELECT * 						//show all values
FROM studadr						//studadr is a tablename
WHERE  locatn ='noida' OR state='delhi';;		//OR conditions is given

output become

Note:

Any of the conditions written in where clause satisfy to get the output, if all the conditions fails then no output will be shown.

Example

SELECT *					//shoe all values
FROM studadr					//studadr is a tablename
WHERE aid BETWEEN '101' AND '111' 		//AND conditions is given

output become

Note:

In the above condition the lower and upper limits also gets count into the output.

Previous Home Next