Skip to main content
Beginnerconceptual

What is data abstraction in a DBMS? Explain its three levels.

ReportedSource: GeeksforGeeks interview experience: TCS Ninja + Digital

Quick answer

Hiding storage details through three levels: physical (how stored), logical (what tables/relations exist), view (what each user sees). Gives physical and logical data independence.

Data abstraction hides storage complexity from users so each user sees only what they need.

1. Physical (internal) level. How data is actually stored: files, pages, indexes, compression, block layout. Handled by the DBMS and DBAs.

2. Logical (conceptual) level. What data is stored and how it relates: tables, columns, data types, keys, constraints. Designers and developers work here.

3. View (external) level. What a particular user or application sees: views that show only some columns or rows, e.g. a payroll clerk sees salaries but not medical records.

Why it matters: data independence.

  • Physical data independence: change storage (add an index, move files) without changing the logical schema or applications.
  • Logical data independence: change the logical schema (add a column) without breaking existing views and applications (harder to achieve).

OOP link. If the interviewer meant abstraction in OOP: hiding implementation details behind an interface or abstract class; mention both if unsure and ask which they mean.

See the concept: Atomic publication

Atomic publication

BEGIN TRANSACTION;

  1. 1Close and insert customer versions
  2. 2Upsert orders, sales, payments
  3. 3Insert batch ledger row
  4. 4Advance watermark

COMMIT: batch published

Committed watermark

Moves forward only after COMMIT.

Everything inside BEGIN…COMMIT lands together or not at all. A failure leaves the old facts and the old watermark untouched.

Discussion