Menu

Earn Premium with Referrals

Invite your friends and earn Premium rewards through our referral program.

See how it works and start inviting friends.

Scenario Questions - Part 1
SQL

Scenario Questions - Part 1

Practice real-world SQL scenarios involving business data, reporting queries, joins, filtering, aggregation, and production database problems.

Your company has an Employees table and a Departments table. Management wants a report showing all employees, even those who are not assigned to any department. Which JOIN would you use and why?

A query that searches customers by email has become very slow after the table reached 10 million rows. How would you improve its performance?

A banking application transfers ₹5,000 from Account A to Account B. The amount is deducted from A, but the server crashes before it's added to B. How can SQL ensure data consistency?

An Orders table stores customer details repeatedly for every order, making updates difficult. How would you redesign the database?

Two transactions are waiting for each other to release locks, and neither can continue. What happened, and how would you prevent it?

A query becomes slow after the table grows to millions of rows.

Customers report duplicate records appearing in reports.

A report should include employees who have no department.

A dashboard query takes 30 seconds to load.

Two users update the same row simultaneously.

A transaction fails halfway through a payment process.

A database server's CPU usage suddenly spikes.

An index exists, but SQL still performs a full table scan.

You need to archive old data without affecting current queries.

The business wants faster reports but also frequent updates—how would you balance indexing and write performance?

My Private Notes

Notes are auto-saved locally to this device.