CASE WHEN END STATEMENTS with Aggregates Group by IN SQL | Advanced SQL | Ashutosh Kumar

Поділитися
Вставка
  • Опубліковано 9 вер 2023
  • Sql one of the most important language asked in most of the analytics interviews,in this series i have discussed some advanced level sql concepts that are frequently asked in data analyst,business analyst interviews. In this video i have covered CASE WHEN END STATEMENTS concepts in sql
    👉Query -
    1)
    drop table if exists table1;
    CREATE TABLE table1( sid integer,score integer);
    INSERT INTO table1( sid,score)
    VALUES
    ('1','72'),
    ('2','16'),
    ('3','69'),
    ('4','43'),
    ('5','23');
    2)
    drop table if exists table2;
    CREATE TABLE table2(orderid integer,stateid varchar(200),status varchar(200),amount integer);
    INSERT INTO table2(orderid,stateid,status,amount)
    VALUES
    ('1','s1','shipped','67050'),
    ('2','s2','delivered','68608'),
    ('3','s3','packed','62545'),
    ('4','s2','shipped','54033'),
    ('5','s1','delivered','39284'),
    ('6','s2','shipped','80372'),
    ('7','s2','delivered','66399'),
    ('8','s3','packed','48914'),
    ('9','s1','packed','95459'),
    ('10','s1','delivered','70493'),
    ('11','s2','delivered','58017'),
    ('12','s3','packed','80360'),
    ('13','s1','delivered','90328'),
    ('14','s3','shipped','32283'),
    ('15','s2','packed','62551'),
    ('16','s3','packed','18273'),
    ('17','s2','shipped','46131'),
    ('18','s1','packed','18713');
    ------------------------------------------------------------------
    👉 Complete playlist on Sql Interview questions and answers
    • HackerRank SQL problem...
    ---------------------------------------------------------------------------------------------------------------------
    Check out some more relevant content here
    👉 How to Learn SQL
    • How to learn sql for b...
    👉 How to become a business analyst complete roadmap-
    • Business Analyst Compl...
    👉 How to become a data analyst complete roadmap-
    • Data Analyst Complete ...
    👉 Top 3 you tube channels to learn sql for free for beginners
    • Video
    👉 Rank ,Dense Rank, Row Number in sql -
    • RANK - DENSE RANK - RO...
    👉 Cross join in sql
    • CROSS JOIN SQL
    👉 union join in sql
    • UNION IN SQL
    👉 left join in sql
    • LEFT JOIN IN SQL
    👉 Right join in sql
    • RIGHT JOIN IN SQL
    👉 Inner join in sql
    • INNER JOIN IN SQL
    👉 Introduction to tables and databases in sql -
    • INTRO TO TABLES AND DA...
    👉 Aggregate Function in sql
    • AGGREGATE FUNCTION IN SQL
    👉 Functions in sql-
    • IMPORTANT FUNCTIONS IN...
    👉 String Function in sql
    • STRING FUNCTIONS IN SQL
    👉 CRUD operations in sql
    • CREATE- READ- UPDATE-D...
    👉 Autoincrement in sql
    • Auto Increment in SQL ...
    👉 Primary Key in sql-
    • PRIMARY KEYS IN SQL - SQL
    👉 Null and Default values in sql-
    • NULL AND DEFAULT VALUE...
    👉 Data types in sql-
    • Data types in Sql - SQL
    ____________________________________________________________________
    Fill the form below to subscribe yourself to the analytics jobs mailing list to receive regular job opening updates - docs.google.com/forms/d/e/1FA...
    Why you should definitely fill the analytics job updates google form - • Job Openings into busi...
    _______________________________________________________________________
    Connect with me
    📸Instagram - / ashutosh.analytics
    💻Linkedin- / ashutoszh
    _____________________________________________________________________
    Comment down if you have any doubts
    Please leave a LIKE 👍 and SUBSCRIBE ❤️ to my channel to receive more amazing content in data analytics and data science.
    _____________________________________________________________________
    🏷️ Tags
    sql,
    sql for data science,
    sql for data analytics,
    sql practise questions,
    sql practise questions and solutions,
    sql tutorials for beginners,
    sql problems for data engineers,
    ashutosh,
    ashutosh kumar,
    ashutosh kumar analytics,
    sql problems easy,
    sql problem medium,
    sql problems hard,
    sql window functions,
    sql advanced questions,
    rank functions in sql,
    lag lead in sql,
    sql interview questions and answers,
    sql interview questions,
    sql questions asked in interviews,
    hackerrank sql solutions,
    hackerearth sql solutions,
    leetcode sql solution
    🏷️HashTags
    #sql #interviews #questions #solutions

КОМЕНТАРІ • 14

  • @xavier6823
    @xavier6823 9 місяців тому +2

    your are first teacher who is showing how the sql query actually work.....thanks sir

  • @moviebytes4365
    @moviebytes4365 2 місяці тому

    nice, good explanation

  • @user-lm5wb8vi1x
    @user-lm5wb8vi1x 3 місяці тому

    Finished watching

  • @ManasNandMohan
    @ManasNandMohan 4 місяці тому

    what will be do if we want to return the orderid for shipped,deliverd,packed

  • @satyendrakumar3319
    @satyendrakumar3319 10 місяців тому

    Nice explanation 👌

  • @binaykumar2060
    @binaykumar2060 10 місяців тому

    Very good

  • @user-td3mf5wp1u
    @user-td3mf5wp1u 3 місяці тому

    Sir please explain why are you using case and end multiple times in previous video you explained case at the beginning and end at the end in between the conditions and results but here for each cond you have used case and end iam confused....

  • @kindyletutorials7197
    @kindyletutorials7197 7 місяців тому +1

    1000000000000000000 thanks, very very clear.

  • @xavier6823
    @xavier6823 9 місяців тому

    part three sir please

  • @tusharraut5377
    @tusharraut5377 2 місяці тому

    Make videos in Hindi as well for those who not much Clear to understand in English otherwise your method is good to understand.😊