Difference Between SQL Views vs Materialized Views | Frequently Asked SQL Interview Question

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 มิ.ย. 2024
  • In this video we will understand SQL views and difference Between SQL Views vs Materialized Views. This is a very frequently asked SQL interview question. This is the only video you need to answer this question in your next SQL interview.
    script:
    CREATE TABLE orders (
    order_id INT,
    order_date DATE,
    product_name VARCHAR(20),
    sales INT
    );
    INSERT INTO orders (order_id, order_date, product_name, sales) VALUES
    (1, '2023-01-15', 'Laptop', 1200),
    (2, '2023-01-17', 'Smartphone', 800),
    (3, '2023-01-20', 'Tablet', 600),
    (4, '2023-02-05', 'Smartwatch', 300),
    (5, '2023-02-08', 'Headphones', 150),
    (6, '2023-02-10', 'Monitor', 200),
    (7, '2023-02-15', 'Keyboard', 80),
    (8, '2023-02-20', 'Mouse', 50),
    (9, '2023-03-01', 'Printer', 220),
    (10, '2023-03-05', 'Camera', 500);
    Zero to hero(Advance) SQL Aggregation:
    • All About SQL Aggregat...
    Most Asked Join Based Interview Question:
    • Most Asked SQL JOIN ba...
    Solving 4 Trick SQL problems:
    • Solving 4 Tricky SQL P...
    Data Analyst Spotify Case Study:
    • Data Analyst Spotify C...
    Top 10 SQL interview Questions:
    • Top 10 SQL interview Q...
    Interview Question based on FULL OUTER JOIN:
    • SQL Interview Question...
    Playlist to master SQL :
    • Complex SQL Questions ...
    Rank, Dense_Rank and Row_Number:
    • RANK, DENSE_RANK, ROW_...
    #sql #dataengineer

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

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

    Please do like the video 😊

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

      How can we schedule the refresh of the materialized view?

    • @n.dhanuskar2393
      @n.dhanuskar2393 23 วันที่ผ่านมา

      Sir, can I get 10-15 min from your life I am confused for my career path I work as database developer from last 2y.next what to do I don't understand, Please can you guide

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

    Insightful

  • @subhajitdey6806
    @subhajitdey6806 28 วันที่ผ่านมา

    man dope data contents are coming , need more of this , waiting...........

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

    Thank you so much Ankit sir for this wonderful video and clearing the concept of views in SQL..
    I'm pretty much sure I'll not forget it now..

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

    Nice video bro it's good..❤

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

    Thanks for the great explanation!

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

    Thank You Very Much Sir

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

    very good brother!

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

    Thanks Ankit for the video. Waiting for the Redshift tutorial.

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

    Man this is JUST MIRACLE❤

  • @captainsaver69
    @captainsaver69 21 วันที่ผ่านมา

    Thank you sir❤

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

    Thankyou sir!

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

    Excellent explanation Ankit. Thanks a lot for providing such amazing knowledgeable videos.

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

    Good explanation.. keep posting such many interesting videos 👍

  • @Leo-qo5hk
    @Leo-qo5hk หลายเดือนก่อน

    Hello Sir great explanation please also make a videso on stored procedures and index as well

  • @CodeElephant-codeMadeEasy
    @CodeElephant-codeMadeEasy หลายเดือนก่อน

    great explanation

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

      Glad you think so!

  • @rohansingh1584
    @rohansingh1584 27 วันที่ผ่านมา

    Hello please also make the playlist on case study using SQL It will help everyone and me too
    It will be great if u explain this 😊

  • @mahesh97413
    @mahesh97413 29 วันที่ผ่านมา

    Bro, can you please make some videos on SQL stored procedure. I couldn't find tutorials anywhere. If you explain it, we can easily learn it. I am fond of your teaching.

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

    Thank you so much 🙏 ankit😊 You explained very clearly

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

      My pleasure 😊

  • @mohammedvahid5099
    @mohammedvahid5099 หลายเดือนก่อน +3

    Wht is difference between snowflake materialized views and SQL materialized views bro can u explain please

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

      The concept is the same. However Snowflake’s materialized views are automatically refreshed whenever the base tables change, without requiring explicit commands from the user.

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

    Can somebody upload the "Returns" table inset query!

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

    What would be the difference between Views and CTE then ?

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

      1.Views are database objects while cte is not a database object rather it is temporary named result set generated on query for which it is defined.
      2.Views are stored on disk while cte are stored on memory(Ram) which is a temporary storage.
      3.Views can be referenced from anywhere within the database in which it is created while cte can be referenced only within the boundary of the statement for which it is defined.
      4.Views can't be recursive while cte can be recursive.

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

      From a query execution standpoint:
      1. Views are virtual and/or actual tables u can update or alter whereas CTE are temporary result you can store while executing a query
      2. Views can be called independently whereas, CTEs cannot be called independently (they are dependent on your full query execution)
      3. CTEs results are gone once your SQL session is closed whereas views results remain as is

  • @sarvesh714
    @sarvesh714 29 วันที่ผ่านมา

    what is the diff between a View and a CTE?

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

    Hi Ankit, Are you doing videos for Snowflake

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

    Great demo as always.
    Could you please make another video explaining the backend things of how altering a view (performing update to views) changes the contents of the base table as well
    TIA!

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

    What about materialised views in Sql server

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

      It's unsupported in SQL server. In SSMS there are index views only.