🧠 What is Abstraction
In DBMS (Database Management System), abstraction means hiding the complex details of how data is stored and maintained, and instead providing users with a simplified view of the data.
This is achieved through three levels of data abstraction, also called the Three-Schema Architecture.
<div class="infographic-dbind" id="dbindWrap">
<style>
.infographic-dbind {
--ink: #1a1a1a;
--ink-soft: #5c5c5c;
--paper: #ffffff;
--paper-alt: #f6f3ee;
--accent: #2563eb;
--accent-soft:#e3ebfd;
--line: #ddd6c9;
--code-bg: #1e2430;
--code-ink: #d7dde8;
--tok-kw: #7aa2f7;
--tok-type: #e0af68;
--tok-str: #9ece6a;
--tok-punct: #7d8799;
background: var(--paper);
color: var(--ink);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
padding: 2.5rem 1.5rem;
border-radius: 14px;
box-sizing: border-box;
max-width: 640px;
margin: 0 auto;
}
.infographic-dbind[data-theme="dark"] {
--ink: #e8e6e1;
--ink-soft: #9a968c;
--paper: #121212;
--paper-alt: #1e1e26;
--accent: #5b8def;
--accent-soft:#202942;
--line: #2c313d;
--code-bg: #0e1218;
--code-ink: #d7dde8;
--tok-kw: #7aa2f7;
--tok-type: #e0af68;
--tok-str: #9ece6a;
--tok-punct: #7d8799;
}
.infographic-dbind * { box-sizing: border-box; }
.dbind-eyebrow {
font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
color: var(--accent); font-weight: 700; margin: 0 0 0.4rem; text-align: center;
}
.dbind-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 2rem; text-align: center; letter-spacing: -0.01em; }
/* --- Stacked levels diagram --- */
.dbind-stack { display: flex; flex-direction: column; align-items: center; }
.dbind-level {
width: 100%; max-width: 300px;
background: var(--accent); color: #fff;
border: none; border-radius: 8px;
padding: 0.85rem 1rem; font: inherit; font-weight: 700; font-size: 0.95rem;
cursor: pointer; text-align: center;
transition: transform .15s, box-shadow .15s;
}
.dbind-level:hover { transform: translateY(-1px); }
.dbind-level.is-active { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4.5px var(--accent); }
.dbind-level .lvl-sub { display: block; font-size: 0.68rem; font-weight: 500; opacity: 0.85; margin-top: 0.15rem; }
.dbind-link {
display: flex; align-items: center; gap: 0.6rem;
padding: 0.5rem 0; width: 100%; max-width: 300px; justify-content: center;
}
.dbind-link .arrow-glyph { font-size: 1.1rem; color: var(--ink-soft); }
.dbind-link .link-label { font-size: 0.72rem; color: var(--ink-soft); font-style: italic; white-space: nowrap; }
/* --- Decorative connector + stored database --- */
.dbind-storage { display: flex; flex-direction: column; align-items: center; margin-top: 0.4rem; }
.dbind-connector { display: block; }
.dbind-cylinders { display: flex; gap: 1.6rem; margin-top: -1px; }
.dbind-cylinder svg { display: block; }
.dbind-storage-label {
margin-top: 0.6rem; font-weight: 700; font-size: 0.85rem; color: var(--accent);
letter-spacing: 0.02em;
}
/* --- Detail panel --- */
.dbind-panel {
margin-top: 2rem; background: var(--paper-alt); border: 1px solid var(--line);
border-radius: 12px; padding: 1.4rem 1.5rem;
}
.dbind-panel.is-fading { animation: dbindFade .35s ease; }
@keyframes dbindFade { from { opacity: 0.2; } to { opacity: 1; } }
.dbind-panel > *:last-child { margin-bottom: 0; }
.dbind-panel-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.7rem; color: var(--accent); }
.dbind-panel-list { margin: 0 0 0.9rem; padding-left: 1.1rem; font-size: 0.86rem; line-height: 1.5; }
.dbind-panel-list li { margin-bottom: 0.3rem; }
.dbind-example-label {
font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
color: var(--ink-soft); font-weight: 700; margin: 0 0 0.3rem;
}
.dbind-example-text { font-size: 0.85rem; line-height: 1.5; margin: 0 0 0.8rem; }
.dbind-code {
background: var(--code-bg); color: var(--code-ink);
border-radius: 8px; padding: 0.8rem 1rem; font-size: 0.78rem; line-height: 1.5;
overflow-x: auto; margin: 0 0 0.9rem; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.tok-kw { color: var(--tok-kw); font-weight: 600; }
.tok-type { color: var(--tok-type); }
.tok-str { color: var(--tok-str); }
.tok-punct{ color: var(--tok-punct); }
.dbind-output-label {
font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
color: var(--ink-soft); font-weight: 700; margin: 0 0 0.4rem;
}
.dbind-output-table {
width: 100%; border-collapse: collapse; font-size: 0.82rem;
background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.dbind-output-table th, .dbind-output-table td {
padding: 0.45rem 0.65rem; text-align: left; border-bottom: 1px solid var(--line);
}
.dbind-output-table th {
background: var(--accent-soft); color: var(--accent); font-weight: 700;
font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em;
}
.dbind-output-table tr:last-child td { border-bottom: none; }
@media (prefers-reduced-motion: reduce) {
.infographic-dbind *, .infographic-dbind *::before, .infographic-dbind *::after {
animation-duration: 0.001ms !important; transition-duration: 0.001ms !important;
}
}
</style>
<p class="dbind-eyebrow">Three Schema Architecture</p>
<h2 class="dbind-title">Levels of Abstraction in DBMS</h2>
<div class="dbind-stack" id="dbindStack"></div>
<div class="dbind-storage">
<svg class="dbind-connector" width="220" height="34" viewBox="0 0 220 34">
<path d="M110 0 V14 M30 14 H190 M30 14 V32 M110 14 V32 M190 14 V32"
fill="none" style="stroke:var(--ink-soft)" stroke-width="2"/>
</svg>
<div class="dbind-cylinders">
<div class="dbind-cylinder"></div>
<div class="dbind-cylinder"></div>
<div class="dbind-cylinder"></div>
</div>
<div class="dbind-storage-label">Stored Database</div>
</div>
<div class="dbind-panel" id="dbindPanel"></div>
</div>
<script>
(function () {
var wrapper = document.getElementById('dbindWrap');
// Dark mode detection — body attribute wins, then cookie, then light default
var bodyAttr = document.body.getAttribute('data-darkmode');
var dark;
if (bodyAttr === 'true') {
dark = true;
} else if (bodyAttr === 'false') {
dark = false;
} else {
var match = document.cookie.match(/(?:^|;\s*)darkMode=([^;]+)/);
dark = match ? match[1] === 'true' : false;
}
if (dark) wrapper.setAttribute('data-theme', 'dark');
// Render the three database "cylinder" icons
var cylSvg = '<svg width="52" height="46" viewBox="0 0 52 46">' +
'<path d="M2 10 C2 5 12 2 26 2 C40 2 50 5 50 10 V36 C50 41 40 44 26 44 C12 44 2 41 2 36 Z" ' +
'fill="none" style="stroke:var(--accent)" stroke-width="2.2"/>' +
'<path d="M2 10 C2 15 12 18 26 18 C40 18 50 15 50 10" fill="none" style="stroke:var(--accent)" stroke-width="2.2"/>' +
'</svg>';
document.querySelectorAll('.dbind-cylinder').forEach(function (el) { el.innerHTML = cylSvg; });
var levels = [
{
key: 'view',
label: 'View Level',
sub: 'External · highest level',
bullets: [
'The user-facing level — what users see when they query data.',
'Can provide custom views of the data, showing only relevant information.',
'Improves security and usability.'
],
exampleLabel: 'A teacher might only see Name and Marks, not sensitive info like RollNo.',
code: 'CREATE VIEW StudentMarks AS\nSELECT Name, Marks FROM Student;',
output: {
columns: ['Name', 'Marks'],
rows: [['Aditi', '88'], ['Rohan', '76']]
}
},
{
key: 'logical',
label: 'Logical Level',
sub: 'Conceptual · middle level',
bullets: [
'Describes what data is stored and the relationships between it.',
'Defines tables, columns, data types, and constraints.',
'Used by database administrators and developers.'
],
exampleLabel: 'A Student table with columns like RollNo, Name, Class, Marks.',
code: 'CREATE TABLE Student (\n RollNo INT,\n Name VARCHAR(50),\n Class VARCHAR(10),\n Marks INT\n);\n\nINSERT INTO Student VALUES\n (101, \'Aditi\', \'10-A\', 88),\n (102, \'Rohan\', \'10-A\', 76);',
output: {
columns: ['RollNo', 'Name', 'Class', 'Marks'],
rows: [['101', 'Aditi', '10-A', '88'], ['102', 'Rohan', '10-A', '76']]
}
},
{
key: 'physical',
label: 'Physical Level',
sub: 'Lowest level',
bullets: [
'Describes how data is actually stored in memory or on disk.',
'Deals with storage blocks, indexing, compression, etc.',
'Hidden from users.'
],
exampleLabel: 'How the Student table is stored as a file, indexed by roll number, and organized on disk.',
code: null,
output: null
}
];
var links = [
'Logical Data Independence',
'Physical Data Independence'
];
var stack = document.getElementById('dbindStack');
var panel = document.getElementById('dbindPanel');
var buttons = [];
levels.forEach(function (lvl, i) {
var btn = document.createElement('button');
btn.type = 'button';
btn.className = 'dbind-level' + (i === 0 ? ' is-active' : '');
btn.innerHTML = lvl.label + '<span class="lvl-sub">' + lvl.sub + '</span>';
btn.addEventListener('click', function () {
buttons.forEach(function (b) { b.classList.remove('is-active'); });
btn.classList.add('is-active');
renderPanel(i);
});
stack.appendChild(btn);
buttons.push(btn);
if (i < levels.length - 1) {
var link = document.createElement('div');
link.className = 'dbind-link';
link.innerHTML = '<span class="arrow-glyph">↕</span><span class="link-label">' + links[i] + '</span>';
stack.appendChild(link);
}
});
function highlightSQL(code) {
var escaped = code.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
var keywords = /\b(CREATE|VIEW|TABLE|AS|SELECT|FROM|INSERT|INTO|VALUES)\b/g;
var types = /\b(INT|VARCHAR)\b/g;
var strings = /('[^']*')/g;
var punct = /([(),;])/g;
return escaped
.replace(keywords, '<span class="tok-kw">$1</span>')
.replace(types, '<span class="tok-type">$1</span>')
.replace(strings, '<span class="tok-str">$1</span>')
.replace(punct, '<span class="tok-punct">$1</span>');
}
function buildOutputTable(output) {
var html = '<p class="dbind-output-label">Output</p><table class="dbind-output-table"><thead><tr>';
output.columns.forEach(function (c) { html += '<th>' + c + '</th>'; });
html += '</tr></thead><tbody>';
output.rows.forEach(function (row) {
html += '<tr>';
row.forEach(function (cell) { html += '<td>' + cell + '</td>'; });
html += '</tr>';
});
html += '</tbody></table>';
return html;
}
function renderPanel(i) {
var lvl = levels[i];
var html = '<h3 class="dbind-panel-title">' + lvl.label + '</h3>';
html += '<ul class="dbind-panel-list">';
lvl.bullets.forEach(function (b) { html += '<li>' + b + '</li>'; });
html += '</ul>';
html += '<p class="dbind-example-label">Example</p>';
html += '<p class="dbind-example-text">' + lvl.exampleLabel + '</p>';
if (lvl.code) {
html += '<pre class="dbind-code">' + highlightSQL(lvl.code) + '</pre>';
}
if (lvl.output) {
html += buildOutputTable(lvl.output);
}
panel.innerHTML = html;
panel.classList.remove('is-fading');
void panel.offsetWidth;
panel.classList.add('is-fading');
}
renderPanel(0);
})();
</script>.demo {
font-family: system-ui, sans-serif;
padding: 16px;
}
.demo h1 {
color: #2563eb;
margin: 0 0 8px;
}
.demo p {
color: #4b5563;
margin: 0;
}document.querySelector('.demo h1')?.addEventListener('click', () => {
alert('Hello from live preview!');
});📘 Summary Table:
Level | Description | Audience |
|---|---|---|
View Level | What users see (custom views) | End users |
Logical Level | What data is stored and relationships | Programmers, DB admins |
Physical Level | How data is stored on disk | System/database engineers |