filmov
tv
Oracle SQL TUTORIAL – IF condition using CASE and DECODE - An Example

Показать описание
In this video, we shall see how case and decode is used in real time scenario. SQL used in the video is given below.
SELECT * FROM emp_test ORDER BY gender;
count_of_employees Count_of_Male_Employees Count OF Female Employees --
15 5 8
select count(*) " Total Employees" from emp_test;
select gender,count(*) " Total Employees" from emp_test group by gender;
select sum(decode(gender,'M',1,0)) Count_OF_Male_Employees from emp_test;
select sum(case gender when 'F' then 1 else 0 end) as Count_OF_FeMale_Employees from emp_test;
SELECT count(*) " Total Employees" ,
sum(decode(gender,'M',1,0)) Count_OF_Male_Employees,
sum(case gender when 'F' then 1 else 0 end) Count_OF_Female_Employees
from emp_test;
SELECT * FROM emp_test ORDER BY gender;
count_of_employees Count_of_Male_Employees Count OF Female Employees --
15 5 8
select count(*) " Total Employees" from emp_test;
select gender,count(*) " Total Employees" from emp_test group by gender;
select sum(decode(gender,'M',1,0)) Count_OF_Male_Employees from emp_test;
select sum(case gender when 'F' then 1 else 0 end) as Count_OF_FeMale_Employees from emp_test;
SELECT count(*) " Total Employees" ,
sum(decode(gender,'M',1,0)) Count_OF_Male_Employees,
sum(case gender when 'F' then 1 else 0 end) Count_OF_Female_Employees
from emp_test;
Oracle PL/SQL Tutorial - If Statements
CASE STATEMENT(IF THEN ELSE) IN ORACLE SQL WITH EXAMPLE
How to See Where Your Oracle SQL Query is Slow
Learn Basic SQL in 15 Minutes | Business Intelligence For Beginners | SQL Tutorial For Beginners 1/3
Oracle - PL/SQL - Conditional Statements
Learning PL/SQL programming
Writing CASE WHEN Statements in SQL (IF/THEN)
PL/SQL tutorial 7: Introduction to PL/SQL Conditional Statements in Oracle Database
PL/SQL tutorial 10: PL/SQL IF THEN ELSIF Statement in Oracle Database by Manish Sharma
SQL Explained in 100 Seconds
Advanced Aggregate Functions in SQL (GROUP BY, HAVING vs. WHERE)
PL/SQL tutorial 9: IF THEN ELSE (IF-ELSE) Statement in PL/SQL by Manish Sharma
Oracle PL/SQL Tutorials | Oracle PL:SQL Control Structure Selection | by Mr.Vaman Deshmukh
81 Find second highest salary from employee table using SQL? #interviewquestions #javaprogramming
What is SQL? [in 4 minutes for beginners]
Can You Use IF Condition in SELECT Statement? #coding
How I Write SQL using AI (Not ChatGPT)? Ai for SQL
6 SQL Joins you MUST know! (Animated + Practice)
SQL CTEs (Common Table Expressions) - Why and How to Use Them
From Slow to Fast: Optimize Your SQL Queries Efficiently | Explain Plan
Follow this SQL RoadMap to kick start your SQL journey | #learncoding
SQL Window Functions | Clearly Explained | PARTITION BY, ORDER BY, ROW_NUMBER, RANK, DENSE_RANK
SQL tutorial 49: CASE - Simple Case Expression in Oracle Database (1/2)
Don't Become a Data Engineer if
Комментарии