📋 What is Database Language?
Database languages are specialized sets of commands and instructions used to define, manipulate, and control data within a database. Each language type plays a distinct role in database management, ensuring efficient storage, retrieval, and security of data. The primary database languages include:
<div class="infographic-sqllang" id="sqlWrap">
<style>
.infographic-sqllang {
--ink: #1a1a1a;
--ink-soft: #5c5c5c;
--paper: #ffffff;
--paper-alt: #f6f3ee;
--accent: #2563eb;
--accent-soft:#e3ebfd;
--line: #ddd6c9;
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: 720px;
margin: 0 auto;
}
.infographic-sqllang[data-theme="dark"] {
--ink: #e8e6e1;
--ink-soft: #9a968c;
--paper: #121212;
--paper-alt: #1e1e26;
--accent: #5b8def;
--accent-soft:#202942;
--line: #2c313d;
}
.infographic-sqllang * { box-sizing: border-box; }
.sql-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;
}
.sql-title { font-size: 1.45rem; font-weight: 700; margin: 0 0 1.5rem; text-align: center; letter-spacing: -0.01em; }
.sql-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1.5rem; }
.sql-tab {
font: inherit; font-size: 0.82rem; font-weight: 700;
background: var(--paper-alt); color: var(--ink); border: 1px solid var(--line);
border-radius: 999px; padding: 0.5rem 1rem; cursor: pointer;
transition: border-color .15s, background .15s, color .15s;
}
.sql-tab .full { font-weight: 400; font-size: 0.72rem; opacity: 0.8; }
.sql-tab:hover { border-color: var(--accent); }
.sql-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sql-panel {
background: var(--paper-alt); border: 1px solid var(--line); border-radius: 12px;
padding: 1.4rem 1.5rem;
}
.sql-panel.is-fading { animation: sqlFade .35s ease; }
@keyframes sqlFade { from { opacity: 0.2; } to { opacity: 1; } }
.sql-panel-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.4rem; color: var(--accent); }
.sql-panel-intro { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.5; margin: 0 0 1.1rem; }
.sql-cmd-list { display: flex; flex-direction: column; gap: 0.5rem; }
.sql-cmd-row {
display: grid; grid-template-columns: 130px 1fr; gap: 0.75rem; align-items: start;
background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
padding: 0.55rem 0.75rem;
}
.sql-cmd-name {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
font-weight: 700; font-size: 0.78rem; color: var(--accent);
}
.sql-cmd-desc { font-size: 0.83rem; line-height: 1.45; }
@media (max-width: 520px) {
.sql-cmd-row { grid-template-columns: 1fr; gap: 0.2rem; }
}
@media (prefers-reduced-motion: reduce) {
.infographic-sqllang *, .infographic-sqllang *::before, .infographic-sqllang *::after {
animation-duration: 0.001ms !important; transition-duration: 0.001ms !important;
}
}
</style>
<p class="sql-eyebrow">SQL Command Categories</p>
<h2 class="sql-title">The 5 Languages Inside SQL</h2>
<div class="sql-tabs" id="sqlTabs"></div>
<div class="sql-panel" id="sqlPanel"></div>
</div>
<script>
(function () {
var wrapper = document.getElementById('sqlWrap');
// 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');
var categories = [
{
abbr: 'DDL', full: 'Data Definition Language',
intro: 'Deals with database schemas — describing how data should reside in the database.',
commands: [
['CREATE', 'Create a database and its objects — tables, indexes, views, procedures, functions, triggers.'],
['ALTER', 'Alters the structure of an existing database.'],
['DROP', 'Delete objects from the database.'],
['TRUNCATE', 'Remove all records from a table, including the space allocated for them.'],
['COMMENT', 'Add comments to the data dictionary.'],
['RENAME', 'Rename an object.']
]
},
{
abbr: 'DML', full: 'Data Manipulation Language',
intro: 'Focuses on manipulating the data stored in the database — retrieving, adding, updating, and deleting it.',
commands: [
['SELECT', 'Retrieve data from a database.'],
['INSERT', 'Insert data into a table.'],
['UPDATE', 'Update existing data within a table.'],
['DELETE', 'Delete records from a database table.'],
['MERGE', 'Upsert operation — insert if new, update if it already exists.'],
['CALL', 'Call a PL/SQL or Java subprogram.'],
['EXPLAIN PLAN', 'Show the interpretation of the data access path.'],
['LOCK TABLE', 'Concurrency control over a table.']
]
},
{
abbr: 'DCL', full: 'Data Control Language',
intro: 'Manages access permissions, controlling who can perform which actions on the database.',
commands: [
['GRANT', 'Provides specific privileges to a user — e.g. SELECT, INSERT.'],
['REVOKE', 'Removes previously granted permissions from a user.']
]
},
{
abbr: 'TCL', full: 'Transaction Control Language',
intro: 'Oversees transactional data to maintain consistency, reliability, and atomicity.',
commands: [
['ROLLBACK', 'Undoes changes made during a transaction.'],
['COMMIT', 'Saves all changes made during a transaction.'],
['SAVEPOINT', 'Sets a point within a transaction that you can later roll back to.']
]
},
{
abbr: 'DQL', full: 'Data Query Language',
intro: 'A subset of DML, focused specifically on retrieving data.',
commands: [
['SELECT', 'The primary DQL command — queries data without altering its structure or contents.']
]
}
];
var tabs = document.getElementById('sqlTabs');
var panel = document.getElementById('sqlPanel');
var buttons = [];
function renderPanel(i) {
var c = categories[i];
var html = '<h3 class="sql-panel-title">' + c.abbr + ' — ' + c.full + '</h3>';
html += '<p class="sql-panel-intro">' + c.intro + '</p>';
html += '<div class="sql-cmd-list">';
c.commands.forEach(function (cmd) {
html += '<div class="sql-cmd-row"><span class="sql-cmd-name">' + cmd[0] + '</span><span class="sql-cmd-desc">' + cmd[1] + '</span></div>';
});
html += '</div>';
panel.innerHTML = html;
panel.classList.remove('is-fading');
void panel.offsetWidth;
panel.classList.add('is-fading');
}
categories.forEach(function (c, i) {
var btn = document.createElement('button');
btn.type = 'button';
btn.className = 'sql-tab' + (i === 0 ? ' is-active' : '');
btn.textContent = c.abbr;
btn.addEventListener('click', function () {
buttons.forEach(function (b) { b.classList.remove('is-active'); });
btn.classList.add('is-active');
renderPanel(i);
});
tabs.appendChild(btn);
buttons.push(btn);
});
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!');
});