Back to Top

Friday, 1 March 2013

SQL: AND Command

In SQL, we have, seen that, we can add conditions by using WHERE command, during any SELECT, UPDATE or DELETE operation. Now, what about multiple conditions? For that, SQL provides to add multiple condition by using AND command. it can be used as many times as you want.

Syntax: SELECT [column_name] FROM [table_name] WHERE [condition_1] AND [condition_2];

[Note: AND means mandatory condition, that means, the operation has to always fulfill the criteria provied under AND block. ]


Again, use the same table, we will see the usage of  AND command.
Employee Details ( employee_details), which contains 
Employee ID ( emp_id), 

Employee Name (emp_name), 
Employee Address (emp_address) and
Employee Role: (emp_role).

Table:  employee_details 

Now, using AND command, we will SELECT those tuple, WHERE emp_role is 'Developer' and emp_address is 'Park Street, Kolkata'.
So, the query will be :

SELECT * FROM employee_details WHERE emp_role = 'Developer' AND emp_address = 'Park Street, Kolkata';


In this way, we can use multiple conditions on an RDBMS operation.

1 Responses to “ SQL: AND Command ”

Naviya Nair said...
24 October 2016 at 15:14

I have read your blog its very attractive and impressive. I like it your blog.

Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

Online Java Training Java 8 Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai Java Training Institutes

Java Training Institutes in Chennai Java Training in Chennai

Post a Comment

Popular Posts

All Rights Reserved JAVA INTERVIEW QUESTIONS | Privacy Policy | Anijit Sarkar
blog links Web Directory Academics Blogs