<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									SQL Queries Forum - Recent Posts				            </title>
            <link>https://sqlqueries.in/community/</link>
            <description>SQL Queries Discussion Board</description>
            <language>en-GB</language>
            <lastBuildDate>Sat, 09 May 2026 09:48:29 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Capgemini: What Steps Do You Follow to Reduce a Large PBIX File Size Without Losing Data or Visual Quality?</title>
                        <link>https://sqlqueries.in/community/qa/capgemini-what-steps-do-you-follow-to-reduce-a-large-pbix-file-size-without-losing-data-or-visual-quality/#post-11115</link>
                        <pubDate>Tue, 18 Nov 2025 03:14:18 +0000</pubDate>
                        <description><![CDATA[Capgemini: What Steps Do You Follow to Reduce a Large PBIX File Size Without Losing Data or Visual Quality?
This is a very common question in Capgemini Power BI, BI Analyst, and Data Engine...]]></description>
                        <content:encoded><![CDATA[<article>
<h1>Capgemini: What Steps Do You Follow to Reduce a Large PBIX File Size Without Losing Data or Visual Quality?</h1>
<p>This is a very common question in <strong>Capgemini Power BI, BI Analyst, and Data Engineering interviews</strong>. Capgemini frequently works with enterprise clients where PBIX files often grow beyond 300–800MB due to heavy data loads, multiple tables, and complex DAX logic. The interviewer wants to know whether you understand professional optimization techniques instead of simple basic steps.</p>
<h2>&#x1f4cc; Why PBIX File Size Becomes Large</h2>
<p>A PBIX file grows mainly because of:</p>
<ul>
<li>Too many unnecessary columns in fact tables</li>
<li>High-cardinality text fields (e.g., long descriptions, free-text comments)</li>
<li>Large number of relationships and lookup tables</li>
<li>Unoptimized Power Query transformations</li>
<li>Importing entire history instead of required data</li>
<li>Uncompressed data types (text columns stored inefficiently)</li>
</ul>
<h2>&#x2705; Step-by-Step Professional Process to Reduce PBIX File Size</h2>
<h3>1. Remove Unnecessary Columns First</h3>
<p>Capgemini emphasizes removing columns that are:</p>
<ul>
<li>Not used in visuals</li>
<li>Not used in relationships</li>
<li>Not part of any DAX logic</li>
<li>Not required for business reporting</li>
</ul>
<p>This alone can reduce file size by 30–40%.</p>
<h3>2. Reduce High-Cardinality Columns</h3>
<p>Columns with unique values (InvoiceID, GUIDs, long text) consume heavy memory. Replace them with:</p>
<ul>
<li>Integer surrogate keys</li>
<li>Shorter text fields</li>
<li>Reference dimensions</li>
</ul>
<h3>3. Push Transformations to SQL Instead of Power Query</h3>
<p>Power BI compresses data less efficiently when too many transformations happen in Power Query. Creating a <strong>SQL view</strong> with pre-cleaned data reduces file size significantly.</p>
<h3>4. Use Star Schema Instead of Snowflake</h3>
<p>A proper star schema:</p>
<ul>
<li>Reduces joins</li>
<li>Improves compression</li>
<li>Minimizes model size</li>
<li>Improves refresh speed</li>
</ul>
<h3>5. Disable Auto Date/Time</h3>
<p>This hidden feature secretly creates dozens of internal date tables for every date column. Disabling it can reduce file size by 5–10% instantly.</p>
<h3>6. Aggregate Fact Tables</h3>
<p>Instead of importing granular transactional data, create:</p>
<ul>
<li>Daily aggregated tables</li>
<li>Monthly summary tables</li>
<li>Quarter-level views</li>
</ul>
<p>Capgemini often uses aggregations for clients with millions of rows.</p>
<h3>7. Remove Unused Measures and Columns</h3>
<p>During development, many developers create trial measures or test columns. These should be removed before publishing the final version.</p>
<h3>8. Optimize Data Types</h3>
<p>Changing:</p>
<ul>
<li>Text → Whole Number</li>
<li>Decimal → Fixed Decimal</li>
<li>Text → Boolean</li>
</ul>
<p>can dramatically reduce file size because numeric columns compress far better than text.</p>
<h2>&#x1f4a1; Clean Interview-Friendly Answer</h2>
<p>“To reduce PBIX file size without losing data, I start by removing unused columns and converting high-cardinality text fields into numeric surrogate keys. I push heavy transformations into SQL views and restructure the model into a star schema. I disable auto date/time, remove unnecessary measures, and optimize data types for better compression. If required, I also create aggregated tables to reduce row-level detail and improve performance. These techniques usually reduce PBIX size by 40–70% while keeping the visuals intact.”</p>
<h2>&#x1f4ac; Why Capgemini Asks This</h2>
<p>Capgemini deals with global clients where datasets often exceed millions of records. They want analysts and BI developers who understand professional modeling practices, data compression techniques, and enterprise-level optimization strategies that ensure both small file size and high-performance reporting.</p>
</article>]]></content:encoded>
						                            <category domain="https://sqlqueries.in/community/"></category>                        <dc:creator>Kalyan</dc:creator>
                        <guid isPermaLink="true">https://sqlqueries.in/community/qa/capgemini-what-steps-do-you-follow-to-reduce-a-large-pbix-file-size-without-losing-data-or-visual-quality/#post-11115</guid>
                    </item>
				                    <item>
                        <title>Infosys: How Do You Design a Star Schema in Power BI When the Source Data Is Fully Normalized in an OLTP System?</title>
                        <link>https://sqlqueries.in/community/qa/infosys-how-do-you-design-a-star-schema-in-power-bi-when-the-source-data-is-fully-normalized-in-an-oltp-system/#post-11114</link>
                        <pubDate>Tue, 18 Nov 2025 03:12:56 +0000</pubDate>
                        <description><![CDATA[Infosys: How Do You Design a Star Schema in Power BI When the Source Data Is Fully Normalized in an OLTP System?
This is one of the most frequently asked questions in Infosys Power BI, Data...]]></description>
                        <content:encoded><![CDATA[<article>
<h1>Infosys: How Do You Design a Star Schema in Power BI When the Source Data Is Fully Normalized in an OLTP System?</h1>
<p>This is one of the most frequently asked questions in <strong>Infosys Power BI, Data Analyst, and BI Developer interviews</strong>. The interviewer wants to evaluate your understanding of data modeling, dimensional design, and how well you convert transactional source systems into analytical structures suitable for reporting.</p>
<h2>&#x2705; What the Interviewer Wants to Hear</h2>
<p>Infosys works heavily with enterprise-level clients where the backend systems are usually <strong>OLTP databases such as SQL Server, Oracle, SAP, or MySQL</strong>. These systems follow <em>high normalization</em> and are not optimized for reporting. Your job in Power BI is to convert this normalized data into a <strong>clean, scalable, and fast-performing star schema</strong>.</p>
<h2>&#x1f4cc; Step-by-Step Process for Designing a Star Schema</h2>
<h3>1. Understand the Business Process First</h3>
<p>Before designing any schema, identify the primary business process such as:</p>
<ul>
<li>Sales order processing</li>
<li>Inventory movement</li>
<li>Customer transactions</li>
<li>Financial reporting</li>
</ul>
<p>Clearly define what metrics or KPIs the report will measure. This forms the foundation for building the <strong>fact table</strong>.</p>
<h3>2. Identify the Fact Table</h3>
<p>A fact table typically contains:</p>
<ul>
<li>Transaction-level data</li>
<li>Foreign keys to dimension tables</li>
<li>Numeric, aggregatable measures (Amount, Quantity, Profit, Time Spent, etc.)</li>
</ul>
<p>Example fact table: <strong>FactSales</strong></p>
<pre contenteditable="false"><code class="language-text">
FactSales
-----------
SalesID
OrderDate
CustomerID
ProductID
Quantity
SalesAmount
Discount
  </code></pre>
<h3>3. Build Dimension Tables</h3>
<p>Unlike the normalized OLTP structure, dimensions in a star schema must be:</p>
<ul>
<li><strong>Denormalized</strong></li>
<li><strong>Descriptive</strong></li>
<li><strong>Human-readable</strong></li>
<li><strong>Slowly changing where needed (SCD Type 1 or 2)</strong></li>
</ul>
<p>Common dimensions include:</p>
<ul>
<li>DimCustomer</li>
<li>DimProduct</li>
<li>DimDate</li>
<li>DimGeography</li>
<li>DimEmployee</li>
</ul>
<h3>4. Flatten Normalized Tables</h3>
<p>An OLTP system may have tables like:</p>
<pre contenteditable="false"><code class="language-text">
Customer
CustomerAddress
CustomerContact
CustomerSegment
  </code></pre>
<p>These should be joined into a <strong>single dimension table</strong> in Power Query or SQL view:</p>
<pre contenteditable="false"><code class="language-text">
DimCustomer
-----------
CustomerID
CustomerName
Email
Phone
City
State
Country
Segment
  </code></pre>
<h3>5. Create Relationships (One-to-Many)</h3>
<p>In the star schema:</p>
<ul>
<li>Dimensions sit on the “one” side</li>
<li>Fact tables sit on the “many” side</li>
<li>Relationships are single-direction (from dimension → fact)</li>
</ul>
<p>This ensures better performance, predictable DAX behavior, and faster refresh.</p>
<h3>6. Optimize the Data Model</h3>
<ul>
<li>Remove unused columns</li>
<li>Use surrogate keys instead of natural keys</li>
<li>Enable date table with proper hierarchy</li>
<li>Disable auto date/time</li>
<li>Ensure data types are correct (very important for Infosys interviews)</li>
</ul>
<h2>&#x1f4a1; Simple Interview-Friendly Answer</h2>
<p>“When the source data is fully normalized in an OLTP system, I first understand the business process and identify the fact table that holds the core transactions. Next, I build denormalized dimension tables for customers, products, dates, and other descriptive attributes. I flatten the normalized tables using Power Query or SQL views and ensure the relationships follow a proper one-to-many structure with single-direction filters. Finally, I optimize the model by removing unnecessary columns, defining correct data types, and ensuring a clean star schema for fast query performance.”</p>
<h2>&#x1f4ac; Why Infosys Asks This Question</h2>
<p>Infosys works with global clients where reporting systems must handle millions of rows and strict performance requirements. They want to validate whether you can design <strong>efficient, stable, and scalable data models</strong> that work in enterprise analytics environments.</p>
</article>]]></content:encoded>
						                            <category domain="https://sqlqueries.in/community/"></category>                        <dc:creator>Kalyan</dc:creator>
                        <guid isPermaLink="true">https://sqlqueries.in/community/qa/infosys-how-do-you-design-a-star-schema-in-power-bi-when-the-source-data-is-fully-normalized-in-an-oltp-system/#post-11114</guid>
                    </item>
				                    <item>
                        <title>Deloitte: Write an SQL Query to Find the Nth Highest Salary Without Using LIMIT, TOP, or OFFSET</title>
                        <link>https://sqlqueries.in/community/qa/deloitte-write-an-sql-query-to-find-the-nth-highest-salary-without-using-limit-top-or-offset/#post-11113</link>
                        <pubDate>Tue, 18 Nov 2025 03:11:23 +0000</pubDate>
                        <description><![CDATA[Deloitte: Write an SQL Query to Find the Nth Highest Salary Without Using LIMIT, TOP, or OFFSET
This is a very popular question asked in Deloitte SQL and Data Engineer interviews. It tests ...]]></description>
                        <content:encoded><![CDATA[<article>
<h1>Deloitte: Write an SQL Query to Find the Nth Highest Salary Without Using LIMIT, TOP, or OFFSET</h1>
<p>This is a very popular question asked in <strong>Deloitte SQL and Data Engineer interviews</strong>. It tests a candidate’s ability to use ranking functions, subqueries, and advanced SQL logic to solve problems without relying on simple shortcuts.</p>
<h2>&#x2705; Approach 1: Using DENSE_RANK()</h2>
<p>You can use a window function to assign ranks to salaries and then filter by the required N.</p>
<pre contenteditable="false"><code class="language-sql">
SELECT salary
FROM (
    SELECT 
        salary,
        DENSE_RANK() OVER (ORDER BY salary DESC) AS rnk
    FROM employees
) AS ranked_salaries
WHERE rnk = :N;
  </code></pre>
<p>Replace <strong>:N</strong> with the value of the Nth highest salary you want. For example, to get the 3rd highest salary:</p>
<pre contenteditable="false"><code class="language-sql">
WHERE rnk = 3;
  </code></pre>
<h2>&#x2705; Approach 2: Using a Subquery</h2>
<p>This method returns the salary for the Nth highest value using a distinct subquery filter.</p>
<pre contenteditable="false"><code class="language-sql">
SELECT DISTINCT salary
FROM employees e1
WHERE :N - 1 = (
    SELECT COUNT(DISTINCT salary)
    FROM employees e2
    WHERE e2.salary &gt; e1.salary
);
  </code></pre>
<h2>&#x1f4cc; Explanation in Simple Words</h2>
<p>“To find the Nth highest salary, you cannot rely on LIMIT, TOP, or OFFSET in many interviews. Instead, I use a window function such as <strong>DENSE_RANK()</strong> to rank salaries in descending order and select the row matching the required rank. Alternatively, I can use a correlated subquery that counts how many unique salaries are greater than the current one. When this count equals N−1, that salary is the Nth highest.”</p>
<h2>&#x1f4ac; Why Deloitte Asks This</h2>
<p>Deloitte expects candidates to be comfortable with <strong>window functions, correlated subqueries, filtering logic, and ranking mechanisms</strong>. These skills are essential for solving real-world data problems involving complex transformations and analytical queries.</p>
</article>]]></content:encoded>
						                            <category domain="https://sqlqueries.in/community/"></category>                        <dc:creator>Kalyan</dc:creator>
                        <guid isPermaLink="true">https://sqlqueries.in/community/qa/deloitte-write-an-sql-query-to-find-the-nth-highest-salary-without-using-limit-top-or-offset/#post-11113</guid>
                    </item>
				                    <item>
                        <title>Accenture: Explain the Difference Between CALCULATE and CALCULATETABLE in DAX With an Example</title>
                        <link>https://sqlqueries.in/community/qa/accenture-explain-the-difference-between-calculate-and-calculatetable-in-dax-with-an-example/#post-11112</link>
                        <pubDate>Tue, 18 Nov 2025 03:09:54 +0000</pubDate>
                        <description><![CDATA[Accenture: Explain the Difference Between CALCULATE and CALCULATETABLE in DAX With an Example
This question is one of the most commonly asked in Accenture Power BI and Data Analyst intervie...]]></description>
                        <content:encoded><![CDATA[<article>
<h1>Accenture: Explain the Difference Between CALCULATE and CALCULATETABLE in DAX With an Example</h1>
<p>This question is one of the <strong>most commonly asked in Accenture Power BI and Data Analyst interviews</strong>. The interviewer uses it to test how well you understand evaluation context, filter propagation, and the difference between row context and filter context in real reporting scenarios.</p>
<h2>&#x2705; Clear and Simple Explanation</h2>
<h3>1. What CALCULATE Does</h3>
<p><strong>CALCULATE()</strong> returns a <em>single scalar value</em>. It modifies the filter context and then evaluates the expression under the new conditions.</p>
<ul>
<li>Mostly used for measures</li>
<li>Outputs one aggregated value</li>
<li>Best for KPIs like Sales YTD, Profit MTD, etc.</li>
</ul>
<pre contenteditable="false"><code class="language-dax">
Total Sales = CALCULATE(SUM(Sales))
  </code></pre>
<h3>2. What CALCULATETABLE Does</h3>
<p><strong>CALCULATETABLE()</strong> returns an entire <em>table</em>. You use it when you need a filtered table for iterating, ranking, or advanced calculations.</p>
<ul>
<li>Returns a table instead of a single number</li>
<li>Ideal for filtering rows before using functions like SUMX or RANKX</li>
<li>Useful for complex data modeling logic</li>
</ul>
<pre contenteditable="false"><code class="language-dax">
Filtered Sales =
CALCULATETABLE(
    Sales,
    Sales = 2024
)
  </code></pre>
<h2>&#x1f4cc; Real Project Example (Accenture-Level Quality)</h2>
<h3>Scenario:</h3>
<p>You want the <strong>total sales of the latest year</strong>. The latest year keeps changing as new data comes in, so the calculation must be dynamic.</p>
<pre contenteditable="false"><code class="language-dax">
Latest Year Sales =
CALCULATE(
    SUM(Sales),
    Sales = MAX(Sales)
)
  </code></pre>
<p>If you need to extract a filtered table of only the latest year for further calculations, you use:</p>
<pre contenteditable="false"><code class="language-dax">
Latest Year Table =
CALCULATETABLE(
    Sales,
    Sales = MAX(Sales)
)
  </code></pre>
<h2>&#x1f4a1; Simple Interview-Friendly Answer</h2>
<p>“<strong>CALCULATE</strong> returns a single value after modifying the filter context, while <strong>CALCULATETABLE</strong> returns a table after applying filters. I use CALCULATE for measures like Total Sales YTD, and CALCULATETABLE when I need a filtered dataset inside functions such as SUMX, RANKX, or for complex business logic.”</p>
<h2>&#x1f4ac; Why Accenture Asks This</h2>
<p>Accenture projects involve enterprise models with large datasets. Engineers must understand <strong>context transition, filter manipulation, and table vs. scalar output</strong> to write efficient measures and optimize report performance.</p>
</article>]]></content:encoded>
						                            <category domain="https://sqlqueries.in/community/"></category>                        <dc:creator>Kalyan</dc:creator>
                        <guid isPermaLink="true">https://sqlqueries.in/community/qa/accenture-explain-the-difference-between-calculate-and-calculatetable-in-dax-with-an-example/#post-11112</guid>
                    </item>
				                    <item>
                        <title>TCS: How Do You Optimize a Slow Power BI Report Connected to 20M+ Rows?</title>
                        <link>https://sqlqueries.in/community/qa/tcs-how-do-you-optimize-a-slow-power-bi-report-connected-to-20m-rows/#post-11111</link>
                        <pubDate>Tue, 18 Nov 2025 03:06:52 +0000</pubDate>
                        <description><![CDATA[This question is frequently asked in TCS Power BI interviews, especially for Data Analyst and BI Developer roles. The interviewer wants to test your understanding of data modeling, DAX perfo...]]></description>
                        <content:encoded><![CDATA[<article>
<h1><span style="font-size: 14px">This question is frequently asked in </span><strong style="font-size: 14px">TCS Power BI interviews</strong><span style="font-size: 14px">, especially for Data Analyst and BI Developer roles. The interviewer wants to test your understanding of data modeling, DAX performance, and optimization techniques in real-world enterprise scenarios.</span></h1>
<h2>&#x2705; Step-by-Step Answer</h2>
<h3>1. Check the Data Model Structure</h3>
<ul>
<li>Use <strong>Star Schema</strong> instead of Snowflake.</li>
<li>Keep fact tables large and dimension tables small.</li>
<li>Remove unnecessary relationships and avoid many-to-many joins.</li>
</ul>
<h3>2. Reduce Columns and Rows Loaded into Power BI</h3>
<ul>
<li>Load only required columns using custom SQL views.</li>
<li>Apply filters at the source (e.g., last 3 years data only).</li>
<li>Avoid loading high-cardinality text columns.</li>
</ul>
<h3>3. Optimize DAX Measures</h3>
<ul>
<li>Replace <strong>CALCULATE + FILTER</strong> combos with optimized versions.</li>
<li>Avoid row-by-row functions such as <strong>EARLIER</strong> and iterators unless necessary.</li>
<li>Use <strong>SUMX</strong> only on small tables.</li>
</ul>
<h3>4. Improve Query Performance</h3>
<ul>
<li>Enable <strong>Query Folding</strong> in Power Query.</li>
<li>Check the View Native Query option is active.</li>
<li>Push transformations to SQL instead of Power Query.</li>
</ul>
<h3>5. Manage Visual-Level Performance</h3>
<ul>
<li>Reduce number of visuals per page (ideal: under 12).</li>
<li>Use Aggregations for large fact tables.</li>
<li>Disable auto date/time in Power BI Desktop.</li>
</ul>
<h2>&#x1f4a1; Good Sample Short Answer for Interview</h2>
<p>“To optimize a slow Power BI report connected to a 20M+ row table, I first review the data model to ensure it follows a proper star schema. I reduce unnecessary columns and push filters to the source database to minimize rows loaded. I also optimize DAX by replacing expensive iterators with efficient functions. Next, I ensure query folding is maintained in Power Query so heavy transformations happen at the SQL side. Finally, I optimize visuals by limiting complex charts and enabling aggregations for large datasets.”</p>
<h2>&#x1f4cc; Why TCS Asks This Question</h2>
<p>TCS handles large enterprise datasets, and they expect candidates to understand <strong>data modeling, performance tuning, and scalable BI design</strong>.</p>
</article>]]></content:encoded>
						                            <category domain="https://sqlqueries.in/community/"></category>                        <dc:creator>Kalyan</dc:creator>
                        <guid isPermaLink="true">https://sqlqueries.in/community/qa/tcs-how-do-you-optimize-a-slow-power-bi-report-connected-to-20m-rows/#post-11111</guid>
                    </item>
				                    <item>
                        <title>Advanced PL/SQL Coding Interview Questions — Asked in Infosys, Accenture &amp; Wipro (2025 Edition)</title>
                        <link>https://sqlqueries.in/community/interview-questions-answers/advanced-pl-sql-coding-interview-questions-asked-in-infosys-accenture-wipro-2025-edition/#post-11106</link>
                        <pubDate>Sun, 09 Nov 2025 06:10:26 +0000</pubDate>
                        <description><![CDATA[In 2025, Infosys, Accenture, and Wipro continue to test Oracle developers with complex PL/SQL coding questions based on real-time performance scenarios, not just syntax.
These questions are...]]></description>
                        <content:encoded><![CDATA[<p data-start="931" data-end="1122">In 2025, <strong data-start="940" data-end="951">Infosys</strong>, <strong data-start="953" data-end="966">Accenture</strong>, and <strong data-start="972" data-end="981">Wipro</strong> continue to test Oracle developers with <strong data-start="1022" data-end="1057">complex PL/SQL coding questions</strong> based on <strong data-start="1067" data-end="1102">real-time performance scenarios</strong>, not just syntax.</p>
<p data-start="1124" data-end="1303">These questions are designed to check your ability to <strong data-start="1178" data-end="1209">write optimized PL/SQL code</strong>, use <strong data-start="1215" data-end="1230">collections</strong>, manage <strong data-start="1239" data-end="1253">exceptions</strong>, and handle <strong data-start="1266" data-end="1300">large data volumes efficiently</strong>.</p>
<p data-start="1305" data-end="1488">If you’re preparing for mid-level or senior Oracle roles, this list of <strong data-start="1376" data-end="1429">advanced PL/SQL interview questions with examples</strong> will help you ace both coding and technical discussions.</p>
<hr data-start="1490" data-end="1493" />
<h3 data-start="1495" data-end="1569">&#x1f539; <strong data-start="1502" data-end="1567">Top Advanced PL/SQL Coding Interview Questions (2025 Edition)</strong></h3>
<h4 data-start="1571" data-end="1652"><strong data-start="1576" data-end="1650">1&#xfe0f;&#x20e3; What is the difference between an Explicit and an Implicit Cursor?</strong></h4>
<p data-start="1653" data-end="1666"><strong data-start="1653" data-end="1664">Answer:</strong></p>
<ul data-start="1667" data-end="1898">
<li data-start="1667" data-end="1799">
<p data-start="1669" data-end="1799"><strong data-start="1669" data-end="1689">Implicit Cursor:</strong> Automatically created by Oracle for single SQL statements like <code data-start="1753" data-end="1761">INSERT</code>, <code data-start="1763" data-end="1771">UPDATE</code>, <code data-start="1773" data-end="1781">DELETE</code>, <code data-start="1783" data-end="1796">SELECT INTO</code>.</p>
</li>
<li data-start="1800" data-end="1898">
<p data-start="1802" data-end="1898"><strong data-start="1802" data-end="1822">Explicit Cursor:</strong> Declared by the developer for queries returning multiple rows.<br data-start="1885" data-end="1888" />Example:</p>
</li>
</ul>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">DECLARE</span>
  <span class="hljs-keyword">CURSOR</span> emp_cur <span class="hljs-keyword">IS</span> <span class="hljs-keyword">SELECT</span> emp_name, salary <span class="hljs-keyword">FROM</span> employees <span class="hljs-keyword">WHERE</span> dept_id <span class="hljs-operator">=</span> <span class="hljs-number">10</span>;
<span class="hljs-keyword">BEGIN</span>
  <span class="hljs-keyword">FOR</span> rec <span class="hljs-keyword">IN</span> emp_cur LOOP
    DBMS_OUTPUT.PUT_LINE(rec.emp_name <span class="hljs-operator">||</span> <span class="hljs-string">' - '</span> <span class="hljs-operator">||</span> rec.salary);
  <span class="hljs-keyword">END</span> LOOP;
<span class="hljs-keyword">END</span>;
</span></code></div>
</div>
<p data-start="2109" data-end="2164">&#x2705; <em data-start="2111" data-end="2164">Common in Wipro and Accenture PL/SQL coding rounds.</em></p>
<hr data-start="2166" data-end="2169" />
<h4 data-start="2171" data-end="2236"><strong data-start="2176" data-end="2234">2&#xfe0f;&#x20e3; What is Bulk Collect in PL/SQL and why is it used?</strong></h4>
<p data-start="2237" data-end="2424">Used for <strong data-start="2246" data-end="2273">performance improvement</strong> when fetching multiple rows.<br data-start="2302" data-end="2305" />Instead of fetching one row at a time, <strong data-start="2344" data-end="2360">BULK COLLECT</strong> retrieves data in batches into PL/SQL collections.<br data-start="2411" data-end="2414" />Example:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">DECLARE</span>
  TYPE emp_tab <span class="hljs-keyword">IS</span> <span class="hljs-keyword">TABLE</span> <span class="hljs-keyword">OF</span> employees<span class="hljs-operator">%</span>ROWTYPE;
  v_emp emp_tab;
<span class="hljs-keyword">BEGIN</span>
  <span class="hljs-keyword">SELECT</span> <span class="hljs-operator">*</span> BULK <span class="hljs-keyword">COLLECT</span> <span class="hljs-keyword">INTO</span> v_emp <span class="hljs-keyword">FROM</span> employees;
  <span class="hljs-keyword">FOR</span> i <span class="hljs-keyword">IN</span> <span class="hljs-number">1.</span>.v_emp.COUNT LOOP
    DBMS_OUTPUT.PUT_LINE(v_emp(i).emp_name);
  <span class="hljs-keyword">END</span> LOOP;
<span class="hljs-keyword">END</span>;
</span></code></div>
</div>
<p data-start="2657" data-end="2716">&#x2705; <em data-start="2659" data-end="2716">Accenture often asks this for large data-load projects.</em></p>
<hr data-start="2718" data-end="2721" />
<h4 data-start="2723" data-end="2793"><strong data-start="2728" data-end="2791">3&#xfe0f;&#x20e3; What is the difference between FORALL and Bulk Collect?</strong></h4>
<div class="_tableContainer_1rjym_1">
<div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse">
<table class="w-fit min-w-(--thread-content-width)" data-start="2794" data-end="3011">
<thead data-start="2794" data-end="2829">
<tr data-start="2794" data-end="2829">
<th data-start="2794" data-end="2804" data-col-size="sm">Feature</th>
<th data-start="2804" data-end="2819" data-col-size="sm">BULK COLLECT</th>
<th data-start="2819" data-end="2829" data-col-size="sm">FORALL</th>
</tr>
</thead>
<tbody data-start="2868" data-end="3011">
<tr data-start="2868" data-end="2942">
<td data-start="2868" data-end="2878" data-col-size="sm">Purpose</td>
<td data-start="2878" data-end="2908" data-col-size="sm">Fetch multiple rows at once</td>
<td data-col-size="sm" data-start="2908" data-end="2942">Execute DML operations in bulk</td>
</tr>
<tr data-start="2943" data-end="3000">
<td data-start="2943" data-end="2954" data-col-size="sm">Used For</td>
<td data-col-size="sm" data-start="2954" data-end="2974">SELECT statements</td>
<td data-col-size="sm" data-start="2974" data-end="3000">INSERT, UPDATE, DELETE</td>
</tr>
<tr data-start="3001" data-end="3011">
<td data-start="3001" data-end="3011" data-col-size="sm">Example:</td>
<td data-col-size="sm"> </td>
<td data-col-size="sm"> </td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span>FORALL i <span class="hljs-keyword">IN</span> <span class="hljs-number">1.</span>.v_ids.COUNT
  <span class="hljs-keyword">UPDATE</span> employees <span class="hljs-keyword">SET</span> bonus <span class="hljs-operator">=</span> <span class="hljs-number">0.1</span> <span class="hljs-operator">*</span> salary <span class="hljs-keyword">WHERE</span> emp_id <span class="hljs-operator">=</span> v_ids(i);
</span></code></div>
</div>
<p data-start="3119" data-end="3182">&#x1f4cc; <em data-start="3122" data-end="3182">Infosys interviewers focus on this for optimization logic.</em></p>
<hr data-start="3184" data-end="3187" />
<h4 data-start="3189" data-end="3240"><strong data-start="3194" data-end="3238">4&#xfe0f;&#x20e3; Explain Ref Cursors and their types.</strong></h4>
<p data-start="3241" data-end="3316">Ref cursors allow passing cursor results between subprograms dynamically.</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">DECLARE</span>
  TYPE emp_ref <span class="hljs-keyword">IS</span> <span class="hljs-keyword">REF</span> <span class="hljs-keyword">CURSOR</span>;
  c1 emp_ref;
  v_name employees.name<span class="hljs-operator">%</span>TYPE;
<span class="hljs-keyword">BEGIN</span>
  <span class="hljs-keyword">OPEN</span> c1 <span class="hljs-keyword">FOR</span> <span class="hljs-keyword">SELECT</span> name <span class="hljs-keyword">FROM</span> employees <span class="hljs-keyword">WHERE</span> department_id <span class="hljs-operator">=</span> <span class="hljs-number">20</span>;
  LOOP
    <span class="hljs-keyword">FETCH</span> c1 <span class="hljs-keyword">INTO</span> v_name;
    EXIT <span class="hljs-keyword">WHEN</span> c1<span class="hljs-operator">%</span>NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(v_name);
  <span class="hljs-keyword">END</span> LOOP;
  <span class="hljs-keyword">CLOSE</span> c1;
<span class="hljs-keyword">END</span>;
</span></code></div>
</div>
<p data-start="3606" data-end="3652">&#x2705; <em data-start="3608" data-end="3650">Common in Infosys advanced coding tests.</em></p>
<hr data-start="3654" data-end="3657" />
<h4 data-start="3659" data-end="3735"><strong data-start="3664" data-end="3733">5&#xfe0f;&#x20e3; How can you handle multiple exceptions in PL/SQL efficiently?</strong></h4>
<p data-start="3736" data-end="3802">Use named and generic exceptions with <code data-start="3774" data-end="3780">WHEN</code> clauses.<br data-start="3789" data-end="3792" />Example:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">BEGIN</span>
  <span class="hljs-keyword">UPDATE</span> employees <span class="hljs-keyword">SET</span> salary <span class="hljs-operator">=</span> salary <span class="hljs-operator">*</span> <span class="hljs-number">1.1</span> <span class="hljs-keyword">WHERE</span> dept_id <span class="hljs-operator">=</span> <span class="hljs-number">10</span>;
EXCEPTION
  <span class="hljs-keyword">WHEN</span> NO_DATA_FOUND <span class="hljs-keyword">THEN</span>
    DBMS_OUTPUT.PUT_LINE(<span class="hljs-string">'No employees found.'</span>);
  <span class="hljs-keyword">WHEN</span> OTHERS <span class="hljs-keyword">THEN</span>
    DBMS_OUTPUT.PUT_LINE(<span class="hljs-string">'Error: '</span> <span class="hljs-operator">||</span> SQLERRM);
<span class="hljs-keyword">END</span>;
</span></code></div>
</div>
<p data-start="4042" data-end="4116">&#x1f4cc; <em data-start="4045" data-end="4116">Accenture often gives a block with errors and asks you to correct it.</em></p>
<hr data-start="4118" data-end="4121" />
<h4 data-start="4123" data-end="4187"><strong data-start="4128" data-end="4185">6&#xfe0f;&#x20e3; What are PL/SQL Collections? Explain their types.</strong></h4>
<ul data-start="4188" data-end="4345">
<li data-start="4188" data-end="4250">
<p data-start="4190" data-end="4250"><strong data-start="4190" data-end="4231">Associative Arrays (INDEX BY tables):</strong> Key-value pairs.</p>
</li>
<li data-start="4251" data-end="4309">
<p data-start="4253" data-end="4309"><strong data-start="4253" data-end="4271">Nested Tables:</strong> Similar to arrays, dynamic in size.</p>
</li>
<li data-start="4310" data-end="4345">
<p data-start="4312" data-end="4345"><strong data-start="4312" data-end="4324">VARRAYs:</strong> Fixed-size arrays.</p>
</li>
</ul>
<p data-start="4347" data-end="4372">Example (Nested Table):</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">DECLARE</span>
  TYPE t_numbers <span class="hljs-keyword">IS</span> <span class="hljs-keyword">TABLE</span> <span class="hljs-keyword">OF</span> NUMBER;
  v_nums t_numbers :<span class="hljs-operator">=</span> t_numbers(<span class="hljs-number">10</span>, <span class="hljs-number">20</span>, <span class="hljs-number">30</span>);
<span class="hljs-keyword">BEGIN</span>
  <span class="hljs-keyword">FOR</span> i <span class="hljs-keyword">IN</span> <span class="hljs-number">1.</span>.v_nums.COUNT LOOP
    DBMS_OUTPUT.PUT_LINE(v_nums(i));
  <span class="hljs-keyword">END</span> LOOP;
<span class="hljs-keyword">END</span>;
</span></code></div>
</div>
<p data-start="4566" data-end="4632">&#x2705; <em data-start="4568" data-end="4632">Infosys &amp; Wipro focus on associative arrays and nested tables.</em></p>
<hr data-start="4634" data-end="4637" />
<h4 data-start="4639" data-end="4734"><strong data-start="4644" data-end="4732">7&#xfe0f;&#x20e3; What is a Cursor FOR Loop and how is it different from explicit cursor handling?</strong></h4>
<p data-start="4735" data-end="4828">Cursor FOR Loop simplifies cursor management — no need to explicitly open, fetch, or close.</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">FOR</span> emp_rec <span class="hljs-keyword">IN</span> (<span class="hljs-keyword">SELECT</span> emp_name <span class="hljs-keyword">FROM</span> employees <span class="hljs-keyword">WHERE</span> dept_id <span class="hljs-operator">=</span> <span class="hljs-number">50</span>)
LOOP
  DBMS_OUTPUT.PUT_LINE(emp_rec.emp_name);
<span class="hljs-keyword">END</span> LOOP;
</span></code></div>
</div>
<p data-start="4964" data-end="5008">&#x1f4cc; <em data-start="4967" data-end="5008">Asked in Accenture intermediate rounds.</em></p>
<hr data-start="5010" data-end="5013" />
<h4 data-start="5015" data-end="5080"><strong data-start="5020" data-end="5078">8&#xfe0f;&#x20e3; Real-Time Scenario: Bulk Update with Error Logging</strong></h4>
<p data-start="5081" data-end="5152"><strong data-start="5081" data-end="5094">Question:</strong> Update employee bonuses in bulk and log failed updates.</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">DECLARE</span>
  TYPE id_tab <span class="hljs-keyword">IS</span> <span class="hljs-keyword">TABLE</span> <span class="hljs-keyword">OF</span> employees.emp_id<span class="hljs-operator">%</span>TYPE;
  v_ids id_tab :<span class="hljs-operator">=</span> id_tab(<span class="hljs-number">101</span>, <span class="hljs-number">102</span>, <span class="hljs-number">103</span>);
<span class="hljs-keyword">BEGIN</span>
  FORALL i <span class="hljs-keyword">IN</span> <span class="hljs-number">1.</span>.v_ids.COUNT SAVE EXCEPTIONS
    <span class="hljs-keyword">UPDATE</span> employees <span class="hljs-keyword">SET</span> bonus <span class="hljs-operator">=</span> bonus <span class="hljs-operator">+</span> <span class="hljs-number">500</span> <span class="hljs-keyword">WHERE</span> emp_id <span class="hljs-operator">=</span> v_ids(i);
EXCEPTION
  <span class="hljs-keyword">WHEN</span> OTHERS <span class="hljs-keyword">THEN</span>
    <span class="hljs-keyword">FOR</span> i <span class="hljs-keyword">IN</span> <span class="hljs-number">1.</span>.<span class="hljs-keyword">SQL</span><span class="hljs-operator">%</span>BULK_EXCEPTIONS.COUNT LOOP
      <span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> error_log <span class="hljs-keyword">VALUES</span>(<span class="hljs-keyword">SQL</span><span class="hljs-operator">%</span>BULK_EXCEPTIONS(i).ERROR_INDEX,
                                   SQLERRM(<span class="hljs-operator">-</span><span class="hljs-keyword">SQL</span><span class="hljs-operator">%</span>BULK_EXCEPTIONS(i).ERROR_CODE),
                                   SYSDATE);
    <span class="hljs-keyword">END</span> LOOP;
<span class="hljs-keyword">END</span>;
</span></code></div>
</div>
<p data-start="5674" data-end="5721">&#x2705; <em data-start="5676" data-end="5721">Common in Wipro PL/SQL automation projects.</em></p>
<hr data-start="6452" data-end="6455" />
<h3 data-start="6457" data-end="6478">&#x1f4a1; <strong data-start="6464" data-end="6476">Pro Tip:</strong></h3>
<p data-start="6479" data-end="6541">When explaining PL/SQL logic in interviews, add <strong data-start="6527" data-end="6538">context</strong>:</p>
<blockquote data-start="6542" data-end="6670">
<p data-start="6544" data-end="6670">“We implemented bulk updates in a payroll module where performance improved by 60% after using FORALL with SAVE EXCEPTIONS.”</p>
</blockquote>
<p data-start="6672" data-end="6753">This gives a real-world impact — which impresses senior interviewers instantly.</p>
<hr data-start="6755" data-end="6758" />
<h3 data-start="6760" data-end="6783">&#x1f9e9; <strong data-start="6767" data-end="6781">Conclusion</strong></h3>
<p data-start="6784" data-end="6943">These <strong data-start="6790" data-end="6851">Advanced PL/SQL Coding Interview Questions (2025 Edition)</strong> from <strong data-start="6857" data-end="6887">Infosys, Accenture &amp; Wipro</strong> are drawn from actual project-based technical rounds.</p>
<p data-start="6945" data-end="7122">Mastering these topics — <strong data-start="6970" data-end="7056">bulk operations, ref cursors, autonomous transactions, and optimization techniques</strong> — will help you stand out as a top-performing Oracle developer.</p>
<p data-start="7124" data-end="7262">Practice these scenarios regularly on <strong data-start="7162" data-end="7180">Oracle LiveSQL</strong> or <strong data-start="7184" data-end="7201">SQL Developer</strong> to strengthen your command and speed in PL/SQL interviews.</p>]]></content:encoded>
						                            <category domain="https://sqlqueries.in/community/"></category>                        <dc:creator>SQL Admin</dc:creator>
                        <guid isPermaLink="true">https://sqlqueries.in/community/interview-questions-answers/advanced-pl-sql-coding-interview-questions-asked-in-infosys-accenture-wipro-2025-edition/#post-11106</guid>
                    </item>
				                    <item>
                        <title>PL/SQL Triggers, Packages &amp; Exception Handling — Real-Time Scenario Questions Asked in TCS, HCL &amp; Capgemini (2025 Edition)</title>
                        <link>https://sqlqueries.in/community/interview-questions-answers/pl-sql-triggers-packages-exception-handling-real-time-scenario-questions-asked-in-tcs-hcl-capgemini-2025-edition/#post-11105</link>
                        <pubDate>Sun, 09 Nov 2025 06:08:54 +0000</pubDate>
                        <description><![CDATA[If you’re preparing for PL/SQL interviews at TCS, HCL, or Capgemini, expect questions that go beyond syntax.Recruiters focus on real-time scenarios involving triggers, packages, and exceptio...]]></description>
                        <content:encoded><![CDATA[<p data-start="848" data-end="1119">If you’re preparing for <strong data-start="872" data-end="893">PL/SQL interviews</strong> at <strong data-start="897" data-end="923">TCS, HCL, or Capgemini</strong>, expect questions that go beyond syntax.<br data-start="964" data-end="967" />Recruiters focus on <strong data-start="987" data-end="1010">real-time scenarios</strong> involving <strong data-start="1021" data-end="1067">triggers, packages, and exception handling</strong> — key concepts in every enterprise Oracle system.</p>
<p data-start="1121" data-end="1323">This post brings you <strong data-start="1142" data-end="1175">practical interview questions</strong> directly from developer rounds in 2025, including <strong data-start="1226" data-end="1252">project-based examples</strong> and <strong data-start="1257" data-end="1281">error-handling logic</strong> you can use in production environments.</p>
<hr data-start="1325" data-end="1328" />
<h3 data-start="1330" data-end="1418">&#x1f539; <strong data-start="1337" data-end="1416">Top PL/SQL Triggers, Packages &amp; Exception Handling Questions (2025 Edition)</strong></h3>
<h4 data-start="1420" data-end="1483"><strong data-start="1425" data-end="1481">1&#xfe0f;&#x20e3; What is a Trigger in PL/SQL? When do you use it?</strong></h4>
<p data-start="1484" data-end="1657"><strong data-start="1484" data-end="1495">Answer:</strong><br data-start="1495" data-end="1498" />A <strong data-start="1500" data-end="1511">trigger</strong> is a stored PL/SQL block that automatically executes in response to a database event such as <strong data-start="1605" data-end="1615">INSERT</strong>, <strong data-start="1617" data-end="1627">UPDATE</strong>, or <strong data-start="1632" data-end="1642">DELETE</strong>.<br data-start="1643" data-end="1646" />Used for:</p>
<ul data-start="1658" data-end="1752">
<li data-start="1658" data-end="1683">
<p data-start="1660" data-end="1683">Auditing data changes</p>
</li>
<li data-start="1684" data-end="1712">
<p data-start="1686" data-end="1712">Enforcing business rules</p>
</li>
<li data-start="1713" data-end="1752">
<p data-start="1715" data-end="1752">Automating logging and calculations</p>
</li>
</ul>
<p data-start="1754" data-end="1780">Example (Audit Trigger):</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">OR</span> REPLACE <span class="hljs-keyword">TRIGGER</span> trg_audit_salary
AFTER <span class="hljs-keyword">UPDATE</span> <span class="hljs-keyword">OF</span> salary <span class="hljs-keyword">ON</span> employees
<span class="hljs-keyword">FOR</span> <span class="hljs-keyword">EACH</span> <span class="hljs-type">ROW</span>
<span class="hljs-keyword">BEGIN</span>
  <span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> salary_audit(emp_id, old_sal, new_sal, updated_on)
  <span class="hljs-keyword">VALUES</span>(:OLD.emp_id, :OLD.salary, :NEW.salary, SYSDATE);
<span class="hljs-keyword">END</span>;
</span></code></div>
</div>
<p data-start="2018" data-end="2084">&#x2705; <em data-start="2020" data-end="2082">Frequently asked in Capgemini production support interviews.</em></p>
<hr data-start="2086" data-end="2089" />
<h4 data-start="2091" data-end="2157"><strong data-start="2096" data-end="2155">2&#xfe0f;&#x20e3; What are the different types of Triggers in Oracle?</strong></h4>
<div class="_tableContainer_1rjym_1">
<div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse">
<table class="w-fit min-w-(--thread-content-width)" data-start="2158" data-end="2506">
<thead data-start="2158" data-end="2190">
<tr data-start="2158" data-end="2190">
<th data-start="2158" data-end="2165" data-col-size="sm">Type</th>
<th data-start="2165" data-end="2179" data-col-size="sm">Description</th>
<th data-start="2179" data-end="2190" data-col-size="sm">Example</th>
</tr>
</thead>
<tbody data-start="2226" data-end="2506">
<tr data-start="2226" data-end="2297">
<td data-start="2226" data-end="2235" data-col-size="sm">BEFORE</td>
<td data-start="2235" data-end="2278" data-col-size="sm">Executes before the triggering statement</td>
<td data-start="2278" data-end="2297" data-col-size="sm">Data validation</td>
</tr>
<tr data-start="2298" data-end="2368">
<td data-start="2298" data-end="2306" data-col-size="sm">AFTER</td>
<td data-start="2306" data-end="2348" data-col-size="sm">Executes after the triggering statement</td>
<td data-start="2348" data-end="2368" data-col-size="sm">Auditing changes</td>
</tr>
<tr data-start="2369" data-end="2431">
<td data-start="2369" data-end="2382" data-col-size="sm">INSTEAD OF</td>
<td data-start="2382" data-end="2400" data-col-size="sm">Used with views</td>
<td data-start="2400" data-end="2431" data-col-size="sm">Modifies data through views</td>
</tr>
<tr data-start="2432" data-end="2506">
<td data-start="2432" data-end="2443" data-col-size="sm">COMPOUND</td>
<td data-start="2443" data-end="2477" data-col-size="sm">Combines multiple timing points</td>
<td data-start="2477" data-end="2506" data-col-size="sm">Used in bulk operations</td>
</tr>
</tbody>
</table>
</div>
</div>
<p data-start="2508" data-end="2572">&#x1f4cc; <em data-start="2511" data-end="2570">TCS often asks for “real use cases” of compound triggers.</em></p>
<hr data-start="2574" data-end="2577" />
<h4 data-start="2579" data-end="2645"><strong data-start="2584" data-end="2643">3&#xfe0f;&#x20e3; Real-Time Scenario: Prevent Negative Salary Updates</strong></h4>
<p data-start="2646" data-end="2729"><strong data-start="2646" data-end="2659">Question:</strong> Create a trigger that prevents updating salary to a negative value.</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">OR</span> REPLACE <span class="hljs-keyword">TRIGGER</span> trg_check_salary
BEFORE <span class="hljs-keyword">UPDATE</span> <span class="hljs-keyword">OF</span> salary <span class="hljs-keyword">ON</span> employees
<span class="hljs-keyword">FOR</span> <span class="hljs-keyword">EACH</span> <span class="hljs-type">ROW</span>
<span class="hljs-keyword">BEGIN</span>
  IF :NEW.salary <span class="hljs-operator">&lt;</span> <span class="hljs-number">0</span> <span class="hljs-keyword">THEN</span>
    RAISE_APPLICATION_ERROR(<span class="hljs-number">-20001</span>, <span class="hljs-string">'Salary cannot be negative!'</span>);
  <span class="hljs-keyword">END</span> IF;
<span class="hljs-keyword">END</span>;
</span></code></div>
</div>
<p data-start="2948" data-end="3007">&#x2705; <em data-start="2950" data-end="3007">Common business rule scenario used in HCL ERP projects.</em></p>
<hr data-start="3009" data-end="3012" />
<h4 data-start="3014" data-end="3069"><strong data-start="3019" data-end="3067">4&#xfe0f;&#x20e3; What is a Package in PL/SQL? Why use it?</strong></h4>
<p data-start="3070" data-end="3244">A <strong data-start="3072" data-end="3083">package</strong> is a collection of logically related PL/SQL objects — such as procedures, functions, variables, and cursors — grouped together for reusability and modularity.</p>
<p data-start="3246" data-end="3256">Example:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">OR</span> REPLACE PACKAGE emp_pkg <span class="hljs-keyword">AS</span>
  <span class="hljs-keyword">PROCEDURE</span> add_employee(p_id NUMBER, p_name VARCHAR2, p_sal NUMBER);
  <span class="hljs-keyword">PROCEDURE</span> get_employee(p_id NUMBER);
<span class="hljs-keyword">END</span> emp_pkg;
</span></code></div>
</div>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">OR</span> REPLACE PACKAGE BODY emp_pkg <span class="hljs-keyword">AS</span>
  <span class="hljs-keyword">PROCEDURE</span> add_employee(p_id NUMBER, p_name VARCHAR2, p_sal NUMBER) <span class="hljs-keyword">IS</span>
  <span class="hljs-keyword">BEGIN</span>
    <span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> employees <span class="hljs-keyword">VALUES</span>(p_id, p_name, p_sal);
    <span class="hljs-keyword">COMMIT</span>;
  <span class="hljs-keyword">END</span>;

  <span class="hljs-keyword">PROCEDURE</span> get_employee(p_id NUMBER) <span class="hljs-keyword">IS</span>
    v_name employees.name<span class="hljs-operator">%</span>TYPE;
  <span class="hljs-keyword">BEGIN</span>
    <span class="hljs-keyword">SELECT</span> name <span class="hljs-keyword">INTO</span> v_name <span class="hljs-keyword">FROM</span> employees <span class="hljs-keyword">WHERE</span> emp_id <span class="hljs-operator">=</span> p_id;
    DBMS_OUTPUT.PUT_LINE(<span class="hljs-string">'Employee: '</span> <span class="hljs-operator">||</span> v_name);
  <span class="hljs-keyword">END</span>;
<span class="hljs-keyword">END</span> emp_pkg;
</span></code></div>
</div>
<p data-start="3851" data-end="3894">&#x2705; <em data-start="3853" data-end="3894">Asked in TCS project design interviews.</em></p>
<hr data-start="3896" data-end="3899" />
<h4 data-start="3901" data-end="3974"><strong data-start="3906" data-end="3972">5&#xfe0f;&#x20e3; What is the difference between a Procedure and a Function?</strong></h4>
<div class="_tableContainer_1rjym_1">
<div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse">
<table class="w-fit min-w-(--thread-content-width)" data-start="3975" data-end="4211">
<thead data-start="3975" data-end="4009">
<tr data-start="3975" data-end="4009">
<th data-start="3975" data-end="3985" data-col-size="sm">Feature</th>
<th data-start="3985" data-end="3997" data-col-size="sm">Procedure</th>
<th data-start="3997" data-end="4009" data-col-size="sm">Function</th>
</tr>
</thead>
<tbody data-start="4048" data-end="4211">
<tr data-start="4048" data-end="4078">
<td data-start="4048" data-end="4066" data-col-size="sm">Returns a value</td>
<td data-start="4066" data-end="4071" data-col-size="sm">No</td>
<td data-start="4071" data-end="4078" data-col-size="sm">Yes</td>
</tr>
<tr data-start="4079" data-end="4105">
<td data-start="4079" data-end="4093" data-col-size="sm">Used in SQL</td>
<td data-start="4093" data-end="4098" data-col-size="sm">No</td>
<td data-start="4098" data-end="4105" data-col-size="sm">Yes</td>
</tr>
<tr data-start="4106" data-end="4163">
<td data-start="4106" data-end="4116" data-col-size="sm">Purpose</td>
<td data-start="4116" data-end="4136" data-col-size="sm">Perform an action</td>
<td data-start="4136" data-end="4163" data-col-size="sm">Compute and return data</td>
</tr>
<tr data-start="4164" data-end="4211">
<td data-start="4164" data-end="4174" data-col-size="sm">Example</td>
<td data-start="4174" data-end="4190" data-col-size="sm">Insert record</td>
<td data-start="4190" data-end="4211" data-col-size="sm">Calculate bonus</td>
</tr>
</tbody>
</table>
</div>
</div>
<hr data-start="4213" data-end="4216" />
<h4 data-start="4218" data-end="4270"><strong data-start="4223" data-end="4268">6&#xfe0f;&#x20e3; What is Exception Handling in PL/SQL?</strong></h4>
<p data-start="4271" data-end="4347">Exception handling lets you gracefully manage runtime errors.<br data-start="4332" data-end="4335" />Structure:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">BEGIN</span>
  <span class="hljs-comment">-- Your logic</span>
EXCEPTION
  <span class="hljs-keyword">WHEN</span> NO_DATA_FOUND <span class="hljs-keyword">THEN</span>
    DBMS_OUTPUT.PUT_LINE(<span class="hljs-string">'No record found!'</span>);
  <span class="hljs-keyword">WHEN</span> ZERO_DIVIDE <span class="hljs-keyword">THEN</span>
    DBMS_OUTPUT.PUT_LINE(<span class="hljs-string">'Cannot divide by zero!'</span>);
  <span class="hljs-keyword">WHEN</span> OTHERS <span class="hljs-keyword">THEN</span>
    DBMS_OUTPUT.PUT_LINE(<span class="hljs-string">'Unknown error occurred!'</span>);
<span class="hljs-keyword">END</span>;
</span></code></div>
</div>
<p data-start="4616" data-end="4710">&#x2705; <em data-start="4618" data-end="4710">Capgemini often gives a code snippet and asks you to identify the correct exception block.</em></p>
<hr data-start="4712" data-end="4715" />
<h4 data-start="4717" data-end="4784"><strong data-start="4722" data-end="4782">7&#xfe0f;&#x20e3; Real-Time Scenario: Log Errors in an Exception Table</strong></h4>
<p data-start="4785" data-end="4856"><strong data-start="4785" data-end="4798">Question:</strong> Write code to log errors instead of stopping execution.</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">BEGIN</span>
  <span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> employees <span class="hljs-keyword">VALUES</span> (<span class="hljs-number">101</span>, <span class="hljs-string">'Mark'</span>, <span class="hljs-keyword">NULL</span>);
EXCEPTION
  <span class="hljs-keyword">WHEN</span> OTHERS <span class="hljs-keyword">THEN</span>
    <span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> error_log(err_msg, log_date)
    <span class="hljs-keyword">VALUES</span>(SQLERRM, SYSDATE);
<span class="hljs-keyword">END</span>;
</span></code></div>
</div>
<p data-start="5035" data-end="5083">&#x1f4cc; <em data-start="5038" data-end="5083">Used widely in HCL data migration projects.</em></p>
<hr data-start="5085" data-end="5088" />
<h4 data-start="5090" data-end="5156"><strong data-start="5095" data-end="5154">8&#xfe0f;&#x20e3; What is RAISE_APPLICATION_ERROR and why is it used?</strong></h4>
<p data-start="5157" data-end="5213">Used to define <strong data-start="5172" data-end="5189">custom errors</strong> in PL/SQL.<br data-start="5200" data-end="5203" />Example:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span>IF v_salary <span class="hljs-operator">&lt;</span> <span class="hljs-number">10000</span> <span class="hljs-keyword">THEN</span>
  RAISE_APPLICATION_ERROR(<span class="hljs-number">-20005</span>, <span class="hljs-string">'Salary below company threshold.'</span>);
<span class="hljs-keyword">END</span> IF;
</span></code></div>
</div>
<p data-start="5328" data-end="5418">&#x2705; <em data-start="5330" data-end="5418">TCS often asks to differentiate between system exceptions and user-defined exceptions.</em></p>
<br /><hr data-start="6161" data-end="6164" />
<h3 data-start="6166" data-end="6187">&#x1f4a1; <strong data-start="6173" data-end="6185">Pro Tip:</strong></h3>
<p data-start="6188" data-end="6256">When explaining PL/SQL logic in interviews, follow this structure:</p>
<blockquote data-start="6257" data-end="6365">
<p data-start="6259" data-end="6365">“I’ll define the business rule → trigger event → package structure → exception handling → optimization.”</p>
</blockquote>
<p data-start="6367" data-end="6470">This stepwise explanation shows <strong data-start="6399" data-end="6422">real-world thinking</strong> — exactly what TCS, HCL &amp; Capgemini look for.</p>
<hr data-start="6472" data-end="6475" />
<h3 data-start="6477" data-end="6500">&#x1f9e9; <strong data-start="6484" data-end="6498">Conclusion</strong></h3>
<p data-start="6501" data-end="6768">These <strong data-start="6507" data-end="6582">PL/SQL triggers, packages &amp; exception handling questions (2025 Edition)</strong> from <strong data-start="6588" data-end="6612">TCS, HCL &amp; Capgemini</strong> are based on <strong data-start="6626" data-end="6653">actual developer rounds</strong>.<br data-start="6654" data-end="6657" />They test your ability to <strong data-start="6683" data-end="6733">write efficient, modular, and error-proof code</strong> — crucial in enterprise systems.</p>
<p data-start="6770" data-end="6938">Focus on explaining <strong data-start="6790" data-end="6804">logic flow</strong> and <strong data-start="6809" data-end="6837">performance improvements</strong> instead of just syntax — that’s what differentiates a <strong data-start="6892" data-end="6919">senior Oracle developer</strong> from a beginner.</p>]]></content:encoded>
						                            <category domain="https://sqlqueries.in/community/"></category>                        <dc:creator>SQL Admin</dc:creator>
                        <guid isPermaLink="true">https://sqlqueries.in/community/interview-questions-answers/pl-sql-triggers-packages-exception-handling-real-time-scenario-questions-asked-in-tcs-hcl-capgemini-2025-edition/#post-11105</guid>
                    </item>
				                    <item>
                        <title>ERD (Entity Relationship Diagram) Interview Questions — For Database Design &amp; Modeling Roles (2025 Edition)</title>
                        <link>https://sqlqueries.in/community/data-warehousing-and-erd-interview-questions-answers/erd-entity-relationship-diagram-interview-questions-for-database-design-modeling-roles-2025-edition/#post-11104</link>
                        <pubDate>Sun, 09 Nov 2025 05:52:16 +0000</pubDate>
                        <description><![CDATA[If you’re preparing for database design or data modeling interviews in 2025, you’ll definitely face ERD-related questions.
ERD (Entity Relationship Diagram) questions test your ability to d...]]></description>
                        <content:encoded><![CDATA[<p data-start="822" data-end="954">If you’re preparing for <strong data-start="846" data-end="893">database design or data modeling interviews</strong> in 2025, you’ll definitely face <strong data-start="926" data-end="951">ERD-related questions</strong>.</p>
<p data-start="956" data-end="1154">ERD (Entity Relationship Diagram) questions test your ability to design efficient database schemas, define relationships, and convert real-world business processes into structured database models.</p>
<p data-start="1156" data-end="1353">These <strong data-start="1162" data-end="1204">real-time scenario-based ERD questions</strong> are frequently asked in <strong data-start="1229" data-end="1276">Infosys, Accenture, Capgemini, and Deloitte</strong> interviews — ideal for <strong data-start="1300" data-end="1350">data analysts, BI developers, and DB designers</strong>.</p>
<hr data-start="1355" data-end="1358" />
<h3 data-start="1360" data-end="1445">&#x1f539; <strong data-start="1367" data-end="1443">Top ERD (Entity Relationship Diagram) Interview Questions (2025 Edition)</strong></h3>
<h4 data-start="1447" data-end="1501"><strong data-start="1452" data-end="1499">1&#xfe0f;&#x20e3; What is an ERD and why is it important?</strong></h4>
<p data-start="1502" data-end="1819"><strong data-start="1502" data-end="1513">Answer:</strong><br data-start="1513" data-end="1516" />An <strong data-start="1519" data-end="1556">Entity Relationship Diagram (ERD)</strong> is a visual representation of entities, their attributes, and the relationships between them.<br data-start="1650" data-end="1653" />It’s used to design the logical structure of a database before actual implementation.<br data-start="1738" data-end="1741" />&#x2705; <em data-start="1743" data-end="1817">Helps ensure data integrity, reduce redundancy, and improve scalability.</em></p>
<hr data-start="1821" data-end="1824" />
<h4 data-start="1826" data-end="1880"><strong data-start="1831" data-end="1878">2&#xfe0f;&#x20e3; What are the main components of an ERD?</strong></h4>
<ul data-start="1881" data-end="2236">
<li data-start="1881" data-end="1941">
<p data-start="1883" data-end="1941"><strong data-start="1883" data-end="1894">Entity:</strong> A real-world object (e.g., Customer, Order).</p>
</li>
<li data-start="1942" data-end="2007">
<p data-start="1944" data-end="2007"><strong data-start="1944" data-end="1958">Attribute:</strong> Property of an entity (e.g., Name, ID, Price).</p>
</li>
<li data-start="2008" data-end="2093">
<p data-start="2010" data-end="2093"><strong data-start="2010" data-end="2027">Relationship:</strong> Association between entities (e.g., Customer → places → Order).</p>
</li>
<li data-start="2094" data-end="2153">
<p data-start="2096" data-end="2153"><strong data-start="2096" data-end="2117">Primary Key (PK):</strong> Unique identifier of each entity.</p>
</li>
<li data-start="2154" data-end="2236">
<p data-start="2156" data-end="2236"><strong data-start="2156" data-end="2177">Foreign Key (FK):</strong> References PK from another table to form a relationship.</p>
</li>
</ul>
<hr data-start="2238" data-end="2241" />
<h4 data-start="2243" data-end="2310"><strong data-start="2248" data-end="2308">3&#xfe0f;&#x20e3; Explain the different types of relationships in ERD.</strong></h4>
<div class="_tableContainer_1rjym_1">
<div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse">
<table class="w-fit min-w-(--thread-content-width)" data-start="2311" data-end="2676">
<thead data-start="2311" data-end="2356">
<tr data-start="2311" data-end="2356">
<th data-start="2311" data-end="2331" data-col-size="sm">Relationship Type</th>
<th data-start="2331" data-end="2341" data-col-size="sm">Example</th>
<th data-start="2341" data-end="2356" data-col-size="md">Description</th>
</tr>
</thead>
<tbody data-start="2405" data-end="2676">
<tr data-start="2405" data-end="2477">
<td data-start="2405" data-end="2424" data-col-size="sm">One-to-One (1:1)</td>
<td data-start="2424" data-end="2444" data-col-size="sm">Person → Passport</td>
<td data-start="2444" data-end="2477" data-col-size="md">Each person has one passport.</td>
</tr>
<tr data-start="2478" data-end="2557">
<td data-start="2478" data-end="2498" data-col-size="sm">One-to-Many (1:N)</td>
<td data-start="2498" data-end="2518" data-col-size="sm">Customer → Orders</td>
<td data-start="2518" data-end="2557" data-col-size="md">One customer can place many orders.</td>
</tr>
<tr data-start="2558" data-end="2676">
<td data-start="2558" data-end="2579" data-col-size="sm">Many-to-Many (M:N)</td>
<td data-start="2579" data-end="2600" data-col-size="sm">Students &#x2194; Courses</td>
<td data-start="2600" data-end="2676" data-col-size="md">Students can enroll in many courses, and courses can have many students.</td>
</tr>
</tbody>
</table>
</div>
</div>
<p data-start="2678" data-end="2770">&#x1f4cc; <em data-start="2681" data-end="2768">Many-to-many relationships are usually implemented through a junction (bridge) table.</em></p>
<hr data-start="2772" data-end="2775" />
<h4 data-start="2777" data-end="2839"><strong data-start="2782" data-end="2837">4&#xfe0f;&#x20e3; How do you convert an ERD into database tables?</strong></h4>
<ol data-start="2840" data-end="3005">
<li data-start="2840" data-end="2881">
<p data-start="2843" data-end="2881">Each <strong data-start="2848" data-end="2858">entity</strong> becomes a <strong data-start="2869" data-end="2878">table</strong>.</p>
</li>
<li data-start="2882" data-end="2927">
<p data-start="2885" data-end="2927">Each <strong data-start="2890" data-end="2903">attribute</strong> becomes a <strong data-start="2914" data-end="2924">column</strong>.</p>
</li>
<li data-start="2928" data-end="3005">
<p data-start="2931" data-end="3005"><strong data-start="2931" data-end="2947">Primary keys</strong> and <strong data-start="2952" data-end="2968">foreign keys</strong> are added to define relationships.</p>
</li>
</ol>
<p data-start="3007" data-end="3033">Example:<br data-start="3015" data-end="3018" /><strong data-start="3018" data-end="3031">Entities:</strong></p>
<ul data-start="3034" data-end="3123">
<li data-start="3034" data-end="3075">
<p data-start="3036" data-end="3075"><em data-start="3036" data-end="3073">Customer (Customer_ID, Name, Email)</em></p>
</li>
<li data-start="3076" data-end="3123">
<p data-start="3078" data-end="3123"><em data-start="3078" data-end="3121">Order (Order_ID, Order_Date, Customer_ID)</em></p>
</li>
</ul>
<p data-start="3125" data-end="3153">Relationship → One-to-Many</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">TABLE</span> Customer (
  Customer_ID NUMBER <span class="hljs-keyword">PRIMARY</span> KEY,
  Name VARCHAR2(<span class="hljs-number">100</span>),
  Email VARCHAR2(<span class="hljs-number">100</span>)
);

<span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">TABLE</span> Orders (
  Order_ID NUMBER <span class="hljs-keyword">PRIMARY</span> KEY,
  Order_Date <span class="hljs-type">DATE</span>,
  Customer_ID NUMBER <span class="hljs-keyword">REFERENCES</span> Customer(Customer_ID)
);
</span></code></div>
</div>
<hr data-start="3401" data-end="3404" />
<h4 data-start="3406" data-end="3485"><strong data-start="3411" data-end="3483">5&#xfe0f;&#x20e3; What is the difference between logical and physical data models?</strong></h4>
<div class="_tableContainer_1rjym_1">
<div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse">
<table class="w-fit min-w-(--thread-content-width)" data-start="3486" data-end="3756">
<thead data-start="3486" data-end="3518">
<tr data-start="3486" data-end="3518">
<th data-start="3486" data-end="3493" data-col-size="sm">Type</th>
<th data-start="3493" data-end="3507" data-col-size="md">Description</th>
<th data-start="3507" data-end="3518" data-col-size="sm">Example</th>
</tr>
</thead>
<tbody data-start="3554" data-end="3756">
<tr data-start="3554" data-end="3645">
<td data-start="3554" data-end="3570" data-col-size="sm">Logical Model</td>
<td data-start="3570" data-end="3638" data-col-size="md">Focuses on <em data-start="3583" data-end="3594">what data</em> is required and <em data-start="3611" data-end="3616">how</em> entities are related</td>
<td data-start="3638" data-end="3645" data-col-size="sm">ERD</td>
</tr>
<tr data-start="3646" data-end="3756">
<td data-start="3646" data-end="3663" data-col-size="sm">Physical Model</td>
<td data-start="3663" data-end="3730" data-col-size="md">Describes how data will be stored (tables, indexes, constraints)</td>
<td data-start="3730" data-end="3756" data-col-size="sm">Actual database schema</td>
</tr>
</tbody>
</table>
</div>
</div>
<p data-start="3758" data-end="3831">&#x2705; <em data-start="3760" data-end="3831">Accenture often tests this difference to check data modeling clarity.</em></p>
<hr data-start="3833" data-end="3836" />
<h4 data-start="3838" data-end="3896"><strong data-start="3843" data-end="3894">6&#xfe0f;&#x20e3; What are normalization and denormalization?</strong></h4>
<ul data-start="3897" data-end="4210">
<li data-start="3897" data-end="4093">
<p data-start="3899" data-end="3990"><strong data-start="3899" data-end="3917">Normalization:</strong><br data-start="3917" data-end="3920" />Process of organizing data to reduce redundancy.<br data-start="3970" data-end="3973" />Common forms:</p>
<ul data-start="3993" data-end="4093">
<li data-start="3993" data-end="4016">
<p data-start="3995" data-end="4016">1NF: Atomic columns</p>
</li>
<li data-start="4019" data-end="4053">
<p data-start="4021" data-end="4053">2NF: Remove partial dependency</p>
</li>
<li data-start="4056" data-end="4093">
<p data-start="4058" data-end="4093">3NF: Remove transitive dependency</p>
</li>
</ul>
</li>
<li data-start="4094" data-end="4210">
<p data-start="4096" data-end="4210"><strong data-start="4096" data-end="4116">Denormalization:</strong><br data-start="4116" data-end="4119" />Combining tables to improve query performance (used in reporting and data warehousing).</p>
</li>
</ul>
<p data-start="4212" data-end="4292">&#x1f4cc; <em data-start="4215" data-end="4290">Infosys interviewers often ask: “Why would you denormalize a data model?”</em></p>
<hr data-start="4294" data-end="4297" />
<h4 data-start="4299" data-end="4379"><strong data-start="4304" data-end="4377">7&#xfe0f;&#x20e3; How do you represent optional and mandatory relationships in ERD?</strong></h4>
<ul data-start="4380" data-end="4586">
<li data-start="4380" data-end="4478">
<p data-start="4382" data-end="4478"><strong data-start="4382" data-end="4409">Mandatory Relationship:</strong> Shown with a solid line — e.g., <em data-start="4442" data-end="4476">Each Order must have a Customer.</em></p>
</li>
<li data-start="4479" data-end="4586">
<p data-start="4481" data-end="4586"><strong data-start="4481" data-end="4507">Optional Relationship:</strong> Shown with a dashed line — e.g., <em data-start="4541" data-end="4584">Each Customer may have a Discount record.</em></p>
</li>
</ul>
<hr data-start="4588" data-end="4591" />
<h4 data-start="4593" data-end="4635"><strong data-start="4598" data-end="4633">8&#xfe0f;&#x20e3; What is cardinality in ERD?</strong></h4>
<p data-start="4636" data-end="4740"><strong data-start="4636" data-end="4651">Cardinality</strong> defines the number of instances one entity can have in relation to another.<br data-start="4727" data-end="4730" />Example:</p>
<ul data-start="4741" data-end="4848">
<li data-start="4741" data-end="4794">
<p data-start="4743" data-end="4794">A <strong data-start="4745" data-end="4757">customer</strong> can place many <strong data-start="4773" data-end="4783">orders</strong> → (1:N).</p>
</li>
<li data-start="4795" data-end="4848">
<p data-start="4797" data-end="4848">An <strong data-start="4800" data-end="4809">order</strong> belongs to one <strong data-start="4825" data-end="4837">customer</strong> → (N:1).</p>
</li>
</ul>
<p data-start="4850" data-end="4916">&#x2705; <em data-start="4852" data-end="4916">Cardinality determines foreign key placement in your database.</em></p>
<hr data-start="4918" data-end="4921" />
<h4 data-start="4923" data-end="5003"><strong data-start="4928" data-end="5001">9&#xfe0f;&#x20e3; Real-Time Scenario: Design an ERD for an Online Learning Platform</strong></h4>
<p data-start="5004" data-end="5019"><strong data-start="5004" data-end="5017">Entities:</strong></p>
<ul data-start="5020" data-end="5181">
<li data-start="5020" data-end="5084">
<p data-start="5022" data-end="5084">Student, Course, Instructor, Enrollment<br data-start="5061" data-end="5064" /><strong data-start="5064" data-end="5082">Relationships:</strong></p>
</li>
<li data-start="5085" data-end="5117">
<p data-start="5087" data-end="5117"><em data-start="5087" data-end="5115">Student &#x2194; Enrollment (1:N)</em></p>
</li>
<li data-start="5118" data-end="5149">
<p data-start="5120" data-end="5149"><em data-start="5120" data-end="5147">Course &#x2194; Enrollment (1:N)</em></p>
</li>
<li data-start="5150" data-end="5181">
<p data-start="5152" data-end="5181"><em data-start="5152" data-end="5179">Instructor &#x2194; Course (1:N)</em></p>
</li>
</ul>
<p data-start="5183" data-end="5251"><strong data-start="5183" data-end="5202">Junction Table:</strong> Enrollment(Student_ID, Course_ID, Enroll_Date)</p>
<p data-start="5253" data-end="5327">&#x2705; <em data-start="5255" data-end="5325">Common real-world scenario asked in Deloitte &amp; Capgemini interviews.</em></p>
<hr data-start="5707" data-end="5710" />
<h3 data-start="5712" data-end="5733">&#x1f4a1; <strong data-start="5719" data-end="5731">Pro Tip:</strong></h3>
<p data-start="5734" data-end="5824">During interviews, when asked to “draw an ERD,” explain your <strong data-start="5795" data-end="5807">approach</strong> before design:</p>
<blockquote data-start="5825" data-end="5981">
<p data-start="5827" data-end="5981">“I start by identifying entities from the business use case, then define relationships, keys, and finally convert them into normalized database tables.”</p>
</blockquote>
<p data-start="5983" data-end="6066">This structured explanation shows professional thinking — and earns extra points.</p>
<hr data-start="6068" data-end="6071" />
<h3 data-start="6073" data-end="6096">&#x1f9e9; <strong data-start="6080" data-end="6094">Conclusion</strong></h3>
<p data-start="6097" data-end="6285">These <strong data-start="6103" data-end="6175">ERD (Entity Relationship Diagram) interview questions (2025 Edition)</strong> help you master <strong data-start="6192" data-end="6224">database design fundamentals</strong>, <strong data-start="6226" data-end="6243">relationships</strong>, and <strong data-start="6249" data-end="6282">real-world modeling scenarios</strong>.</p>
<p data-start="6287" data-end="6462">Companies like <strong data-start="6302" data-end="6339">Infosys, Accenture, and Capgemini</strong> assess how well you can translate a business process into a clear, scalable data model — not just how you draw diagrams.</p>
<p data-start="6464" data-end="6611">Keep practicing with sample case studies (e.g., Hospital Management, Banking System, E-commerce) to strengthen your ERD and normalization skills.</p>]]></content:encoded>
						                            <category domain="https://sqlqueries.in/community/"></category>                        <dc:creator>SQL Admin</dc:creator>
                        <guid isPermaLink="true">https://sqlqueries.in/community/data-warehousing-and-erd-interview-questions-answers/erd-entity-relationship-diagram-interview-questions-for-database-design-modeling-roles-2025-edition/#post-11104</guid>
                    </item>
				                    <item>
                        <title>Data Warehousing Real-Time Interview Questions — Asked in Infosys, TCS &amp; Capgemini (2025 Edition)</title>
                        <link>https://sqlqueries.in/community/data-warehousing-and-erd-interview-questions-answers/data-warehousing-real-time-interview-questions-asked-in-infosys-tcs-capgemini-2025-edition/#post-11103</link>
                        <pubDate>Sun, 09 Nov 2025 05:50:57 +0000</pubDate>
                        <description><![CDATA[If you’re preparing for a Data Warehousing or ETL interview at Infosys, TCS, or Capgemini, you must be ready for real-world data modeling and performance tuning questions — not just theory....]]></description>
                        <content:encoded><![CDATA[<p data-start="766" data-end="969">If you’re preparing for a <strong data-start="792" data-end="829">Data Warehousing or ETL interview</strong> at <strong data-start="833" data-end="863">Infosys, TCS, or Capgemini</strong>, you must be ready for <strong data-start="887" data-end="948">real-world data modeling and performance tuning questions</strong> — not just theory.</p>
<p data-start="971" data-end="1192">These <strong data-start="977" data-end="1005">2025 interview questions</strong> cover the practical side of <strong data-start="1034" data-end="1059">data warehouse design</strong>, <strong data-start="1061" data-end="1078">ETL workflows</strong>, <strong data-start="1080" data-end="1105">fact/dimension tables</strong>, and <strong data-start="1111" data-end="1142">star-schema implementations</strong> commonly used in enterprise analytics projects.</p>
<hr data-start="1194" data-end="1197" />
<h3 data-start="1199" data-end="1277">&#x1f539; <strong data-start="1206" data-end="1275">Top Data Warehousing Real-Time Interview Questions (2025 Edition)</strong></h3>
<h4 data-start="1279" data-end="1363"><strong data-start="1284" data-end="1361">1&#xfe0f;&#x20e3; What is a Data Warehouse and how is it different from an OLTP system?</strong></h4>
<p data-start="1364" data-end="1502"><strong data-start="1364" data-end="1375">Answer:</strong><br data-start="1375" data-end="1378" />A <strong data-start="1380" data-end="1403">Data Warehouse (DW)</strong> is a centralized system for storing <strong data-start="1440" data-end="1474">historical and analytical data</strong>, optimized for reporting.</p>
<div class="_tableContainer_1rjym_1">
<div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse">
<table class="w-fit min-w-(--thread-content-width)" data-start="1503" data-end="1802">
<thead data-start="1503" data-end="1545">
<tr data-start="1503" data-end="1545">
<th data-start="1503" data-end="1513" data-col-size="sm">Feature</th>
<th data-start="1513" data-end="1520" data-col-size="sm">OLTP</th>
<th data-start="1520" data-end="1545" data-col-size="sm">Data Warehouse (OLAP)</th>
</tr>
</thead>
<tbody data-start="1591" data-end="1802">
<tr data-start="1591" data-end="1650">
<td data-start="1591" data-end="1601" data-col-size="sm">Purpose</td>
<td data-start="1601" data-end="1627" data-col-size="sm">Day-to-day transactions</td>
<td data-col-size="sm" data-start="1627" data-end="1650">Long-term analytics</td>
</tr>
<tr data-start="1651" data-end="1687">
<td data-start="1651" data-end="1665" data-col-size="sm">Data Volume</td>
<td data-start="1665" data-end="1673" data-col-size="sm">Small</td>
<td data-col-size="sm" data-start="1673" data-end="1687">Very large</td>
</tr>
<tr data-start="1688" data-end="1744">
<td data-start="1688" data-end="1701" data-col-size="sm">Operations</td>
<td data-start="1701" data-end="1724" data-col-size="sm">Insert/Update/Delete</td>
<td data-col-size="sm" data-start="1724" data-end="1744">Select/Aggregate</td>
</tr>
<tr data-start="1745" data-end="1802">
<td data-start="1745" data-end="1755" data-col-size="sm">Example</td>
<td data-start="1755" data-end="1769" data-col-size="sm">Banking app</td>
<td data-col-size="sm" data-start="1769" data-end="1802">Sales performance dashboard</td>
</tr>
</tbody>
</table>
</div>
</div>
<p data-start="1804" data-end="1851">&#x2705; <em data-start="1806" data-end="1851">Common starting question in TCS interviews.</em></p>
<hr data-start="1853" data-end="1856" />
<h4 data-start="1858" data-end="1937"><strong data-start="1863" data-end="1935">2&#xfe0f;&#x20e3; Explain the difference between Star Schema and Snowflake Schema.</strong></h4>
<ul data-start="1938" data-end="2233">
<li data-start="1938" data-end="2047">
<p data-start="1940" data-end="1958"><strong data-start="1940" data-end="1956">Star Schema:</strong></p>
<ul data-start="1961" data-end="2047">
<li data-start="1961" data-end="2016">
<p data-start="1963" data-end="2016">One fact table linked to multiple dimension tables.</p>
</li>
<li data-start="2019" data-end="2047">
<p data-start="2021" data-end="2047">Simpler, faster queries.</p>
</li>
</ul>
</li>
<li data-start="2048" data-end="2233">
<p data-start="2050" data-end="2073"><strong data-start="2050" data-end="2071">Snowflake Schema:</strong></p>
<ul data-start="2076" data-end="2233">
<li data-start="2076" data-end="2122">
<p data-start="2078" data-end="2122">Dimensions normalized into sub-dimensions.</p>
</li>
<li data-start="2125" data-end="2233">
<p data-start="2127" data-end="2233">Reduces redundancy, but increases joins.<br data-start="2167" data-end="2170" />&#x2705; <em data-start="2172" data-end="2233">Capgemini often asks which schema you used in your project.</em></p>
</li>
</ul>
</li>
</ul>
<hr data-start="2235" data-end="2238" />
<h4 data-start="2240" data-end="2305"><strong data-start="2245" data-end="2303">3&#xfe0f;&#x20e3; What are Fact and Dimension Tables? Give examples.</strong></h4>
<ul data-start="2306" data-end="2589">
<li data-start="2306" data-end="2382">
<p data-start="2308" data-end="2382"><strong data-start="2308" data-end="2323">Fact Table:</strong> Stores quantitative data (e.g., sales amount, quantity).</p>
</li>
<li data-start="2383" data-end="2483">
<p data-start="2385" data-end="2483"><strong data-start="2385" data-end="2405">Dimension Table:</strong> Stores descriptive attributes (e.g., customer, product, region).<br data-start="2470" data-end="2473" />Example:</p>
</li>
<li data-start="2484" data-end="2539">
<p data-start="2486" data-end="2539"><strong data-start="2486" data-end="2501">Fact_Sales:</strong> Date_Key, Product_Key, Sales_Amount</p>
</li>
<li data-start="2540" data-end="2589">
<p data-start="2542" data-end="2589"><strong data-start="2542" data-end="2558">Dim_Product:</strong> Product_Key, Category, Brand</p>
</li>
</ul>
<hr data-start="2591" data-end="2594" />
<h4 data-start="2596" data-end="2653"><strong data-start="2601" data-end="2651">4&#xfe0f;&#x20e3; What are Slowly Changing Dimensions (SCD)?</strong></h4>
<p data-start="2654" data-end="2714">SCDs handle historical changes in dimension data.<br data-start="2703" data-end="2706" />Types:</p>
<ul data-start="2715" data-end="2863">
<li data-start="2715" data-end="2762">
<p data-start="2717" data-end="2762"><strong data-start="2717" data-end="2728">Type 1:</strong> Overwrite old data (no history)</p>
</li>
<li data-start="2763" data-end="2814">
<p data-start="2765" data-end="2814"><strong data-start="2765" data-end="2776">Type 2:</strong> Add new record (keeps full history)</p>
</li>
<li data-start="2815" data-end="2863">
<p data-start="2817" data-end="2863"><strong data-start="2817" data-end="2828">Type 3:</strong> Add new column (partial history)</p>
</li>
</ul>
<p data-start="2865" data-end="2884">Example (Type 2):</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">UPDATE</span> dim_customer
<span class="hljs-keyword">SET</span> end_date <span class="hljs-operator">=</span> SYSDATE
<span class="hljs-keyword">WHERE</span> customer_id <span class="hljs-operator">=</span> <span class="hljs-number">101</span> <span class="hljs-keyword">AND</span> end_date <span class="hljs-keyword">IS</span> <span class="hljs-keyword">NULL</span>;
</span></code></div>
</div>
<p data-start="2985" data-end="3032">&#x2705; <em data-start="2987" data-end="3032">Real project question from Infosys DW team.</em></p>
<hr data-start="3034" data-end="3037" />
<h4 data-start="3039" data-end="3116"><strong data-start="3044" data-end="3114">5&#xfe0f;&#x20e3; What is a Data Mart and how is it related to a Data Warehouse?</strong></h4>
<p data-start="3117" data-end="3220">A <strong data-start="3119" data-end="3132">Data Mart</strong> is a subset of a Data Warehouse — focused on a specific business function.<br data-start="3207" data-end="3210" />Example:</p>
<ul data-start="3221" data-end="3333">
<li data-start="3221" data-end="3242">
<p data-start="3223" data-end="3242">Finance Data Mart</p>
</li>
<li data-start="3243" data-end="3333">
<p data-start="3245" data-end="3333">Sales Data Mart<br data-start="3260" data-end="3263" />&#x2705; <em data-start="3265" data-end="3333">TCS often checks if you understand data segregation for analytics.</em></p>
</li>
</ul>
<hr data-start="3335" data-end="3338" />
<h4 data-start="3340" data-end="3410"><strong data-start="3345" data-end="3408">6&#xfe0f;&#x20e3; How do you load data incrementally in a Data Warehouse?</strong></h4>
<p data-start="3411" data-end="3490">Incremental load = only new or changed data since last refresh.<br data-start="3474" data-end="3477" />Techniques:</p>
<ul data-start="3491" data-end="3599">
<li data-start="3491" data-end="3530">
<p data-start="3493" data-end="3530">Using <strong data-start="3499" data-end="3520">Last Updated Date</strong> columns</p>
</li>
<li data-start="3531" data-end="3564">
<p data-start="3533" data-end="3564"><strong data-start="3533" data-end="3562">Change Data Capture (CDC)</strong></p>
</li>
<li data-start="3565" data-end="3599">
<p data-start="3567" data-end="3599">Comparing hash keys<br data-start="3586" data-end="3589" />Example:</p>
</li>
</ul>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">SELECT</span> <span class="hljs-operator">*</span> <span class="hljs-keyword">FROM</span> orders
<span class="hljs-keyword">WHERE</span> last_updated <span class="hljs-operator">&gt;</span> TO_DATE(<span class="hljs-string">'2025-01-01'</span>, <span class="hljs-string">'YYYY-MM-DD'</span>);
</span></code></div>
</div>
<hr data-start="3691" data-end="3694" />
<h4 data-start="3696" data-end="3756"><strong data-start="3701" data-end="3754">7&#xfe0f;&#x20e3; What is ETL and what tools are commonly used?</strong></h4>
<p data-start="3757" data-end="3812"><strong data-start="3757" data-end="3765">ETL:</strong> Extract → Transform → Load.<br data-start="3793" data-end="3796" />Popular tools:</p>
<ul data-start="3813" data-end="3927">
<li data-start="3813" data-end="3840">
<p data-start="3815" data-end="3840">Informatica PowerCenter</p>
</li>
<li data-start="3841" data-end="3851">
<p data-start="3843" data-end="3851">Talend</p>
</li>
<li data-start="3852" data-end="3860">
<p data-start="3854" data-end="3860">SSIS</p>
</li>
<li data-start="3861" data-end="3893">
<p data-start="3863" data-end="3893">Oracle Data Integrator (ODI)</p>
</li>
<li data-start="3894" data-end="3927">
<p data-start="3896" data-end="3927">Azure Data Factory / AWS Glue</p>
</li>
</ul>
<p data-start="3929" data-end="3997">&#x2705; <em data-start="3931" data-end="3997">Capgemini focuses on data orchestration and automation concepts.</em></p>
<hr data-start="3999" data-end="4002" />
<h4 data-start="4004" data-end="4059"><strong data-start="4009" data-end="4057">8&#xfe0f;&#x20e3; What is Data Staging and why is it used?</strong></h4>
<p data-start="4060" data-end="4157">The <strong data-start="4064" data-end="4080">staging area</strong> temporarily stores raw extracted data before transformation.<br data-start="4141" data-end="4144" />Advantages:</p>
<ul data-start="4158" data-end="4279">
<li data-start="4158" data-end="4193">
<p data-start="4160" data-end="4193">Reduces load on source systems.</p>
</li>
<li data-start="4194" data-end="4235">
<p data-start="4196" data-end="4235">Supports incremental data validation.</p>
</li>
<li data-start="4236" data-end="4279">
<p data-start="4238" data-end="4279">Simplifies error correction during ETL.</p>
</li>
</ul>
<hr data-start="4281" data-end="4284" />
<h4 data-start="4286" data-end="4349"><strong data-start="4291" data-end="4347">9&#xfe0f;&#x20e3; What are Aggregate Tables and why are they used?</strong></h4>
<p data-start="4350" data-end="4441">Aggregate tables store <strong data-start="4373" data-end="4401">pre-calculated summaries</strong> (e.g., monthly sales totals).<br data-start="4431" data-end="4434" />They:</p>
<ul data-start="4442" data-end="4523">
<li data-start="4442" data-end="4472">
<p data-start="4444" data-end="4472">Improve query performance.</p>
</li>
<li data-start="4473" data-end="4523">
<p data-start="4475" data-end="4523">Reduce computation on live queries.<br data-start="4510" data-end="4513" />Example:</p>
</li>
</ul>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">TABLE</span> monthly_sales <span class="hljs-keyword">AS</span>
<span class="hljs-keyword">SELECT</span> product_id, <span class="hljs-built_in">SUM</span>(amount) <span class="hljs-keyword">AS</span> total_sales
<span class="hljs-keyword">FROM</span> sales
<span class="hljs-keyword">GROUP</span> <span class="hljs-keyword">BY</span> product_id;
</span></code></div>
</div>
<p data-start="4643" data-end="4708">&#x2705; <em data-start="4645" data-end="4708">Infosys uses this example in Power BI + Oracle DW interviews.</em></p>
<hr data-start="4710" data-end="4713" />
<h4 data-start="4715" data-end="4777"><strong data-start="4720" data-end="4775">&#x1f51f; How do you ensure data quality in ETL processes?</strong></h4>
<ul data-start="4778" data-end="4933">
<li data-start="4778" data-end="4816">
<p data-start="4780" data-end="4816">Validate source vs. target counts.</p>
</li>
<li data-start="4817" data-end="4852">
<p data-start="4819" data-end="4852">Check for duplicates and nulls.</p>
</li>
<li data-start="4853" data-end="4877">
<p data-start="4855" data-end="4877">Maintain audit logs.</p>
</li>
<li data-start="4878" data-end="4933">
<p data-start="4880" data-end="4933">Use <strong data-start="4884" data-end="4909">error handling tables</strong> for rejected records.</p>
</li>
</ul>
<p data-start="4935" data-end="4994">&#x1f4cc; <em data-start="4938" data-end="4994">Practical question in real-time DW project interviews.</em></p>
<hr data-start="4996" data-end="4999" />
<h3 data-start="5001" data-end="5022">&#x1f4a1; <strong data-start="5008" data-end="5020">Pro Tip:</strong></h3>
<p data-start="5023" data-end="5095">When explaining a project scenario, always describe the <strong data-start="5079" data-end="5092">data flow</strong>:</p>
<blockquote data-start="5096" data-end="5235">
<p data-start="5098" data-end="5235">“We extracted sales data from SAP, transformed it in Informatica, and loaded it into an Oracle Data Warehouse for Power BI dashboards.”</p>
</blockquote>
<p data-start="5237" data-end="5304">It adds credibility and aligns with real enterprise environments.</p>
<hr data-start="5306" data-end="5309" />
<h3 data-start="5311" data-end="5334">&#x1f9e9; <strong data-start="5318" data-end="5332">Conclusion</strong></h3>
<p data-start="5335" data-end="5510">These <strong data-start="5341" data-end="5406">Data Warehousing real-time interview questions (2025 Edition)</strong> reflect what top companies like <strong data-start="5439" data-end="5470">Infosys, TCS, and Capgemini</strong> look for in ETL and BI professionals.</p>
<p data-start="5512" data-end="5678">Focus on understanding <strong data-start="5535" data-end="5561">data modeling concepts</strong>, <strong data-start="5563" data-end="5576">SCD types</strong>, and <strong data-start="5582" data-end="5616">incremental loading techniques</strong> — they form the foundation of every data warehouse project.</p>
<p data-start="5680" data-end="5812">Consistent practice with <strong data-start="5705" data-end="5748">ETL tools and SQL-based transformations</strong> will help you confidently answer any scenario-based question.</p>]]></content:encoded>
						                            <category domain="https://sqlqueries.in/community/"></category>                        <dc:creator>SQL Admin</dc:creator>
                        <guid isPermaLink="true">https://sqlqueries.in/community/data-warehousing-and-erd-interview-questions-answers/data-warehousing-real-time-interview-questions-asked-in-infosys-tcs-capgemini-2025-edition/#post-11103</guid>
                    </item>
				                    <item>
                        <title>Oracle Performance Tuning &amp; Query Optimization Questions — Asked in Accenture &amp; Infosys (2025 Edition)</title>
                        <link>https://sqlqueries.in/community/oracle-interview-questions-answers/oracle-performance-tuning-query-optimization-questions-asked-in-accenture-infosys-2025-edition/#post-11102</link>
                        <pubDate>Sun, 09 Nov 2025 05:49:42 +0000</pubDate>
                        <description><![CDATA[Performance tuning is one of the most important skills for Oracle professionals — and it’s a hot topic in Accenture and Infosys technical interviews.
This 2025 guide compiles real Oracle pe...]]></description>
                        <content:encoded><![CDATA[<p data-start="743" data-end="904">Performance tuning is one of the most important skills for Oracle professionals — and it’s a <em data-start="836" data-end="847">hot topic</em> in <strong data-start="851" data-end="864">Accenture</strong> and <strong data-start="869" data-end="880">Infosys</strong> technical interviews.</p>
<p data-start="906" data-end="1132">This 2025 guide compiles <strong data-start="931" data-end="992">real Oracle performance tuning and optimization questions</strong>, helping you understand how to make SQL queries faster, reduce execution time, and optimize resource utilization in real-world scenarios.</p>
<p data-start="1134" data-end="1263">These questions are ideal for <strong data-start="1164" data-end="1218">Oracle developers, DBAs, and performance engineers</strong> preparing for production-level interviews.</p>
<hr data-start="1265" data-end="1268" />
<h3 data-start="1270" data-end="1358">&#x1f539; <strong data-start="1277" data-end="1356">Top Oracle Performance Tuning &amp; Query Optimization Questions (2025 Edition)</strong></h3>
<h4 data-start="1360" data-end="1431"><strong data-start="1365" data-end="1429">1&#xfe0f;&#x20e3; What are the key steps in Oracle SQL performance tuning?</strong></h4>
<p data-start="1432" data-end="1445"><strong data-start="1432" data-end="1443">Answer:</strong></p>
<ol data-start="1446" data-end="1743">
<li data-start="1446" data-end="1499">
<p data-start="1449" data-end="1499">Identify slow-running SQL using AWR/ASH reports.</p>
</li>
<li data-start="1500" data-end="1562">
<p data-start="1503" data-end="1562">Analyze the <strong data-start="1515" data-end="1531">EXPLAIN PLAN</strong> to check table access paths.</p>
</li>
<li data-start="1563" data-end="1623">
<p data-start="1566" data-end="1623">Tune the query using indexes, hints, or query rewrites.</p>
</li>
<li data-start="1624" data-end="1743">
<p data-start="1627" data-end="1743">Monitor execution cost and I/O statistics.<br data-start="1669" data-end="1672" />&#x2705; <em data-start="1674" data-end="1743">This structured answer is often expected in Infosys DBA interviews.</em></p>
</li>
</ol>
<hr data-start="1745" data-end="1748" />
<h4 data-start="1750" data-end="1825"><strong data-start="1755" data-end="1823">2&#xfe0f;&#x20e3; How do you view the execution plan of a SQL query in Oracle?</strong></h4>
<p data-start="1826" data-end="1861">Use the <strong data-start="1834" data-end="1850">EXPLAIN PLAN</strong> command:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span>EXPLAIN PLAN <span class="hljs-keyword">FOR</span> 
<span class="hljs-keyword">SELECT</span> <span class="hljs-operator">*</span> <span class="hljs-keyword">FROM</span> employees <span class="hljs-keyword">WHERE</span> department_id <span class="hljs-operator">=</span> <span class="hljs-number">50</span>;

<span class="hljs-keyword">SELECT</span> <span class="hljs-operator">*</span> <span class="hljs-keyword">FROM</span> <span class="hljs-keyword">TABLE</span>(DBMS_XPLAN.DISPLAY);
</span></code></div>
</div>
<p data-start="1983" data-end="2085">&#x1f4cc; Helps identify <strong data-start="2001" data-end="2021">full table scans</strong>, <strong data-start="2023" data-end="2038">index scans</strong>, and <strong data-start="2044" data-end="2060">join methods</strong> used by the optimizer.</p>
<hr data-start="2087" data-end="2090" />
<h4 data-start="2092" data-end="2174"><strong data-start="2097" data-end="2172">3&#xfe0f;&#x20e3; What is the difference between a full table scan and an index scan?</strong></h4>
<div class="_tableContainer_1rjym_1">
<div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse">
<table class="w-fit min-w-(--thread-content-width)" data-start="2175" data-end="2407">
<thead data-start="2175" data-end="2211">
<tr data-start="2175" data-end="2211">
<th data-start="2175" data-end="2182" data-col-size="sm">Type</th>
<th data-start="2182" data-end="2196" data-col-size="sm">Description</th>
<th data-start="2196" data-end="2211" data-col-size="sm">Performance</th>
</tr>
</thead>
<tbody data-start="2251" data-end="2407">
<tr data-start="2251" data-end="2324">
<td data-start="2251" data-end="2269" data-col-size="sm">Full Table Scan</td>
<td data-col-size="sm" data-start="2269" data-end="2299">Reads all rows in the table</td>
<td data-col-size="sm" data-start="2299" data-end="2324">Slow for large tables</td>
</tr>
<tr data-start="2325" data-end="2407">
<td data-start="2325" data-end="2338" data-col-size="sm">Index Scan</td>
<td data-col-size="sm" data-start="2338" data-end="2369">Uses an index to locate rows</td>
<td data-col-size="sm" data-start="2369" data-end="2407">Much faster if column is indexed</td>
</tr>
</tbody>
</table>
</div>
</div>
<p data-start="2409" data-end="2466">&#x2705; <em data-start="2411" data-end="2466">Common question in Accenture SQL optimization rounds.</em></p>
<hr data-start="2468" data-end="2471" />
<h4 data-start="2473" data-end="2520"><strong data-start="2478" data-end="2518">4&#xfe0f;&#x20e3; What are Oracle optimizer modes?</strong></h4>
<p data-start="2521" data-end="2628">Oracle’s <strong data-start="2530" data-end="2560">Cost-Based Optimizer (CBO)</strong> chooses the best query plan based on statistics.<br data-start="2609" data-end="2612" />Modes include:</p>
<ul data-start="2629" data-end="2773">
<li data-start="2629" data-end="2697">
<p data-start="2631" data-end="2697"><strong data-start="2631" data-end="2644">ALL_ROWS:</strong> Optimizes for throughput (best for large queries).</p>
</li>
<li data-start="2698" data-end="2773">
<p data-start="2700" data-end="2773"><strong data-start="2700" data-end="2715">FIRST_ROWS:</strong> Optimizes for response time (best for OLTP).<br data-start="2760" data-end="2763" />Example:</p>
</li>
</ul>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">ALTER</span> SESSION <span class="hljs-keyword">SET</span> OPTIMIZER_MODE <span class="hljs-operator">=</span> FIRST_ROWS;
</span></code></div>
</div>
<hr data-start="2833" data-end="2836" />
<h4 data-start="2838" data-end="2910"><strong data-start="2843" data-end="2908">5&#xfe0f;&#x20e3; How can you detect and resolve high CPU usage in queries?</strong></h4>
<ul data-start="2911" data-end="3264">
<li data-start="2911" data-end="3037">
<p data-start="2913" data-end="2947">Identify high-CPU queries using:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">SELECT</span> sql_id, cpu_time, executions <span class="hljs-keyword">FROM</span> v$<span class="hljs-keyword">sql</span> <span class="hljs-keyword">ORDER</span> <span class="hljs-keyword">BY</span> cpu_time <span class="hljs-keyword">DESC</span>;
</span></code></div>
</div>
</li>
<li data-start="3038" data-end="3100">
<p data-start="3040" data-end="3100">Tune inefficient queries (missing indexes, complex joins).</p>
</li>
<li data-start="3101" data-end="3213">
<p data-start="3103" data-end="3139">Update optimizer statistics using:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">EXEC</span> DBMS_STATS.GATHER_TABLE_STATS(<span class="hljs-string">'HR'</span>, <span class="hljs-string">'EMPLOYEES'</span>);
</span></code></div>
</div>
</li>
<li data-start="3214" data-end="3264">
<p data-start="3216" data-end="3264">Break large transactions into smaller batches.</p>
</li>
</ul>
<hr data-start="3266" data-end="3269" />
<h4 data-start="3271" data-end="3337"><strong data-start="3276" data-end="3335">6&#xfe0f;&#x20e3; What are bind variables and why are they important?</strong></h4>
<p data-start="3338" data-end="3441">Bind variables <strong data-start="3353" data-end="3376">improve performance</strong> by allowing query reuse and preventing hard parses.<br data-start="3428" data-end="3431" />Example:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">SELECT</span> <span class="hljs-operator">*</span> <span class="hljs-keyword">FROM</span> employees <span class="hljs-keyword">WHERE</span> emp_id <span class="hljs-operator">=</span> :emp_id;
</span></code></div>
</div>
<p data-start="3501" data-end="3562">&#x2705; <em data-start="3503" data-end="3562">A favorite question in Accenture Oracle interview rounds.</em></p>
<hr data-start="3564" data-end="3567" />
<h4 data-start="3569" data-end="3628"><strong data-start="3574" data-end="3626">7&#xfe0f;&#x20e3; How do you identify and fix missing indexes?</strong></h4>
<ul data-start="3629" data-end="3902">
<li data-start="3629" data-end="3693">
<p data-start="3631" data-end="3693">Use <strong data-start="3635" data-end="3651">EXPLAIN PLAN</strong> or <strong data-start="3655" data-end="3668">AUTOTRACE</strong> to check access paths.</p>
</li>
<li data-start="3694" data-end="3743">
<p data-start="3696" data-end="3743">Look for “TABLE ACCESS FULL” on large tables.</p>
</li>
<li data-start="3744" data-end="3847">
<p data-start="3746" data-end="3775">Create appropriate indexes:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">CREATE</span> INDEX idx_emp_dept <span class="hljs-keyword">ON</span> employees(department_id);
</span></code></div>
</div>
</li>
<li data-start="3848" data-end="3902">
<p data-start="3850" data-end="3902">Verify improvement via <strong data-start="3873" data-end="3901">execution cost reduction</strong>.</p>
</li>
</ul>
<hr data-start="3904" data-end="3907" />
<h4 data-start="3909" data-end="3970"><strong data-start="3914" data-end="3968">8&#xfe0f;&#x20e3; What is a SQL hint and when should it be used?</strong></h4>
<p data-start="3971" data-end="4023">Hints influence the optimizer’s behavior. Example:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">SELECT</span> <span class="hljs-comment">/*+ INDEX(e idx_emp_dept) */</span> <span class="hljs-operator">*</span> <span class="hljs-keyword">FROM</span> employees e <span class="hljs-keyword">WHERE</span> department_id <span class="hljs-operator">=</span> <span class="hljs-number">50</span>;
</span></code></div>
</div>
<p data-start="4116" data-end="4212">&#x26a0;&#xfe0f; Use hints only when the optimizer’s plan is inefficient. Overuse can make SQL non-portable.</p>
<hr data-start="4214" data-end="4217" />
<h4 data-start="4219" data-end="4291"><strong data-start="4224" data-end="4289">9&#xfe0f;&#x20e3; What is partitioning and how does it improve performance?</strong></h4>
<p data-start="4292" data-end="4370">Partitioning splits large tables into smaller, manageable segments.<br data-start="4359" data-end="4362" />Types:</p>
<ul data-start="4371" data-end="4535">
<li data-start="4371" data-end="4430">
<p data-start="4373" data-end="4430"><strong data-start="4373" data-end="4395">Range Partitioning</strong> — based on date or numeric range</p>
</li>
<li data-start="4431" data-end="4482">
<p data-start="4433" data-end="4482"><strong data-start="4433" data-end="4454">Hash Partitioning</strong> — distributes rows evenly</p>
</li>
<li data-start="4483" data-end="4535">
<p data-start="4485" data-end="4535"><strong data-start="4485" data-end="4506">List Partitioning</strong> — based on discrete values</p>
</li>
</ul>
<p data-start="4537" data-end="4592">&#x2705; <em data-start="4539" data-end="4590">Reduces scan time and improves query parallelism.</em></p>
<p data-start="4594" data-end="4604">Example:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span><span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">TABLE</span> sales (
  sale_id NUMBER,
  sale_date <span class="hljs-type">DATE</span>
)
<span class="hljs-keyword">PARTITION</span> <span class="hljs-keyword">BY</span> <span class="hljs-keyword">RANGE</span>(sale_date) (
  <span class="hljs-keyword">PARTITION</span> p_2024 <span class="hljs-keyword">VALUES</span> LESS THAN (TO_DATE(<span class="hljs-string">'01-JAN-2025'</span>, <span class="hljs-string">'DD-MON-YYYY'</span>))
);
</span></code></div>
</div>
<hr data-start="4786" data-end="4789" />
<h4 data-start="4791" data-end="4843"><strong data-start="4796" data-end="4841">&#x1f51f; What are AWR and ASH reports used for?</strong></h4>
<ul data-start="4844" data-end="5081">
<li data-start="4844" data-end="4930">
<p data-start="4846" data-end="4930"><strong data-start="4846" data-end="4886">AWR (Automatic Workload Repository):</strong> Captures database performance statistics.</p>
</li>
<li data-start="4931" data-end="5081">
<p data-start="4933" data-end="5081"><strong data-start="4933" data-end="4966">ASH (Active Session History):</strong> Tracks active sessions in real-time.<br data-start="5003" data-end="5006" />They help identify high-load SQLs, wait events, and resource bottlenecks.</p>
</li>
</ul>
<p data-start="5083" data-end="5096">&#x1f4cc; Example:</p>
<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary">
<div class="sticky top-9">
<div class="absolute end-0 bottom-0 flex h-9 items-center pe-2">
<div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"> </div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! language-sql"><span>@?<span class="hljs-operator">/</span>rdbms<span class="hljs-operator">/</span>admin<span class="hljs-operator">/</span>awrrpt.sql
</span></code></div>
</div>
<p data-start="5134" data-end="5184">Generates a detailed report for tuning analysis.</p>
<hr data-start="5186" data-end="5189" />
<h3 data-start="5191" data-end="5243">&#x1f4a1; <strong data-start="5198" data-end="5241">Pro Tips for Oracle Query Optimization:</strong></h3>
<ul data-start="5244" data-end="5533">
<li data-start="5244" data-end="5296">
<p data-start="5246" data-end="5296">Keep statistics <strong data-start="5262" data-end="5276">up to date</strong> using DBMS_STATS.</p>
</li>
<li data-start="5297" data-end="5354">
<p data-start="5299" data-end="5354">Use <strong data-start="5303" data-end="5324">composite indexes</strong> for multi-column filtering.</p>
</li>
<li data-start="5355" data-end="5413">
<p data-start="5357" data-end="5413">Prefer <strong data-start="5364" data-end="5388">set-based operations</strong> over row-by-row loops.</p>
</li>
<li data-start="5414" data-end="5467">
<p data-start="5416" data-end="5467">Use <strong data-start="5420" data-end="5442">materialized views</strong> for heavy aggregation.</p>
</li>
<li data-start="5468" data-end="5533">
<p data-start="5470" data-end="5533">Monitor <strong data-start="5478" data-end="5504">buffer cache hit ratio</strong> and <strong data-start="5509" data-end="5530">shared pool usage</strong>.</p>
</li>
</ul>
<hr data-start="5535" data-end="5538" />
<h3 data-start="5540" data-end="5563">&#x1f9e9; <strong data-start="5547" data-end="5561">Conclusion</strong></h3>
<p data-start="5564" data-end="5741">These <strong data-start="5570" data-end="5641">Oracle performance tuning and optimization questions (2025 Edition)</strong> asked in <strong data-start="5651" data-end="5674">Accenture &amp; Infosys</strong> interviews focus on <strong data-start="5695" data-end="5738">real-world diagnostic and tuning skills</strong>.</p>
<p data-start="5743" data-end="5987">Mastering execution plans, indexing strategies, and query rewrite logic will make you stand out in both <strong data-start="5847" data-end="5860">developer</strong> and <strong data-start="5865" data-end="5872">DBA</strong> interviews.<br data-start="5884" data-end="5887" />Keep practicing on Oracle LiveSQL or a local test environment to sharpen your optimization skills.</p>]]></content:encoded>
						                            <category domain="https://sqlqueries.in/community/"></category>                        <dc:creator>SQL Admin</dc:creator>
                        <guid isPermaLink="true">https://sqlqueries.in/community/oracle-interview-questions-answers/oracle-performance-tuning-query-optimization-questions-asked-in-accenture-infosys-2025-edition/#post-11102</guid>
                    </item>
							        </channel>
        </rss>
		