Labels

Friday, June 3, 2022

“WHERE”, “AND”, “OR” Clauses in SQL (Part -10)

 WHERE clause in SQL is a data manipulation language statement. WHERE clause is used in SELECT, UPDATE, DELETE statement etc.

WHERE clauses are not mandatory clauses of SQL DML statements. But it can be used to limit the number of rows affected by a SQL DML statement or returned by a query.



The SQL AND condition is used in SQL query to create two or more conditions to be met. It is used in SQL SELECT, INSERT, UPDATE and DELETE.

Syntax for 'AND' condition:

SELECT columns FROM tables WHERE condition 1 AND condition 2;

The SQL OR condition is used in SQL query to create a SQL statement where records are returned when any one condition met. It can be used in a SELECT statement, INSERT statement, UPDATE statement or DELETE statement.

Syntax for 'OR' condition:

SELECT columns FROM tables WHERE condition 1 OR condition 2;




Use ‘Where’ & ‘And’ Clauses both:




No comments:

Post a Comment