📎 Referral Code: —
🎁 Referral Earnings ₹0 →
📊 Dashboard Sign In
🎁 ₹0
Your Referral Earnings → Tap to view
Buy
🛒
Buy Course
Videos
📘
Basic Videos
🚀
Project Related Videos
🐍
Old Videos Style — will be removed soon
📚
Buy Book
After Course Completion
📒
My Interview Tracker — HR calls & follow-ups
📈
My Performance — Track your progress
🎯
Interview Prep — Resume & questions for a job
🏢
Company Interview Questions — with answers
🤖
Central Command — your HQ bot
💼
Jobs — AWS Data Engineer openings
Personal Training
🎬
Live Classes
🎯
My 1:1 Dashboard
🗺️
Course Roadmap
🎤
Mock Interview
🧑‍💼
HR Discussion
🗓️
Slot Booking
📅
My Booked Slots
Passive Income
🎁
Refer & Earn — ₹1,000 per referral
🤝
Browse Job Support
💰
Become a Supporter
🔗
Browse Referrals
📢
Post a Referral
🎓
Course Marketplace — Other Trainers
🧑‍🏫
Teach a Course
📊
My Courses & Earnings
🎬
Reels
AI Tools
🌐
Project Explanation Agent
👤
My Profile
🏢
Recruiter Board
🛟
Support Works

← Kotak Mahindra Bank interview questions

🎬No video for this question yet. The written answer is below.

Difference between DELETE, TRUNCATE, DROP,
  • SCD Type 1, 2, 3,
  • What is Fact Table and Dimension Table,
  • What is the difference between Star Schema and Snowflake Schema,
  • How to update using WHERE condition,
  • Duplicate Detection,
  • Window Functions,
  • Oracle DB Questions

🏢 Kotak Mahindra Bank 🏷️ SQL #2 of 2

📝 Answer

Interviewer:
Can you explain the difference between DELETE, TRUNCATE, and DROP in SQL?
Candidate:
So basically, whenever I hear DELETE, TRUNCATE, and DROP, I don’t just think about syntax… I think about impact on data and structure. First, DELETE. This is a DML operation. It removes data row by row and we can use WHERE conditions. In my project, I used DELETE when I needed to remove only specific records, like invalid transactions. TRUNCATE is faster. It removes all data from the table but keeps the structure. It does not support WHERE condition. I used TRUNCATE in staging tables where I wanted to clear data before loading fresh data. DROP is different. It removes the entire table, including structure. Once dropped, everything is gone. I used it rarely, mostly during cleanup or re-creation of tables. So basically, DELETE is selective, TRUNCATE is full data removal, and DROP removes everything including schema.
Interviewer:
Can you explain SCD Type 1, Type 2, and Type 3 with real-time examples?
Candidate:
So basically, SCD is something I used in data warehousing projects. Type 1 means overwrite. If data changes, we update it directly. For example, if customer address changes, we just replace the old value. Type 2 maintains history. Instead of updating, we insert a new record with versioning. In one of my projects, I used Type 2 for tracking customer address history. Type 3 stores limited history. We keep current and previous values in the same row. So basically, Type 1 is overwrite, Type 2 is full history, and Type 3 is partial history.
Interviewer:
What is a Fact Table and a Dimension Table?
Candidate:
So basically, I think of this in terms of business reporting. Fact table contains measurable data, like sales amount, transaction count. It is usually large. Dimension table contains descriptive data, like customer, product, location. In my project, sales data was stored in fact table, and customer details were in dimension table. So basically, fact is numeric and transactional, dimension is descriptive.
Interviewer:
What is the difference between Star Schema and Snowflake Schema?
Candidate:
So basically, this is about how we design data warehouse. Star schema is simple. Fact table is connected directly to dimension tables. It is denormalized and faster for queries. Snowflake schema is normalized. Dimension tables are further split into multiple tables. In my project, I preferred star schema because it gave better query performance and was easier to understand. Snowflake is useful when we want to reduce redundancy.
Interviewer:
How do you update records using WHERE condition?
Candidate:
So basically, UPDATE with WHERE is used to modify specific rows. In my project, I used it to correct data issues.
UPDATE customers
SET status = 'active'
WHERE last_login > '2025-01-01';
So this updates only selected records, not entire table.
Interviewer:
How do you detect duplicates in SQL?
Candidate:
So basically, duplicate detection is very common in ETL. I usually use GROUP BY and HAVING.
SELECT email, COUNT(*)
FROM users
GROUP BY email
HAVING COUNT(*) > 1;
In my project, I also used ROW_NUMBER to remove duplicates.
Interviewer:
Can you explain Window Functions?
Candidate:
So basically, window functions allow us to perform calculations across a set of rows without collapsing them. I used them for ranking, running totals, and trend analysis. For example, using ROW_NUMBER or LAG. They are very useful in analytics.
Interviewer:
What are some important Oracle DB concepts or questions you have worked on?
Candidate:
So basically, I worked with Oracle in earlier projects. I handled indexing strategies, query optimization, and partitioning. One challenge I faced was slow queries. Then I used explain plan to analyze performance. I also worked with stored procedures and sequences. So basically, Oracle concepts I used were indexing, partitions, execution plans, and PL/SQL.
Interviewer (Follow-up):
Good. Can you explain how indexing impacts query performance in Oracle?