...

Database Managment - Sql

Back to Course

Lesson Description


Lession - #1298 SQL And ,Or Clause


The AND and OR operators are utilized to filter records in light of more than one condition: The AND administrator shows a record assuming every one of the circumstances isolated by AND are TRUE. The OR administrator shows a record assuming any of the conditions separated by OR is TRUE.

Syntax for And Clause




SELECT column1, column2, columnN 
FROM table_name
WHERE [condition1] AND [condition2]...AND [conditionN];






Example:



Syntax for OR Clause




SELECT column1, column2, columnN 
FROM table_name
WHERE [condition1] OR [condition2]...OR [conditionN]




Example:



Note:

Database name should be present in database.

Online compiler