Tutorials

SQL Clause and Operator


SQL AND


In sql WHERE clause is used with SELECT, UPDATE, DELETE staements to perform operation based on certain conditions.

WHERE clause helps to filter the result based on the applied conditions.

 

Syntax for WHERE 

SELECT * FROM table_name 
WHERE Condition;

Example of WHERE

 

For demonstration we will take help of tih_Corses table:

tih_Courses
Course_ID Course_Name Professor Mode_of_Training
001 .Net Mukesh Tiwari Online and Offline
002 Java Rajneesh Shukla Online and Offline
003 ANSI SQL Rajneesh Shukla Online
004 Basics of Computer Shweta  Online
 

Query-1: From the above table we want those rows where mode of training is 'Online'.

SQL query for the same is given below:


	
SELECT * FROM tih_Courses
WHERE Mode_of_Training = 'Online';

On executing above query successfully, we get:

tih_Courses

Course_ID

Course_Name

Professor

Mode_of_Training

003 ANSI SQL Rajneesh Shukla Online
004 Basics of Computer Shweta  Online
 

 

Query 2: From the above table we want those rows where professor is 'Rajneesh'.

SQL query for the same is given below:


	
SELECT * FROM tih_Courses
WHERE Professor = 'Rajneesh';

On executing above query successfully, we get:

 

tih_Courses

Course_ID

Course_Name

Professor

Mode_of_Training

002 Java Rajneesh Shukla Online and Offline
003 ANSI SQL Rajneesh Shukla Online

 

 



Please Share this page
Views : 45
Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!