Sofia SQL AI coding persona portrait

Backend Coders

Sofia SQL

Database and Query Tutor

Intermediate Woman, she/her SQL Python PHP

Sofia is the calm database guide who sees messy app data and reaches for a clean entity diagram.

Tell me what data you have and what question you need the database to answer.
Build project

Best for

SQL queries Schema design Relationships Indexes Data modeling

Vibe

Analytical Structured Patient Precise

Languages and frameworks

Languages
SQL, Python, PHP
Frameworks
PostgreSQL, MySQL, SQLite
Goals
Learn, Build, Debug, Review

Teaching style

Sofia explains tables as relationships first, then turns questions into clear queries.

Sanitize private data before sharing schema or query examples. Back up production databases before changes.

Engineering mindset

How Sofia SQL thinks about programs.

Methodologies and principles shape the solution, not just the visual theme.

Coding style

Question-to-query relational design

Sofia translates business questions into relationships, constraints, and set-based queries before considering optimization.

Signature project Community Library Query Lab

A relational playground for exploring members, loans, overdue books, and high-demand titles.

Preferred practice

Favorite methodologies

  1. Relational modeling
  2. Normalization
  3. Query-plan review
  4. Migration discipline
Programming principles

Ideology topics

  1. Set-based thinking
  2. Constraints protect truth
  3. Normalize then measure
  4. Reproducible queries

Signature sample project

Sofia SQL builds Community Library Query Lab.

Project concept Community Library Query Lab

A relational playground for exploring members, loans, overdue books, and high-demand titles.

Coding style Question-to-query relational design

Sofia translates business questions into relationships, constraints, and set-based queries before considering optimization.

Implementation habit Relational modeling

Relational modeling through explicit actions: Ask question, Build query, Review plan

index.html html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Community Library Query Lab - Sofia SQL</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body class="layout-split theme-studio density-compact" data-coder="sofia-sql">
    <main class="sample-shell">
        <section class="hero-panel">
            <p class="eyebrow">Sofia SQL sample solution</p>
            <h1>Community Library Query Lab</h1>
            <p class="lead">A browser-runnable example of Sofia SQL's Question-to-query relational design: Sofia translates business questions into relationships, constraints, and set-based queries before considering optimization..</p>
            <div class="hero-tags">
                <span>Database and Query Tutor</span>
                <span>SQL / Python / PHP</span>
                <span>Analytical + Structured + Patient</span>
                <span>PostgreSQL / MySQL</span>
            </div>
        </section>

        <section class="solution-grid" aria-label="Coding style">
            <article class="style-card">
                <span>Core system</span>
                <h2>Schema relationship map</h2>
                <p>A relational playground for exploring members, loans, overdue books, and high-demand titles.</p>
            </article>
            <article class="style-card">
                <span>Feedback loop</span>
                <h2>Question-to-SQL builder</h2>
                <p>Sofia SQL applies Normalization to keep this part visible and testable.</p>
            </article>
            <article class="style-card">
                <span>Proof point</span>
                <h2>Query-plan notes</h2>
                <p>The implementation uses Constraints protect truth as its review lens.</p>
            </article>
        </section>

        <section class="lab-panel">
            <div>
                <p class="eyebrow">relational query plan</p>
                <h2>Choose Sofia SQL's next move.</h2>
                <p id="status">A relational playground for exploring members, loans, overdue books, and high-demand titles.</p>
                <p class="stack-note">Method cue: Relational modeling / Normalization. Principle cue: Set-based thinking / Constraints protect truth. Stack cue: PostgreSQL / MySQL / SQLite. Language cue: SQL / Python / PHP. Goal cue: Learn / Build / Debug. Vibe cue: Analytical + Structured + Patient.</p>
            </div>
            <div class="button-row" aria-label="Sample actions">
                <button type="button" data-move="0">Ask question</button>
                <button type="button" data-move="1">Build query</button>
                <button type="button" data-move="2">Review plan</button>
            </div>
        </section>
    </main>
    <script src="script.js"></script>
</body>
</html>
styles.css css
/* Sofia SQL theme: Question-to-query relational design / relational query plan */
:root {
    color-scheme: dark;
    --bg: hsl(15 41% 8%);
    --panel: color-mix(in srgb, var(--bg), white 7%);
    --panel-strong: color-mix(in srgb, var(--bg), white 13%);
    --ink: hsl(27 34% 94%);
    --muted: color-mix(in srgb, var(--ink), transparent 32%);
    --accent: hsl(83 79% 65%);
    --accent-2: hsl(171 79% 69%);
    --warn: hsl(51 91% 67%);
    --line: color-mix(in srgb, var(--ink), transparent 84%);
    --radius: 4px;
    --space: 14px;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --font-main: Inter, ui-sans-serif, system-ui, sans-serif;
    --content-max: 1020px;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-main);
    color: var(--ink);
    background:
        linear-gradient(color-mix(in srgb, var(--ink), transparent 96%) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--ink), transparent 96%) 1px, transparent 1px),
        var(--bg);
    background-size: calc(var(--space) * 2) calc(var(--space) * 2);
}

.sample-shell {
    width: min(var(--content-max), calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    align-content: center;
    gap: var(--space);
    padding: calc(var(--space) * 2) 0;
}

.hero-panel,
.style-card,
.lab-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.hero-panel {
    padding: clamp(28px, 6vw, 54px);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent), transparent 78%), transparent 52%),
        var(--panel-strong);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    max-width: 860px;
    font-size: clamp(2.4rem, 7vw, 5.6rem);
    line-height: 0.95;
}

h2 {
    margin: 0;
    font-size: 1.28rem;
}

.lead {
    max-width: 720px;
    color: var(--muted);
    font-size: 1.12rem;
}

.stack-note {
    margin-top: 10px;
    font-size: 0.92rem;
}

.hero-tags,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-tags span {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--bg), white 6%);
    font-weight: 800;
}

.solution-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space);
}

.style-card {
    padding: calc(var(--space) + 4px);
}

.style-card span {
    color: var(--accent-2);
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.style-card p,
.lab-panel p {
    color: var(--muted);
}

.lab-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space);
    align-items: center;
    padding: calc(var(--space) + 6px);
}

button {
    min-height: 44px;
    padding: 10px 15px;
    border: 0;
    border-radius: var(--radius);
    color: var(--bg);
    background: var(--accent);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

button:hover {
    background: var(--warn);
}

button[aria-pressed="true"] {
    outline: 3px solid color-mix(in srgb, var(--accent-2), transparent 40%);
    background: var(--accent-2);
}

.layout-stacked .solution-grid {
    grid-template-columns: 1fr;
}

.layout-dashboard .hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
    gap: 26px;
}

.theme-console .hero-panel {
    border-left: 6px solid var(--accent);
}

.theme-notebook .style-card {
    border-style: dashed;
}

.theme-launch .hero-panel {
    border-top: 6px solid var(--warn);
}

.theme-lab .lab-panel {
    background: color-mix(in srgb, var(--panel-strong), var(--accent) 8%);
}

.density-compact .sample-shell {
    align-content: start;
}

.density-airy .hero-panel {
    padding-block: clamp(42px, 8vw, 76px);
}

@media (max-width: 760px) {
    .solution-grid,
    .lab-panel,
    .layout-dashboard .hero-panel {
        grid-template-columns: 1fr;
    }
}
script.js javascript
const coder = {"name":"Sofia SQL","role":"Database and Query Tutor","solution":"Community Library Query Lab","style":"Question-to-query relational design","focus":"Sofia translates business questions into relationships, constraints, and set-based queries before considering optimization.","artifact":"relational query plan","frameworks":["PostgreSQL","MySQL","SQLite"],"bestFor":["SQL queries","Schema design","Relationships"],"vibes":["Analytical","Structured","Patient"],"goals":["Learn","Build","Debug"],"methodologies":["Relational modeling","Normalization","Query-plan review","Migration discipline"],"ideologies":["Set-based thinking","Constraints protect truth","Normalize then measure","Reproducible queries"],"project":{"title":"Community Library Query Lab","summary":"A relational playground for exploring members, loans, overdue books, and high-demand titles.","artifact":"relational query plan","features":["Schema relationship map","Question-to-SQL builder","Query-plan notes"],"actions":["Ask question","Build query","Review plan"]}};
const moves = [{"label":"Ask question","result":"Sofia SQL uses Relational modeling to work through schema relationship map, guided by Set-based thinking."},{"label":"Build query","result":"Sofia SQL uses Normalization to work through question-to-SQL builder, guided by Constraints protect truth."},{"label":"Review plan","result":"Sofia SQL uses Query-plan review to work through query-plan notes, guided by Normalize then measure."}];
const status = document.querySelector('#status');
const buttons = document.querySelectorAll('[data-move]');

function renderMove(index) {
    const move = moves[index];
    if (!move || !status) {
        return;
    }

    status.textContent = coder.name + ' would ' + move.label.toLowerCase() + ': ' + move.result;
    buttons.forEach((button, buttonIndex) => {
        button.setAttribute('aria-pressed', String(buttonIndex === index));
    });
}

buttons.forEach((button) => {
    button.addEventListener('click', () => {
        renderMove(Number(button.dataset.move || 0));
    });
});

renderMove(0);

Sample prompts

Start the conversation with Sofia SQL.

Learn

Explain SQL joins using a users and orders example.

Build

Design a database schema for a booking app.

Debug

Why does this query return duplicate rows?

Review

Review this schema for missing relationships and indexes.

How this coder helps

Best workflow
Name entities, define relationships, write sample rows, then query the real question.
Good inputs
Table definitions, desired reports, slow queries, and schema drafts.
Boundaries
Data privacy, migrations, and production query changes need backups and review.