Hackerrank The Blunder Problem | SQL | Ashutosh Kumar

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ต.ค. 2024
  • Sql one of the most important language asked in most of the analytics interviews, in this series i will be solving sql questions from hackerrank, hackerearth, leetcode and many other websites which are more relevant to questions asked in interviews these questions will be in all levels -
    Easy
    Medium
    Hard
    👉 Link to questions -
    www.hackerrank...
    👉 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.co...
    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

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

  • @AshutoshKumaryt
    @AshutoshKumaryt  2 ปีที่แล้ว

    👉 SQL Portfolio Project Indian Census- Part 1
    th-cam.com/video/I3YvjFfn478/w-d-xo.html

  • @Fudfghhfghhhg
    @Fudfghhfghhhg 11 หลายเดือนก่อน +2

    SELECT ROUND(AVG(SALARY)) - ROUND(AVG(REPLACE(SALARY,0,''))) FROM EMPLOYEES;

  • @killua9903
    @killua9903 ปีที่แล้ว +1

    sir, the salary column is integer, And replace function takes string? How did it work could not understand?

  • @saket_saurav
    @saket_saurav ปีที่แล้ว +1

    i spent more than an hour considering that input as wrong one..now laughing loud on myself seeing this one line code...learnt a good thing today that we can check in reverse order also..thanks...

  • @shubhamgupta9323
    @shubhamgupta9323 6 หลายเดือนก่อน +1

    i used the below quey and it is showing answer - 2252 even after applyig CEIL function
    select CEIL(avg(salary) - avg(replace(salary,'0',''))) FROM EMPLOYEES;

  • @masalamad9554
    @masalamad9554 2 ปีที่แล้ว +1

    You made it very simple 😊, Thanks for the solution

  • @garimakushwaha8465
    @garimakushwaha8465 11 หลายเดือนก่อน

    REPLACE is a string function and the type of the salary column is integer so why do we use the replace function? and here 0 is not a character of a string so how it can be replaced with an empty string?

  • @Ramesh00300
    @Ramesh00300 2 ปีที่แล้ว +2

    @ashutosh Kumar- The query is throwing an error in SQL sever.

    • @AshutoshKumaryt
      @AshutoshKumaryt  2 ปีที่แล้ว

      You need to run code in hackerrank only if you are running in SQL server first you need to create the tables first

    • @Avadhut-nd9yz
      @Avadhut-nd9yz ปีที่แล้ว +1

      @@AshutoshKumaryt no this syntax doesn't work for sql server in hackerrank.

    • @Avadhut-nd9yz
      @Avadhut-nd9yz ปีที่แล้ว +1

      /* This will do the trick for MS SQL server */
      select ceiling(avg(salary) - avg(cast(replace(salary, 0,'') as int)))+1 from EMPLOYEES;

    • @keshavsood2676
      @keshavsood2676 2 หลายเดือนก่อน

      @@Avadhut-nd9yz Thanks bro

  • @jagendrasrivastava2263
    @jagendrasrivastava2263 ปีที่แล้ว

    Thanks for this video ☺️ keep going ☺️👍

  • @ipsitmalviya7222
    @ipsitmalviya7222 2 ปีที่แล้ว

    I run the following query in sql server :
    select CEILING(avg(salary)- avg(replace (salary,'0',''))) from employees
    error : Operand data type varchar is invalid for avg operator.
    the salary column is of integer data type in the table

    • @AshutoshKumaryt
      @AshutoshKumaryt  ปีที่แล้ว

      Run in the website ,it won't run in SQL server

    • @Avadhut-nd9yz
      @Avadhut-nd9yz ปีที่แล้ว

      @@AshutoshKumaryt if we select MS sql server at the top right corner in hackerrank this error is given.. it only works if we select MY sql there.

    • @Avadhut-nd9yz
      @Avadhut-nd9yz ปีที่แล้ว

      /* This will do the trick for MS SQL server */
      select ceiling(avg(salary) - avg(cast(replace(salary, 0,'') as int)))+1 from EMPLOYEES;

  • @fooddesires3281
    @fooddesires3281 ปีที่แล้ว +1

    Wrong solution