<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sanjay Singh on Medium]]></title>
        <description><![CDATA[Stories by Sanjay Singh on Medium]]></description>
        <link>https://medium.com/@sanjays263?source=rss-dd2cbb8957ce------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*IpzUhmFvsf5bsSOA</url>
            <title>Stories by Sanjay Singh on Medium</title>
            <link>https://medium.com/@sanjays263?source=rss-dd2cbb8957ce------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:32:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sanjays263/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SQL Constraints Explained]]></title>
            <link>https://medium.com/@sanjays263/sql-constraints-explained-fb1f14b48d48?source=rss-dd2cbb8957ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb1f14b48d48</guid>
            <category><![CDATA[constraints]]></category>
            <category><![CDATA[sql-constraint]]></category>
            <category><![CDATA[mysql-constrain]]></category>
            <dc:creator><![CDATA[Sanjay Singh]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 09:12:45 GMT</pubDate>
            <atom:updated>2026-08-17T09:22:58.152Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>SQL</strong> <strong>constraints </strong>are rules applied to columns or tables to enforce data integrity and data quality.</p><p><strong>Types of SQL Constraints</strong></p><ol><li>PRIMARY KEY</li><li>FOREIGN KEY</li><li>UNIQUE</li><li>NOT NULL</li><li>CHEK</li><li>DEFAULT</li></ol><p><strong>PRIMARY KEY :-</strong></p><p>A <strong>PRIMARY KEY</strong> is uniquely identifies each record in a table.</p><pre>CREATE TABLE employee(<br>  employeeID INT PRIMARY KEY,<br>  employeeName VARCHAR(100),<br>  salary DECIMAL(10,2)<br>);</pre><p>Trying to insert another employee with employeeID =101 will violate the primary key constraint.</p><p><strong>FOREIGN KEY :-</strong></p><p>A <strong>FOREIGN KEY</strong> create a relationship between two tables.</p><pre>CREATE TABLE departments(<br>  departmentID INT PRIMARY KEY,<br>  departmentName VARCHAR(100)<br>);<br><br>NOW CREATE AN EMPLOYEE TABLE<br><br>CREATE TABLE employees(<br>  employeeId INT PRIMARY KEY,<br>  employeeName VARCHAR(100),<br>  departmentID INT,<br>  FOREIGN KEY(departmentID)<br>    REFERENCES departments(departmentID)<br>);</pre><p>The departmentID in employees references departmentID in departments.</p><p><strong>UNIQUE :-</strong></p><p>The <strong>UNIQUE </strong>constraint ensures that values in a column are not duplicated.</p><pre>CREATE TABLE employee(<br>  employeeID INT PRIMARY KEY,<br>  employeeName VARCHAR(100),<br>  email VARCHAR(50) UNIQUE<br>);</pre><p>Two employee cannot have the same email id.</p><p><strong>NOT NULL :-</strong></p><p>The <strong>NOT NULL</strong> constraint prevents a column from containing <strong>NULL</strong>.</p><pre>CREATE TABLE employee(<br>  employeeID INT PRIMARY KEY,<br>  employeeName VARCHAR(100) NOT NULL<br>);</pre><p>This means employeeName must have a value.</p><p><strong>CHECK :-</strong></p><p>The <strong>CHECK </strong>constraint ensure that data satisfies a specified condition.</p><pre>CREATE TABLE employee(<br>  employeeID INT PRIMARY KEY,<br>  employeeName VARCHAR(100),<br>  salary DECIMAL(10,2)<br>    CHECK(salary &gt; 0)<br>);</pre><p>Now this would violate the constraint.</p><p><strong>DEFAULT :-</strong></p><p>The <strong>DEFAULT </strong>constraint provides a default value when the user doesn’t provide one.</p><pre>CREATE TABLE employee(<br>  employeeID INT PRIMARY KEY,<br>  employeeName VARCHAR(100),<br>  country VARCHAR(100) DEFAULT &#39;India&#39;<br>);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb1f14b48d48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Command Categories: DDL, DML, DQL, DCL & TCL]]></title>
            <link>https://medium.com/@sanjays263/sql-command-categories-ddl-dml-dql-dcl-tcl-2d2cef142311?source=rss-dd2cbb8957ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d2cef142311</guid>
            <category><![CDATA[transaction-control]]></category>
            <category><![CDATA[data-control-language]]></category>
            <category><![CDATA[data-definition-language]]></category>
            <category><![CDATA[sql-command]]></category>
            <category><![CDATA[data-manipulation]]></category>
            <dc:creator><![CDATA[Sanjay Singh]]></dc:creator>
            <pubDate>Sun, 16 Aug 2026 08:02:08 GMT</pubDate>
            <atom:updated>2026-08-16T08:44:22.284Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>SQL</strong> is one of the most important skill for <strong>Data Engineer</strong>, <strong>Data Analyst</strong>, <strong>BI developer</strong> and <strong>database developer</strong>.</p><p>when working with databases, we use different type of <strong>SQL</strong> commands for different purpose.</p><ol><li><strong>DDL — Data Definition Language</strong></li></ol><p>DDL is used to define and modify the structure of database objects, such as tables. Common DDL commands include:</p><p><strong>CREATE :-</strong></p><p><strong>CREATE </strong>is use to create a new database object.</p><pre>CREATE TABLE employee(<br>  EmployeeID INT,<br>  EmployeeName VARCHAR(100),<br>  Department VARCHAR(50),<br>  Salary DECIMAL(10,2)<br>);</pre><p><strong>ALTER :-</strong></p><p><strong>ALTER </strong>is use to modify the structure of an existing table.</p><pre>ALTER TABLE employee<br>ADD joiningdate DATE;</pre><p><strong>TRUNCATE :-</strong></p><p><strong>TRUNCATE </strong>remove all the rows from the table while keeping the table structure.</p><pre>TRUNCATE TABLE employee;</pre><p>DROP :-</p><p>DROP remove the database object itself.</p><pre>DROP TABLE employee;</pre><p><strong>2. DML — Data Manipulation Language</strong></p><p>DML is used to insert, update and delete the data inside the table.</p><p><strong>INSERT :-</strong></p><p>Used to INSERT records into a table.</p><pre>INSERT INTO employee(EmployeeID, EmployeeName, Department,Salary)<br>VALUES (101, RAM, &#39;IT&#39;, 60000);</pre><p><strong>UPDATE :-</strong></p><p>Used to modify existing records.</p><pre>UPDATE emoployee<br>SET salary = 65000<br>WHERE EmployeeID = 101;</pre><p>The <strong>WHERE </strong>condition is important. without it, the update may affect every row.</p><p><strong>DELETE :-</strong></p><p>Used to remove record from a table.</p><pre>DELETE from employee<br>WHERE employeeID = 101;</pre><p><strong>3. DQL — Data Query Language</strong></p><p><strong>DQL</strong> is used to reterive the data from the database.</p><pre>SELECT * <br>FROM employee;<br><br>OR<br><br>SELECT employeeName, Department, Salary<br>FROM employee;</pre><p><strong>4. DCL — Data Control Language</strong></p><p>DCL is used to control access and permission on database objects.</p><p><strong>GRANT :-</strong></p><p><strong>GRANT </strong>provide permission to user or role.</p><pre>GRANT SELECT ON employee TO user1;</pre><p>This gives <strong>user1</strong> permission to read data from the employee table.</p><p><strong>REVOKE :-</strong></p><p><strong>REVOKE </strong>remove previously granted permission.</p><pre>REVOKE SELECT ON employee FROM user1;</pre><p><strong>5. TCL — Transaction Control Language</strong></p><p><strong>TCL </strong>is used to manage database transactions.</p><p><strong>COMMIT :-</strong></p><p><strong>COMMIT </strong>permanently save the changes made in a transaction.</p><pre>BEGIN TRANSACTION;<br><br>UPDATE employee <br>SET salary = 70000<br>WHERE employeeID = 101<br><br>COMMIT;</pre><p><strong>ROLLBACK :-</strong></p><p><strong>ROLLBACK </strong>reverses changes that have not yet been commited.</p><pre>BEGIN TRANSACTION;<br><br>UPDATE employee<br>SET salary = 80000<br>WHERE employeeID = 101<br><br>ROLLBACK;</pre><p>The salary change will be undone.</p><p><strong>SAVEPOINT :-</strong></p><p>A <strong>SAVEPOINT </strong>allows us to create point within a transaction to which we can rollback.</p><pre>BEGIN TRANCSACTION;<br><br>UPDATE employee<br>SET salary = 70000<br>WHERE employeeID = 101;<br><br>SAVEPOINT salaryUpdate;<br><br>UPDATE employee<br>SET salary = 75000<br>WHERE employeeID = 103;<br><br>ROLLBACK TO SAVEPOINT salaryUpdate;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d2cef142311" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SCD (Slowly Changing Dimension)]]></title>
            <link>https://medium.com/@sanjays263/scd-slowly-changing-dimension-bb26c42a01f1?source=rss-dd2cbb8957ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb26c42a01f1</guid>
            <category><![CDATA[slowly-changing-dimension]]></category>
            <category><![CDATA[scd-type-2]]></category>
            <category><![CDATA[slowly-change]]></category>
            <category><![CDATA[scd]]></category>
            <dc:creator><![CDATA[Sanjay Singh]]></dc:creator>
            <pubDate>Thu, 13 Aug 2026 09:56:28 GMT</pubDate>
            <atom:updated>2026-08-13T10:17:19.970Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is Slowly Changing Dimension?</strong></p><p>A <strong>slowly changing dimension</strong> is a dimension that contains attributes whose values change over time, and <strong>SCD</strong> defines how those changes should be handled.</p><ol><li><strong>SCD Type — 0 Fixed Dimension </strong>:-</li></ol><p>In type 0, the original value never change.</p><p><strong>Suppose we have:-</strong></p><p>CustomerID = 101</p><p>Country = India</p><p>Even if the customer later move to another country, we keep:</p><p>CustomerID = 101</p><p>Country = India</p><p><strong>When Type 0 is useful :-</strong></p><p>Original Country</p><p>Date of Birth</p><p>Original customer registration location.</p><p>2. <strong>SCD Type — 1 Overwrite the existing Value </strong>:-</p><p>SCD type -1 is simplest approach.</p><p>when the value changes, we simply overwrite the old value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*P87xAdApwDlf2ZKYCa3bUA.png" /></figure><p>The customer move to Bangalore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*B1xUncOV36C8d2RJV1AbOg.png" /></figure><p>The old value is lost.</p><pre>UPDATE Dim_customer<br>SET city = &#39;Bangalore&#39;<br>where Customer_id = 101;<br><br>OR USING MERGE :-<br>MERGE INTO dim_customer AS target<br>USING stating_customer AS source<br>ON target.customer_id = source.customer_id<br><br>WHEN MATCHED THEN<br>UPDATE SET<br>target.name = source.name<br>target.city = source.city<br><br>WHEN NOT MATCHED THEN<br>INSERT (customer_id, name, city)<br>VALUES (source.customer_id, source.name, source.city)<br></pre><p>3. <strong>SCD Type — 2 Maintain complete history </strong>:-</p><p>SCD Type -2 is one of the most commonly used SCD approaches in real-word data engineering projects.</p><p>Instead of Updating the existing record, we:</p><p>A) Expire the old record</p><p>B) Insert a new record</p><p>C) Maintain effective date</p><p>D) Maintain a current recort flag</p><p>Suppose initially :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*Cg8SWVPa6xlg7aFyJ8tChw.png" /></figure><p><strong>Rahul </strong>move to <strong>Bangalore </strong>on July 1, 2025.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*qTriG9wJqEEJ62Iw01Atbw.png" /></figure><p>Now we have the complete history.</p><p>4. <strong>SCD Type — 3 Maintain Limited history </strong>:-</p><p>Type — 3 stores the current value and previous value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*Lvdi8a1NKXg8FVPN6ui4YQ.png" /></figure><p>If Rahul move again:</p><p>Bangalore → Hyderabad</p><p>the table becomes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*ttpUfFgn89ccAdq8Ip6N2Q.png" /></figure><p>Delhi is no longer available</p><p>Type — 3 maintains the limited history, not complete history.</p><p>5. <strong>SCD Type — 4 Separate History Table </strong>:-</p><p>In Type — 4, the current data and historical data are stored separately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*7LCHBN7MUmHLMYXCGwOAfA.png" /></figure><p><strong>Current Table:-</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*ok9DJTinNCMvyp3iiocgFw.png" /></figure><p><strong>Historical Table :-</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*l6EB7HnsiAdHujf8NQKK6A.png" /></figure><p>This approach can we useful when current-state queries are frequent and historical data needs to be managed separately.</p><p>6. <strong>SCD Type — 6 Hybrid Approach </strong>:-</p><p>Type — 6 combine caraterstics of</p><p>Type -1</p><p>Type -2</p><p>Type -3</p><p>it can maintain :</p><p>current value</p><p>prevous value</p><p>historical records</p><p>it is more complex than Type -1 or Type -2.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb26c42a01f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Window Function]]></title>
            <link>https://medium.com/@sanjays263/window-function-c430e8f54857?source=rss-dd2cbb8957ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/c430e8f54857</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[window-functions]]></category>
            <category><![CDATA[sql-window-functions]]></category>
            <dc:creator><![CDATA[Sanjay Singh]]></dc:creator>
            <pubDate>Thu, 06 Aug 2026 10:54:04 GMT</pubDate>
            <atom:updated>2026-08-06T10:54:04.033Z</atom:updated>
            <content:encoded><![CDATA[<p>A <strong>Window Function</strong> performs calculations across a set of rows related to the current row <strong>without collapsing the result into a single row</strong>.</p><p><strong>ROW_NUMBER :-</strong> Assign a unique number to every row.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*E6wYQBIEPrYZs177GrrDog.png" /></figure><pre>select *,<br>  row_number() over(PARTITION BY department ORDER BY salary DESC)as row_num<br>  from employee;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*KieIbf4jiHuDk2Xs5doH6A.png" /></figure><p><strong>RANK :-</strong> Assign the same rank to duplicate value.</p><pre>SELECT *,<br>  RANK() OVER(PARTITION BY department ORDER BY salary DESC) as rank<br>  FROM employee;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*JjxAGJY-kN-iHuYBEF5Y0w.png" /></figure><p><strong>DENSE_RANK() :-</strong> Work like rank but don’t skip number.</p><pre>SELECT *,<br>  DENSE_RANK() OVER(PARTITION BY department ORDER BY salary DESC) AS dens_rnk<br>  FROM employee;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*jMC47cd2SPsofnlQxeQgOA.png" /></figure><p><strong>LAG :-</strong> Return the previous row value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*_9o6hIdNBBankbOo7W3iRA.png" /></figure><pre>SELECT MONTH,<br>    sales,<br>    LAG(sales) over(ORDER BY MONTH) as Previous_month_sales<br>    FROM sales;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*ItN1CDKZAQs7fEp3WAgHHg.png" /></figure><p>LEAD() :- Return the next row value.</p><pre>SELECT *,<br>  LEAD(sales) over(ORDER BY MONTH) AS Next_month_sales<br>  FROM sales;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*RHTUhfHUond4Bems-0bi3A.png" /></figure><p><strong>FIRST_VALUE() :-</strong> Return the first value in the window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*aX7A9JdNycsodx5OhtTJLA.png" /></figure><pre>SELECT *,<br>  FIRST_VALUE(Amount) OVER(PARTITION BY Customer ORDER BY OrderDate) AS first_order_amt<br>  FROM orders;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*5P3aq30mfdob4VNBwDlutQ.png" /></figure><p><strong>LAST_VALUE() :-</strong> Return the last value in the window.</p><pre>SELECT *,<br>  LAST_VALUE(Amount) OVER(PARTITION BY Customer ORDER BY OrderDate <br>  ROWS BETWEEN UNBOUNDED PRECEDING<br>  AND UNBOUNDED FOLLOWING  <br>) AS latest_order_amt<br>FROM orders;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*Vrb8s2a6FLVkm__hkq4REw.png" /></figure><p><strong>NTILE() :-</strong> Divide rows into equal groups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*6UyLRwgaJ0_WLd36XbbpoQ.png" /></figure><pre>SELECT *,<br>  NTILE(4) OVER(ORDER BY Marks DESC)AS Quartile<br>FROM Student;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*MhOdHSPSJvKUSjmMqDimgg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c430e8f54857" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RDD (Resilient Distributed Dataset)]]></title>
            <link>https://medium.com/@sanjays263/rdd-resilient-distributed-dataset-2a48d38d408f?source=rss-dd2cbb8957ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a48d38d408f</guid>
            <dc:creator><![CDATA[Sanjay Singh]]></dc:creator>
            <pubDate>Wed, 05 Aug 2026 12:32:16 GMT</pubDate>
            <atom:updated>2026-08-05T12:32:16.251Z</atom:updated>
            <content:encoded><![CDATA[<p>In apache spark RDD(Resilient Distributed Dataset) is the fundamental data structure of spark.</p><p>It is an immutable, distributed collection of data that is processed in parallel across nodes in a cluster.</p><p><strong>Resilient :-</strong> If spark is lost due to node failure, spark can recreate it using lineage.</p><p><strong>Distributed :-</strong> Data is divided into multiple partition and store across different machine.</p><p><strong>Dataset :-</strong> A collection of records.</p><p>example :- Suppose we have a list of numbers</p><p>[10, 20, 30, 40, 50]</p><p>spark divided into partition:-</p><p><strong>partition 1:-</strong> [10, 20]</p><p><strong>partition 2:-</strong> [30,40]</p><p><strong>partition 3:-</strong> [50]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a48d38d408f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Delta Tables in Databricks: The Complete Guide for Data Engineers]]></title>
            <link>https://medium.com/@sanjays263/delta-tables-in-databricks-the-complete-guide-for-data-engineers-85e0fea7bc55?source=rss-dd2cbb8957ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/85e0fea7bc55</guid>
            <category><![CDATA[azure-delta-table]]></category>
            <category><![CDATA[delta-tables]]></category>
            <category><![CDATA[databricks-delta-lake]]></category>
            <dc:creator><![CDATA[Sanjay Singh]]></dc:creator>
            <pubDate>Mon, 03 Aug 2026 05:02:25 GMT</pubDate>
            <atom:updated>2026-08-03T05:02:25.571Z</atom:updated>
            <content:encoded><![CDATA[<p>A <strong>Delta Table</strong> is a table stored in the <strong>Delta format</strong>, which is built on top of <strong>Apache Parquet</strong>.</p><p>Unlike a regular Parquet table, a Delta Table maintains a <strong>transaction log</strong> that records every operation performed on the table.</p><p>This transaction log enables advanced capabilities such as:</p><ul><li>ACID Transactions</li><li>Time Travel</li><li>Schema Enforcement</li><li>Schema Evolution</li><li>Data Versioning</li><li>Rollback</li><li>Efficient Updates and Deletes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*tFrHwA_M-e-IfuwMIJx16Q.png" /></figure><p>A delta table consist of <strong>parquet data</strong> files &amp; <strong>_delta_log</strong> dictionary that stores transaction metadata.</p><p><strong>What is _delta_log in delta table ?</strong></p><p>it stores the transaction history, file additions, file removals, schema changes, Metadata, commit history.</p><p>Whenever you perform operation such as INSERT, UPDATE, DELETE or MERGE Delta lake records the changes in this log instead of modifying existing files directly.</p><p><strong>Key features of Delta Table</strong></p><ol><li><strong>ACID Transaction :-</strong> Delta lake ensure that every transaction is- Atomic, Consistent, Isolation and Durable.</li></ol><p><strong>2. Time Travel :- </strong>Time travel allows you to query previous version of delta table.</p><pre>select * <br>from sales.customer<br>VERSION as of 5;</pre><p>or by timestamp</p><pre>select * <br>from sales.customer<br>TIMESTAMP AS of &#39;2026-08-2025&#39;</pre><p><strong>3. Schema Enforcement :-</strong> Delta Validates incoming data against the existing schema.</p><p><strong>4. Schema Evaluation :- </strong>Schema evaluation allows the table schema to grow when required.</p><pre>df.write\<br>  .option(&quot;mergeSchema&quot;,&quot;true&quot;)\<br>  .format(&quot;delta&quot;)\<br>  .mode(&quot;append&quot;)\<br>  .save(&quot;/mnt/delta/customer&quot;)</pre><p><strong>5. Version History :-</strong> Every write operation creates a new version of the delta table.</p><pre>DESCRIBE HISTORY Sales.customer;</pre><p><strong>6. Update :-</strong> Unlike parquet file, Delta tables support row-level updates.</p><pre>UPDATE sales.customer<br>SET city = &#39;Delhi&#39;<br>where cust_id = 101;</pre><p><strong>7. Delete :-</strong> Rows can be deleted directly.</p><pre>DELETE from sales.customer<br>where cust_id = 101;</pre><p><strong>8. Merge (UPSERT):- </strong>The merge statement combines INSERT and UPDATE operations.</p><pre>MERGE INTO sales.customer AS target<br>USING sales.customer_update AS source<br>ON target.cust_id = source.cust_id<br><br>WHEN MATCHED THEN<br>UPDATE SET *<br><br>WHEN NOT MATCHED THEN <br>INSERT *;</pre><p><strong>9. Optimize:- </strong>Optimize compacts many small files into fewer larger files.</p><pre>OPTIMZE sales.customer;</pre><p><strong>10. Z-Ordering :-</strong> Z-ordering improves data skipping by physically organizing data based on frequently filter column.</p><pre>OPTIMIZE sales.customer<br>ZORDER BY (cust_id);</pre><p>11. Vaccum :- vaccum removes old, unreferenced data files after the retention period.</p><pre>VACCUM sales.customer;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85e0fea7bc55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Clusters in Databricks: A Complete Guide for Data Engineers]]></title>
            <link>https://medium.com/@sanjays263/understanding-clusters-in-databricks-a-complete-guide-for-data-engineers-054ab6914f4a?source=rss-dd2cbb8957ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/054ab6914f4a</guid>
            <category><![CDATA[cluster]]></category>
            <category><![CDATA[databrick-cluster]]></category>
            <category><![CDATA[azure-cluster]]></category>
            <dc:creator><![CDATA[Sanjay Singh]]></dc:creator>
            <pubDate>Sun, 02 Aug 2026 16:09:24 GMT</pubDate>
            <atom:updated>2026-08-02T16:09:24.397Z</atom:updated>
            <content:encoded><![CDATA[<p>A <strong>Databricks Cluster</strong> is a group of virtual machines (VMs) consisting of one <strong>Driver Node</strong> and one or more <strong>Worker Nodes</strong>.</p><p>The driver coordinates the work, while worker nodes execute tasks in parallel.</p><p>Think of a cluster as a team:</p><ul><li>Driver = Team Leader</li><li>Workers = Team Members</li></ul><p>The leader assigns work, and the team completes it together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*nqgBtraM4XAGQPuYhUJByg.png" /></figure><p><strong>Components of Cluster</strong></p><p><strong>Driver Node :- </strong>The Driver Node is the brain of the cluster.</p><ul><li>Runs Spark Driver</li><li>Creates SparkSession</li><li>Converts code into jobs</li><li>Creates stages and tasks</li><li>Schedules tasks</li><li>Collects results</li><li>Maintains metadata</li></ul><p><strong>Worker Node :- </strong>Worker nodes perform the actual computation.</p><ul><li>Execute Spark tasks</li><li>Read data</li><li>Transform data</li><li>Write output</li><li>Cache data</li><li>Store shuffle data</li></ul><p><strong>Executor :- </strong>Executors are JVM processes running on worker nodes.</p><ul><li>Execute tasks</li><li>Cache DataFrames</li><li>Perform transformations</li><li>Return results to the driver</li></ul><p><strong>Types of Cluster</strong></p><p><strong>All Purpose Cluster (Interactive Cluster):-</strong></p><p>Used for development, testing and data exploration.</p><p>Multiuser can shared the cluster.</p><p>can be attached to Notebook.</p><p><strong>Job Cluster (Automated Cluster):-</strong></p><p>Created automatically when job starts.</p><p>Terminates automatically after the job completes.</p><p>Dedicated to a single job.</p><p>More cost-effective for production jobs.</p><p><strong>Single Node Cluster:-</strong></p><p>Has only one Node (Driver only)</p><p>No worker Nodes.</p><p>Used for Lightweight development and testing.</p><p>Not suitable for large datasets.</p><p><strong>Autoscaling</strong></p><p>Autoscaling automatically increse or decrease the worker node based on workload.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=054ab6914f4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unity Catalog : The Complete Guide to Unified Data Governance in Databricks]]></title>
            <link>https://medium.com/@sanjays263/unity-catalog-the-complete-guide-to-unified-data-governance-in-databricks-413e5c8ca14c?source=rss-dd2cbb8957ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/413e5c8ca14c</guid>
            <category><![CDATA[databricks-unity-catalog]]></category>
            <category><![CDATA[unity-catalog]]></category>
            <category><![CDATA[unity-catalog-governance]]></category>
            <dc:creator><![CDATA[Sanjay Singh]]></dc:creator>
            <pubDate>Fri, 31 Jul 2026 07:17:27 GMT</pubDate>
            <atom:updated>2026-07-31T07:19:45.740Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Unity Catalog</strong> is Databricks’ centralized governance solution that provides a single place to manage all your data and AI assets. It simplifies security, improves collaboration, and enables organizations to govern data across multiple workspaces.</p><p><strong>Without Unity Catalog :-</strong>Before Unity Catalog, every Databricks workspace managed its own metadata, users, and permissions independently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*TRvejnM8BayqmjKB80zgkg.png" /></figure><p><strong>With Unity Catalog :- </strong>Unity Catalog introduces a <strong>centralized governance layer</strong> for all Databricks workspaces. Instead of each workspace managing its own users, metadata, and permissions, all workspaces share a <strong>single Unity Catalog Metastore</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*RXJHtny9m9thdpBKGylFVg.png" /></figure><p><strong>Component of Unity Catalog</strong></p><blockquote><strong>MetaStore :- </strong>A MetaStore is the top-level container that stores metadata about all data assets. it contains :- Catalogs, Schemas, tables, views, permissions and external locations.</blockquote><blockquote><strong>Catalog :-</strong> A catalog is the highest organizational level inside the metastore.</blockquote><blockquote>example — Sales, Finance, Marketing, HR, Engineering.</blockquote><blockquote><strong>Schema :-</strong> A schema is similar to databse inside the catalog.</blockquote><blockquote>example — Bronze, Silver, Gold.</blockquote><blockquote><strong>Tables :- </strong>Tables store structure data.</blockquote><blockquote>example :- customer, orders, products, sales and employees.</blockquote><blockquote><strong>Views :-</strong> view are the virtual table created by SQL.</blockquote><blockquote>example — create view active_customer AS</blockquote><blockquote>select * from customer</blockquote><blockquote>where status = ‘Active’;</blockquote><blockquote><strong>Volumes :-</strong> Volume store unstuctured and semi-structured files.</blockquote><blockquote>Example — csv, JSON, images, pdf, excel, Text Files.</blockquote><p><strong>Managed Volume VS External Volume</strong></p><p><strong>Managed Volume :-</strong> Unity catalog manages both metadata and storage location.</p><p>Files are store in the managed storage location of the metadata.</p><p>When the volume is dropped, the files are also deleted.</p><p>e.g. — dbutils.fs.ls(“/volumes/sales/raw_files”)</p><p><strong>External Volume :-</strong> Unity catalog manages only metadata.</p><p>Files are stored in your own cloud storage(ADLS, S3, GCS)</p><p>Dropping the volume removes only metadata files, remains in storage</p><p>e.g. — dbutils.fs.ls(“/volumes/sales/raw_files”)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=413e5c8ca14c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>