CASE WHEN END STATEMENTS IN JOINS IN SQL | Advanced SQL | Ashutosh Kumar

Поділитися
Вставка
  • Опубліковано 13 лис 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 table2;
    create table table2(
    id varchar(133),
    name varchar(133));
    insert into table2 (id,name)
    values ('1','n1'),
    ('2','n2'),
    ('3','n3'),
    ('4','n4'),
    ('5','n5');
    2)
    drop table if exists table1a;
    CREATE TABLE table1a(name varchar(200),amount integer);
    INSERT INTO table1a(name,amount)
    VALUES
    ('n1','5713'),
    ('n2','8275'),
    ('n1-online','3316'),
    ('n2-online','3622');
    drop table if exists table1b;
    CREATE TABLE table1b(name varchar(200),state varchar(200));
    INSERT INTO table1b(name,state)
    VALUES
    ('n1','s1'),
    ('n2','s2');
    ------------------------------------------------------------------
    👉 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

КОМЕНТАРІ • 8

  • @AshutoshKumaryt
    @AshutoshKumaryt  8 місяців тому +1

    More such concepts - ua-cam.com/play/PLbTF1OfX62c3RQ_ZFfyNBWVPdz_OWTMLG.html

  • @RahulGupta-bn4rj
    @RahulGupta-bn4rj 4 місяці тому

    hi , your efforts to spread knowledge of sql is appreciated, i would request , please add some more zoom in your's videos as values are not visible in sql studio even in full screen mode
    thank you so much..

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

    Finished watching

  • @king-hc6vi
    @king-hc6vi 18 днів тому +1

    What if we join the tables with a condition as
    a1. Seatid < a2.Seatid ?

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

    Hi, I'm solved it in little bit different approach
    select
    case when id=(select COUNT(1) from seats_tbl) then id
    when id%2=0 then id-1
    else id+1 end id, name
    from table
    order by id;

  • @Manjunath_07
    @Manjunath_07 8 місяців тому +1

    for first_problem
    with cte as(
    select *,row_number() over(partition by pairs order by id desc) from(
    select * ,ntile(3) over(order by id asc) as pairs from table2) as a
    )
    select row_number() over() as id,name from cte;
    2nd
    select name,amount,case when name='n1-online' then 's1' else case when name='n2-online' then 's2' else state end end as state from(
    select a.*,coalesce(b.state,0)as state from table1a as a left join table1b as b on a.name=b.name) as a;

  • @-LAzaruddin
    @-LAzaruddin 8 місяців тому

    when will you do videos on portfolio