ADOBE SQL INTERVIEW QUESTION | Divide Employees into Buckets

Поделиться
HTML-код
  • Опубликовано: 6 сен 2024
  • DML Script: datasculptor.b...
    Feedback: forms.gle/NQuC...
    The Data Sculptor RUclips channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insightful and creative purposes.
    The channel covers a wide range of topics related to data manipulation, analysis, visualization, and interpretation. The term "Data Sculptor" emphasizes the creative aspect of working with data, suggesting that it's not just about raw numbers but also about crafting meaningful stories and insights from the information available.
    Viewers can expect a variety of content, including tutorials on popular data analysis tools and programming languages, discussions on emerging trends in the data field, case studies showcasing innovative data applications, and tips for effective data communication. The Data Sculptor aims to demystify complex concepts, making data-related skills accessible to both beginners and experienced professionals.
    Whether you're a student looking to enter the field of data science, a business professional seeking to enhance your analytical skills, or simply someone curious about the world of data, the Data Sculptor RUclips channel strives to provide engaging and informative content to help you navigate the exciting realm of data exploration and analysis.
    Playlists:
    SQL Interview Questions: • SQL Interview questions
    Recursive CTE: • Recursive CTE
    Power BI: • Power BI and DAX
    Data Modeling: • Data Modelling
    Generative AIs: • Generative AIs
    Excel: • Excel
    Follow me
    Linkedin: / data-sculptor-93a00b2a8
    Instagram: / datasculptor2895
    #sqlinterviewquestions #adobeinterview #sql

Комментарии • 4

  • @dasubabuch1596
    @dasubabuch1596 Месяц назад +2

    SELECT employee_id, salary ,ntile(4)over(order by salary) as bucket FROM employees;

  • @mahenderchilagani5916
    @mahenderchilagani5916 Месяц назад

    with cte as(
    select*, percent_rank() over(order by salary asc) as rn from employees
    )
    select employee_id, salary,
    case
    when rn = 0 then '1'
    when rn = 0.125 then '1'
    when rn = 0.25 then '1'
    when rn = 0.375 then '2'
    when rn = 0.5 then '2'
    when rn = 0.625 then '3'
    when rn = 0.75 then '3'
    when rn = 0.875 then '4'
    else
    '4'
    end as Bucket
    from cte

  • @saiteja-gb8ho
    @saiteja-gb8ho Месяц назад

    SELECT *,
    CASE
    WHEN SALARY >=2000 AND SALARY =3500 AND SALARY =4500 AND SALARY =6000 AND SALARY

    • @datasculptor2895
      @datasculptor2895  Месяц назад

      Sorry, but this should not be done in this way. What if the salaries are changed in the dataset?