LinkedIn SQL Interview Question | Using CTEs | Advanced SQL

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024

ความคิดเห็น • 15

  • @user-sn8vk9lt4o
    @user-sn8vk9lt4o 11 วันที่ผ่านมา

    with cte as(
    select
    company_id,
    title,
    description,
    count(*) over(partition by company_id, title) as counts
    from job_listings
    )
    select
    count(distinct company_id) as duplicate_companies
    from cte
    where counts > 1;

  • @dharmiklingam1108
    @dharmiklingam1108 15 วันที่ผ่านมา

    Hi Nishtha i hpoe you doing good,it will helpful for people if you provide the script in every video.

  • @sachins5660
    @sachins5660 15 วันที่ผ่านมา

    wow linkedln is asking such simple question and someone made a video on this.

  • @prajju8114
    @prajju8114 14 วันที่ผ่านมา

    with cte_job as(
    Select company_id, title, description, row_number() over(partition by company_id order by job_id) as job_count from job_listings
    )
    Select count(distinct company_id) as duplicate_companies from cte_job where job_count>1
    This is also giving same result

  • @architsrivastava6649
    @architsrivastava6649 16 วันที่ผ่านมา

    Select count( Distinct company_id) as duplicate_companies
    from(
    Select *,
    row_number() over(partition by company_id, title, description order by company_id) as rn
    from job_listings) x
    where rn>1
    group by company_id;

  • @ajeetadarsh2871
    @ajeetadarsh2871 16 วันที่ผ่านมา

    How to fetch previous date using today's date?

    • @sonujack1
      @sonujack1 15 วันที่ผ่านมา

      You can use lag function.
      Select name, dates, lag(dates) over ( order by dates) as previous_dates from table_x

  • @durgaprasadbammidi7425
    @durgaprasadbammidi7425 15 วันที่ผ่านมา

    I think the question is not correctly framed

  • @rohitsingh3964
    @rohitsingh3964 16 วันที่ผ่านมา

    can you learn me sql, if yes please share class time and fees.

    • @MovieBuzz-uu8kp
      @MovieBuzz-uu8kp 16 วันที่ผ่านมา

      I can teach you

    • @chandanpatra1053
      @chandanpatra1053 16 วันที่ผ่านมา

      I can teach you from very scratch

  • @tanujreddy8597
    @tanujreddy8597 6 วันที่ผ่านมา

    SELECT
    count(c)
    FROM
    (
    SELECT
    company_id,
    description,
    COUNT(*) c
    FROM
    job_listing
    GROUP BY
    company_id,
    description
    HAVING
    COUNT(*) > 1
    );

  • @HARSHRAJ-wz2rp
    @HARSHRAJ-wz2rp 16 วันที่ผ่านมา

    with cte as(
    select job_listings.*,ROW_NUMBER()OVER(PARTITION BY company_id) as x1 FROM job_listings
    )
    select COUNT(DISTINCT company_id) as duplicate_companies FROM cte where x1>1;
    Nishtha man it is request to you that if you found my solution as a right solution,plese give some reaction on my comment

  • @harshitsalecha221
    @harshitsalecha221 16 วันที่ผ่านมา

    WITH cte1 AS (SELECT *,ROW_NUMBER() OVER(PARTITION BY company_id) as rn FROM job_listings)
    SELECT c1.company_id
    FROM cte1 as c1
    INNER JOIN cte1 as c2
    ON c1.company_id=c2.company_id AND c1.title=c2.title AND c1.description=c2.description AND c1.rn