Oracle interview question difference between null functions | NVL vs NVL2 vs NULLIF vs COALESCE

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024
  • Difference between NVL,NVL2, NULLIF and COALESCE
    NVL function will check whether the first input parameter is null, if first input parameter is null then the function returns the second parameter value as output.
    NVL2 function will check the first parameter, and return second parameter if the first parameter is not null, otherwise returns third parameter.
    NULLIF will compare the input parameters ( first and second parameter ), and returns NULL of both are same, otherwise returns the first parameter value.
    COALESCE, returns the first not null expression in the given input parameters.
    --------------------------------------------------------------------------------------------------------
    List of all the SQL and PLSQL interview questions
    easy-learning-...

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

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

    These 4 5 7 minutes videos are better than reading hours and hours or going through 20 mins videos

  • @bharathipandian45
    @bharathipandian45 5 ปีที่แล้ว +4

    Hi siva, I have got few more questions 1. Difference between local and global index 2. Before we go for partitioning table what are the things we should analyse 3.where should I declare a procedure which should not be accessed by anyone 4. How to dynamically pass parameters to one cursor from another cursor

    • @SivaAcademy
      @SivaAcademy  5 ปีที่แล้ว

      @Bharathi, it's difficult to explain all of this in few lines, however I try my level best to answer in upcoming video

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

    Complex concepts easy explanation thanks sir keep making such types of videos that helps to many students

  • @RameshYadav-ei3kd
    @RameshYadav-ei3kd 4 ปีที่แล้ว +6

    I want this type of explanation to all concepts.....thanq.....

  • @i.ashokreddy8548
    @i.ashokreddy8548 2 ปีที่แล้ว

    explanation is awesome and the way of teaching is very good to uderstand for the beginner

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

    Hi sir your explanation is very well on each and every video and thank you very much to share with all

  • @vivektarab16
    @vivektarab16 4 หลายเดือนก่อน

    1:06 - NVL
    2:02 - In Case both values are NULL
    2:46 - NVL 2
    4:25 - NULLIF
    5:52 - Coalesce

  • @devanaidu9406
    @devanaidu9406 5 ปีที่แล้ว +5

    Please make partitions, cluster's and ,inline view concepts in detailed sir

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

    Hi Thank you for the so much informative videos.. I was asked a question in interview about difference between varchar and varchar2 datatype in oracle. Can you explain the difference please?

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

    Nice videos.
    Please include
    NULLIF(NULL, NULL)
    in this video.
    Obviously, the result we know based on previous example but it would be nice to include that.

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

      Sure, for subsequent videos I will add all possible scenarios 👍

    • @m.s.k5300
      @m.s.k5300 4 ปีที่แล้ว

      Result null

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

      It throw inconsistent datatype..thumb rule for nullif is first parameter should not be null

  • @4ashutosh
    @4ashutosh 5 ปีที่แล้ว +1

    Please let me know how many parameters can we put in the COALESCE, GREATEST and LEAST functions ?

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

    Very useful information.. Thanks for this video

  • @pruthvisarkar2534
    @pruthvisarkar2534 3 ปีที่แล้ว

    Write a query to display Salesid , SalesNo ,discount ,price of a mobile. if there is no discount for a mobile the display it as"not applicable"......use COALESCE function...!Sir can u help me with this query?

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

    Thanks a lot.. very informative and easy to learn..

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

      Welcome bro

  • @kalpeshpatil4321
    @kalpeshpatil4321 4 ปีที่แล้ว

    Can you please make a video on regular expression and type of regular expression with small example in easy way to get it understand.
    It will be very thankful, if you make video on this.
    Thanks in advance cheers.

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

    Jay Ho Jay Hind 🇮🇳

  • @madrasboykumaran
    @madrasboykumaran 3 ปีที่แล้ว

    Great explantions sir this content helped in interviews superbbb 😊😎

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

      My pleasure 💐💐👍🙏

  • @satrinakelley-jordan6418
    @satrinakelley-jordan6418 หลายเดือนก่อน

    Great explanation, thank you!

  • @mupparthiuma5798
    @mupparthiuma5798 4 ปีที่แล้ว

    hi sir..can you take online classes
    ?

  • @dineshkumar-vp9dm
    @dineshkumar-vp9dm 4 ปีที่แล้ว

    What is different between varchar2 and varchar explain

  • @keerthin9362
    @keerthin9362 3 ปีที่แล้ว

    Hi sir, can you explain how to show nulls in all columns if I don't have queried data in a table.

    • @kwkw5711
      @kwkw5711 3 ปีที่แล้ว

      Union with select null as col1, select col2 from dual

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

    Thank you Sir, for your great explanation of these functions.

  • @martinsuresh5048
    @martinsuresh5048 6 ปีที่แล้ว

    very helpful information hatsoff sir

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

    Thank you so much for good explanation video...!!

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

      Thank you and welcome

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

    What is the result of NULLIF( NULL,NULL)
    since two nulls are not equal

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

      As he said First argument should not have null. If so it throws error

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

    As always in detail supeerrb !!!!

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

    Could you please make video on DBMS_parallel_execute and DBMS_jobs procedure.

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

      Sure, please stay tuned

  • @ravipatisrikanth8331
    @ravipatisrikanth8331 4 ปีที่แล้ว

    select coalsce('siva',1,2,3,4,5) as result from dual; why this one is not execute , tell me the reason

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      Data type of all the parameters should be consistent,
      try this query
      select coalesce('A','1','2','3','4','5') from dual;

    • @ravipatisrikanth8331
      @ravipatisrikanth8331 4 ปีที่แล้ว

      Thank you so much

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

    good
    please make video on performance tuning

    • @SivaAcademy
      @SivaAcademy  6 ปีที่แล้ว +3

      Thanks Sagar, Ya I am in process of creating PT with right examples, WIll be posting soon.

  • @M_M_Vlogs
    @M_M_Vlogs 3 ปีที่แล้ว

    can we get this as pdf ?

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

    excellent videos thank you sir

  • @sannidhirao1281
    @sannidhirao1281 3 ปีที่แล้ว

    Thank you som uch for the easy explanation

  • @pritisingh8639
    @pritisingh8639 4 ปีที่แล้ว

    Nice video ...very well explained

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

    Managements wants to know the manager of each resort.
    Display resortid , resort name, manager name and his phone. Sort the output in ascending order of resort id. Give alias to manager name as MANAGERNAME and phone as PHONENO.
    If manager is not available then display manager name 'NA'. If phone number is not available then display as 'NA'.
    Sir can I get an answer for this please

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว +3

      select resortid , resort_name, nvl(manager_name,'NA') as "MANAGERNAME" , nvl(phone,'NA') as "PHONENO"
      from table_name
      order by resortid asc

  • @udayreddybarri6642
    @udayreddybarri6642 4 ปีที่แล้ว

    What is difference between for and forall

    • @SivaAcademy
      @SivaAcademy  4 ปีที่แล้ว

      Sure, please stay tuned, will add new video for this

  • @bharathipandian45
    @bharathipandian45 3 ปีที่แล้ว

    I need unix interview question ans production support related interview questions

  • @ashishmishraaaa
    @ashishmishraaaa 3 ปีที่แล้ว

    Best Explanation!

  • @mallikarjunam3239
    @mallikarjunam3239 5 ปีที่แล้ว

    Thank you so much Sir for your information

  • @anandhineema8278
    @anandhineema8278 5 ปีที่แล้ว

    in real time projects , where its been used.Please xplain bro

    • @SivaAcademy
      @SivaAcademy  5 ปีที่แล้ว +3

      @Anandhi, "NVL", and "coalesce" functions are widely used, and most of the SQL developers would have used it day to day sql queries, however nullif and nvl2 are rarely used, depends on the functionality.
      NVL - will be used when ever you want to have a default value for nulls, for eg, if the date is null, you can consider sysdate as default value.
      coalesce - To get the fist not null expression in the given list of values, for eg, NVL( mobile_no1,mobile_no2, LAN_LINE_NO, fax_no,0), to get the fist not null value of given list of contact numbers.....

  • @niranjandhavalikar
    @niranjandhavalikar 4 ปีที่แล้ว

    Thank You!!! Amazing explanation

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

      Thanks for your comments 🙏 🙏🙏

  • @devanaidu9406
    @devanaidu9406 5 ปีที่แล้ว

    Hi sir Please make partitions, cluster's and ,inline view concepts in detailed asap sir

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

      Sure, please stay tuned

    • @devanaidu9406
      @devanaidu9406 5 ปีที่แล้ว

      @@SivaAcademy tq sir

  • @bidhubhusanpolai3695
    @bidhubhusanpolai3695 3 ปีที่แล้ว

    Nice understanding sir

  • @sureshraina321
    @sureshraina321 4 ปีที่แล้ว

    you nailed it sir thank you sir

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

    very good explanation

    • @SivaAcademy
      @SivaAcademy  5 ปีที่แล้ว

      @Saptarishi, Thanks for your comment :-), --Siva

  • @pavanjoshi2356
    @pavanjoshi2356 5 ปีที่แล้ว

    Nice explained

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

    Nice

  • @udayreddybarri6642
    @udayreddybarri6642 4 ปีที่แล้ว

    Pls send for and forall

  • @vishnumishra2219
    @vishnumishra2219 3 ปีที่แล้ว

    thnkx a lot

  • @vivektarab1959
    @vivektarab1959 4 วันที่ผ่านมา

    1:06 - NVL
    2:02 - In Case both values are NULL
    2:46 - NVL 2
    4:25 - NULLIF
    5:52 - Coalesce

  • @bharathipandian45
    @bharathipandian45 3 ปีที่แล้ว

    I need unix interview question ans production support related interview questions