🔹 Suppose You Want to Track Tasks
Here’s a typical Notion task table:
ID | Task Name | Status | Due Date | Priority | Done |
|---|---|---|---|---|---|
1 | Finish Flexbox | In-Progress | 2025-07-30 | High | ✅ |
2 | Watch Grid Video | To-Do | 2025-07-28 | Medium | ❌ |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tasks — SQL Query Runner</title>
<style>
.infographic-sqlrunner2 {
--ink: #1a1a1a;
--ink-soft: #5c5c5c;
--paper: #ffffff;
--paper-alt: #f0ece4;
--accent: #2563eb;
--accent-soft:#e3ebfd;
--line: #ddd6c9;
--good: #16a34a;
--good-soft: #dcfce7;
--on-accent: #ffffff;
--display-font: Georgia, 'Iowan Old Style', serif;
--body-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--mono-font: 'SF Mono', Consolas, monospace;
background: var(--paper);
color: var(--ink);
font-family: var(--body-font);
max-width: 800px;
margin: 0 auto;
box-sizing: border-box;
overflow-x: hidden;
}
.infographic-sqlrunner2[data-theme="dark"] {
--ink: #e8e6e1;
--ink-soft: #9a968c;
--paper: #121212;
--paper-alt: #1e1e26;
--accent: #5b8def;
--accent-soft:#202942;
--line: #2c313d;
--good: #4ade80;
--good-soft: #123420;
--on-accent: #101418;
}
.infographic-sqlrunner2 * { box-sizing: border-box; }
.sr2-frame {
background: var(--paper-alt);
border: 1px solid var(--line);
border-radius: 10px;
padding: 1.25rem;
}
.sr2-code-scroll { overflow-x: auto; }
.sr2-code {
background: var(--ink);
color: #d4e2ff;
border-radius: 8px;
padding: 1rem 1.2rem;
font-family: var(--mono-font);
font-size: 0.8rem;
line-height: 1.7;
white-space: pre;
display: inline-block;
min-width: 100%;
}
.infographic-sqlrunner2[data-theme="dark"] .sr2-code { background: #05070a; }
.sr2-kw { color: #9cc5ff; }
.sr2-str { color: #f8d980; }
.sr2-num { color: #4ade80; }
.sr2-cm { color: #7c8aa8; }
.sr2-code-block {
display: block;
padding: 0.1rem 0.6rem;
margin: 0 -0.6rem 0.5rem;
border-left: 3px solid transparent;
border-radius: 4px;
transition: background 0.3s, border-color 0.3s;
}
.sr2-code-block:last-child { margin-bottom: 0; }
.sr2-code-block.is-active {
background: rgba(120, 155, 255, 0.14);
border-left-color: var(--accent);
}
.sr2-run-row { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.1rem; }
.sr2-run-btn {
font: inherit;
font-size: 0.9rem;
background: var(--accent);
color: var(--on-accent);
border: none;
border-radius: 7px;
padding: 0.65rem 1.3rem;
cursor: pointer;
}
.sr2-run-btn:hover { opacity: 0.9; }
.sr2-run-btn:disabled { opacity: 0.6; cursor: wait; }
.sr2-output-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin: 1.25rem 0 0.6rem; display: none; }
.sr2-output-label.is-visible { display: block; }
.sr2-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; display: none; }
.sr2-table-scroll.is-visible { display: block; }
table.sr2-table {
width: 100%;
min-width: 620px;
border-collapse: collapse;
background: var(--paper);
border-radius: 8px;
font-size: 0.85rem;
}
table.sr2-table th, table.sr2-table td {
border: 1px solid var(--line);
padding: 0.5rem 0.65rem;
text-align: left;
white-space: nowrap;
}
table.sr2-table th { background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.72rem; }
table.sr2-table tr.is-new td { animation: sr2-row-in 0.4s ease; }
@keyframes sr2-row-in { from { background: var(--good-soft); } to { background: transparent; } }
table.sr2-table td.is-done { color: var(--good); font-weight: 700; }
table.sr2-table td.is-notdone { color: var(--ink-soft); }
.sr2-status {
text-align: center;
font-size: 0.82rem;
color: var(--good);
margin-top: 0.7rem;
display: none;
}
.sr2-status.is-visible { display: block; }
@media (prefers-reduced-motion: reduce) {
.infographic-sqlrunner2 *, .infographic-sqlrunner2 *::before, .infographic-sqlrunner2 *::after {
transition-duration: 0.001ms !important;
animation-duration: 0.001ms !important;
}
}
</style>
</head>
<body>
<div class="infographic-sqlrunner2" id="sqlrunner2">
<div class="sr2-frame">
<div class="sr2-code-scroll">
<div class="sr2-code"><span class="sr2-code-block" id="sr2BlockCreate"><span class="sr2-cm">-- 1. Create the table</span>
<span class="sr2-kw">CREATE TABLE</span> Tasks (
TaskID <span class="sr2-kw">INT PRIMARY KEY</span>, <span class="sr2-cm">-- Unique identifier for each task</span>
TaskName <span class="sr2-kw">VARCHAR</span>(255), <span class="sr2-cm">-- Name or title of the task</span>
Status <span class="sr2-kw">VARCHAR</span>(50), <span class="sr2-cm">-- 'To-Do', 'In-Progress', 'Done'</span>
DueDate <span class="sr2-kw">DATE</span>, <span class="sr2-cm">-- Deadline for the task</span>
Priority <span class="sr2-kw">VARCHAR</span>(20), <span class="sr2-cm">-- 'High', 'Medium', 'Low'</span>
Done <span class="sr2-kw">BOOLEAN</span> <span class="sr2-cm">-- TRUE/FALSE completion</span>
);
</span>
<span class="sr2-code-block" id="sr2BlockInsert"><span class="sr2-cm">-- 2. Insert sample data</span>
<span class="sr2-kw">INSERT INTO</span> Tasks <span class="sr2-kw">VALUES</span>
(<span class="sr2-num">1</span>, <span class="sr2-str">'Finish Flexbox module'</span>, <span class="sr2-str">'In-Progress'</span>, <span class="sr2-str">'2025-07-30'</span>, <span class="sr2-str">'High'</span>, <span class="sr2-kw">TRUE</span>),
(<span class="sr2-num">2</span>, <span class="sr2-str">'Review Grid Notes'</span>, <span class="sr2-str">'To-Do'</span>, <span class="sr2-str">'2025-07-28'</span>, <span class="sr2-str">'Medium'</span>, <span class="sr2-kw">FALSE</span>),
(<span class="sr2-num">3</span>, <span class="sr2-str">'Project Submission'</span>, <span class="sr2-str">'Done'</span>, <span class="sr2-str">'2025-07-25'</span>, <span class="sr2-str">'High'</span>, <span class="sr2-kw">TRUE</span>);
</span>
<span class="sr2-code-block" id="sr2BlockSelect"><span class="sr2-cm">-- 3. View the output</span>
<span class="sr2-kw">SELECT</span> * <span class="sr2-kw">FROM</span> Tasks;</span></div>
</div>
<div class="sr2-run-row">
<button class="sr2-run-btn" id="sr2CreateBtn" type="button">▶ Run CREATE TABLE</button>
<button class="sr2-run-btn" id="sr2InsertBtn" type="button" disabled>▶ Run INSERT</button>
<button class="sr2-run-btn" id="sr2SelectBtn" type="button" disabled>▶ Run SELECT</button>
</div>
<p class="sr2-status" id="sr2Status"></p>
<p class="sr2-output-label" id="sr2OutputLabel">Table: Tasks</p>
<div class="sr2-table-scroll" id="sr2TableScroll">
<table class="sr2-table" id="sr2Table">
<thead><tr><th>TaskID</th><th>TaskName</th><th>Status</th><th>DueDate</th><th>Priority</th><th>Done</th></tr></thead>
<tbody id="sr2TableBody"></tbody>
</table>
</div>
</div>
</div>
<script>
(function () {
const wrapper = document.getElementById('sqlrunner2');
const bodyAttr = document.body.getAttribute('data-darkmode');
let dark;
if (bodyAttr === 'true') {
dark = true;
} else if (bodyAttr === 'false') {
dark = false;
} else {
const match = document.cookie.match(/(?:^|;\s*)darkMode=([^;]+)/);
dark = match ? match[1] === 'true' : false;
}
if (dark) wrapper.setAttribute('data-theme', 'dark');
})();
(function () {
const rows = [
[1, 'Finish Flexbox module', 'In-Progress', '2025-07-30', 'High', true],
[2, 'Review Grid Notes', 'To-Do', '2025-07-28', 'Medium', false],
[3, 'Project Submission', 'Done', '2025-07-25', 'High', true]
];
const createBtn = document.getElementById('sr2CreateBtn');
const insertBtn = document.getElementById('sr2InsertBtn');
const selectBtn = document.getElementById('sr2SelectBtn');
const tbody = document.getElementById('sr2TableBody');
const tableScroll = document.getElementById('sr2TableScroll');
const outputLabel = document.getElementById('sr2OutputLabel');
const status = document.getElementById('sr2Status');
function showStatus(text) {
status.textContent = text;
status.classList.add('is-visible');
}
function highlightBlock(name) {
document.querySelectorAll('.sr2-code-block').forEach(b => b.classList.remove('is-active'));
const el = document.getElementById('sr2Block' + name);
if (el) {
el.classList.add('is-active');
el.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
}
createBtn.addEventListener('click', () => {
highlightBlock('Create');
createBtn.disabled = true;
createBtn.textContent = 'Running...';
status.classList.remove('is-visible');
setTimeout(() => {
tbody.innerHTML = '';
outputLabel.classList.add('is-visible');
tableScroll.classList.add('is-visible');
createBtn.textContent = '✓ Table created';
showStatus('Empty table created — 0 rows.');
insertBtn.disabled = false;
}, 400);
});
insertBtn.addEventListener('click', () => {
highlightBlock('Insert');
insertBtn.disabled = true;
insertBtn.textContent = 'Running...';
status.classList.remove('is-visible');
rows.forEach((r, i) => {
setTimeout(() => {
const tr = document.createElement('tr');
tr.className = 'is-new';
const doneCell = r[5]
? '<td class="is-done">✔ TRUE</td>'
: '<td class="is-notdone">FALSE</td>';
tr.innerHTML = '<td>' + r[0] + '</td><td>' + r[1] + '</td><td>' + r[2] + '</td><td>' + r[3] + '</td><td>' + r[4] + '</td>' + doneCell;
tbody.appendChild(tr);
if (i === rows.length - 1) {
insertBtn.textContent = '✓ Rows inserted';
showStatus('3 rows inserted.');
selectBtn.disabled = false;
}
}, i * 220);
});
});
selectBtn.addEventListener('click', () => {
highlightBlock('Select');
selectBtn.disabled = true;
selectBtn.textContent = 'Running...';
status.classList.remove('is-visible');
setTimeout(() => {
tbody.querySelectorAll('tr').forEach((tr, i) => {
setTimeout(() => {
tr.classList.remove('is-new');
void tr.offsetWidth;
tr.classList.add('is-new');
}, i * 100);
});
selectBtn.textContent = '✓ Query complete';
showStatus('3 rows returned.');
}, 300);
});
})();
</script>
</body>
</html>.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!');
});🔍 Explanation of Each Column
Column | Type | Why It’s Used |
|---|---|---|
| INT | Unique identifier (like Notion ID) |
| VARCHAR | Stores text |
| VARCHAR | Could be ‘To-Do’, ‘Done’, etc. |
| DATE | Like Notion’s calendar view |
| VARCHAR | ‘High’, ‘Medium’, ‘Low’ etc. |
| BOOLEAN | TRUE/FALSE (✓/✗) checkbox type |
✅ Summary:
To create a Notion-like table in SQL:
Use
VARCHARfor text fieldsUse
DATEfor due datesUse
BOOLEANfor checkboxesUse
StatusorPriorityfields for dropdowns