| SQL Advanced |
| |
| SQL AND & OR |
| |
| AND & OR |
| AND and OR join two or more conditions in a WHERE clause.The AND operator displays a row if ALL conditions listed are true. The OR operator displays a row if ANY of the conditions listed are true. |
| |
| Table Name is “associate record” |
|
| |
| Example |
| Use AND to display each person with the first name equal to "Priya” the last name equal to "seth”. |
|
| |
| RESULT |
|
| |
| Example |
| Use OR to display each person with the first name equal to "suchi” the last name equal to "singh”. |
| |
|
| |
| RESULT |
|
| |
| Example |
| You can also combine AND and OR (use parentheses to form complex expressions): |
| |
|
| |
| RESULT |
|
| |
| |
|
|
| |
| |