SQL Clauses Part - I | AND, OR, NOT, CASE Keywords and Clauses use Explained in Detail with Examples

Опубликовано: 21 Июль 2024
на канале: Learn with Nivas
85
2

In this video, I have explained the uses of DISTINCT, AND, OR, NOT and CASE Keywords and Clauses in detail with LIVE Examples on SQL Server.

Chapters in this video are:

0:15 DISTINCT Keyword Explanation
0:49 DISTINCT Syntax and Example
2:18 Execution of DISTINCT Keyword in SQL Server
4:47 AND, OR and NOT Conditions Explanation
6:30 Explanation of AND, OR and NOT Conditions with SQL Examples
7:43 Execution of AND Condition in SQL Server
9:19 Execution of OR Condition in SQL Server
12:12 Execution of OR with AND Condition in SQL Server
15:33 Execution and Explanation of NOT Condition in SQL Server
18:52 CASE Expression Explanation
20:36 CASE Expression Syntax and Example
25:01 Execution of CASE Expression in SQL Server




The Statements used in this videos are as under.

/* AND CONDITION EXAMPLE */

SELECT PRODUCT_ID, PRODUCT_NAME, PRODUCT_QUANTITY, PRODUCT_PRICE, PRODUCT_COUNTRY
FROM SUPPLIER_A
WHERE PRODUCT_PRICE = 20
AND PRODUCT_COUNTRY = 'BRAZIL'

/* OR CONDITION EXAMPLE */

SELECT PRODUCT_ID, PRODUCT_NAME, PRODUCT_QUANTITY, PRODUCT_PRICE, PRODUCT_COUNTRY
FROM SUPPLIER_A
WHERE PRODUCT_PRICE = 20
OR PRODUCT_COUNTRY = 'BRAZIL'

/* NOT CONDITION EXAMPLE */

SELECT PRODUCT_ID, PRODUCT_NAME, PRODUCT_QUANTITY, PRODUCT_PRICE, PRODUCT_COUNTRY
FROM SUPPLIER_A
WHERE PRODUCT_PRICE = 20
AND NOT PRODUCT_COUNTRY = 'BRAZIL'

/* CASE EXPRESSION EXAMPLE */
(Please type the Case Statement yourself by pausing the video as there are restrictions to put that query by Youtube in the description)