Pattern Matching in SQL | Ep-5 | Top 20 SQL Interview Questions | GeeksforGeeks

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 15

  • @anupamagautam1395
    @anupamagautam1395 3 роки тому +10

    This entire playlist is soo amazing!

  • @manavigowda3349
    @manavigowda3349 Місяць тому

    Thank you so much sir

  • @praveenj3112
    @praveenj3112 5 років тому +2

    Thanks for making this video

  • @anuragmohanty1238
    @anuragmohanty1238 2 роки тому

    Very Nice

  • @gauravmishra8782
    @gauravmishra8782 Рік тому

    done

  • @balajisundar9867
    @balajisundar9867 9 місяців тому +1

    --5. Like operator
    select * from employee where emp_name like 'a%'
    select * from employee where emp_name like '%m'
    select * from employee where emp_name like '%m%'
    select * from employee where emp_name not like '%m%'

  • @jaswindersingh-zh8qr
    @jaswindersingh-zh8qr 3 роки тому

    name salary
    A 100
    B 200
    C 300
    A 400
    B 500
    C 600
    A 700
    B 800
    C 900
    A 1000
    B 1100
    C 1200
    Bro how to find the third highest salary group by name

    • @kumarshashwat9626
      @kumarshashwat9626 3 роки тому

      Try this ;
      SELECT SUM(salary), name
      FROM table
      GROUP BY name
      ORDER BY name DESC
      OFFSET 2
      LIMIT 1
      ## This won't work if you have two individuals at the third rank, for that watch the second video of this playlist.

    • @aswinimohanty1507
      @aswinimohanty1507 3 роки тому

      (select max(salary)from employee where salary(select max(salary)from employee);
      or
      SELECT name, salary FROM Employee e1 WHERE 3-1 = (SELECT COUNT(DISTINCT salary) FROM Employee e2 WHERE e2.salary > e1.salary)

    • @dheerajn8794
      @dheerajn8794 3 роки тому

      SELECT SALARY FROM
      (SELECT DISTINCT SALARY FROM TABLE ORDER BY SALARY DESC LIMIT 3) AS TB2
      ORDER BY TB2.SALARY
      LIMIT 1

    • @sujanpoojary5284
      @sujanpoojary5284 3 роки тому

      Get the top 3 highest salery by group by name the get min from them.

    • @sairajeev7495
      @sairajeev7495 3 роки тому

      Use dense_rank for these cases
      select * from (select name, salary, dense_rank() over (partition by name order by salary desc) rankID from emp) sub where sub.rankID = 3;