Workshops: Agentic Coding by Tech Stack

SQL & Databases with AI Coding Agents: Hands-On Workshop

Agents write SQL in seconds, but a faulty migration or an UPDATE without a condition has consequences that a code diff does not always reveal. This workshop shows developers and database engineers how to use coding agents for schema design, migrations and query optimisation, and how to set up database access so the agent learns from real execution plans without ever touching production data.

Who is this workshop for?

  • Backend developers who write SQL and ORM code daily
  • Database engineers and DBAs supporting development teams
  • Teams running PostgreSQL, MySQL or MariaDB, SQL Server or Oracle
  • Tech leads responsible for migration and release processes
  • Developers maintaining stored procedures in PL/pgSQL, T-SQL or PL/SQL

What you will take away

  • Design and review schemas with an agent, including constraints, indexes and naming conventions.
  • Have agents write migrations that are reversible and run without downtime using the expand and contract pattern.
  • Optimise slow queries by giving the agent execution plans instead of guesses.
  • Set up read-only roles, statement timeouts and anonymised data so agents can query databases safely.
  • Test SQL logic and stored procedures automatically and use linters as feedback for the agent.

Agenda

  1. Module 1

    Agents and databases: the ground rules

    • What can go wrong: destructive statements, locks, data leaks
    • Claude Code, OpenAI Codex, Cursor and GitHub Copilot with database tooling and MCP servers
    • Access model: local containers, read-only roles, no production data
  2. Module 2

    Schema design

    • Exercise: model a new domain with the agent, from ER draft to DDL
    • Constraints, data types and indexes the agent must not forget
    • Checking ORM models against the actual schema
  3. Module 3

    Migrations

    • Flyway, Liquibase, Alembic, Prisma or framework migrations
    • Expand and contract, batched backfills, lock-aware changes
    • Migration linting and rollback tests in CI
  4. Module 4

    Query optimisation

    • Feeding EXPLAIN and EXPLAIN ANALYZE output to the agent
    • Index proposals and their cost on writes
    • Spotting N+1 queries and inefficient ORM usage
  5. Module 5

    Testing and stored code

    • Integration tests with Testcontainers and defined test data
    • Unit tests for procedures, for example with pgTAP or tSQLt
    • SQLFluff and similar tools as automatic feedback

Safe access is the foundation

The most important decision is not which agent you use but what it can reach. An agent with a production connection string can read personal data, hold locks or run a DELETE without a WHERE clause. In the workshop we build a layered setup that gives the agent the context it needs without that risk.

  • Local databases in containers for development and tests
  • Read-only roles with statement timeouts for analysis
  • Anonymised or synthetic data instead of production copies
  • Migrations applied only through your pipeline, never by the agent directly

Why execution plans beat intuition

Agents propose indexes and query rewrites with great confidence. Without measurement, many of these suggestions are useless or even harmful, such as extra indexes on write-heavy tables. We train a simple loop: measure, give the plan to the agent, apply exactly one change, measure again.

Data protection matters here too, since plans and samples can contain personal data. We show how to share plans and statistics in line with GDPR without exposing real records.

Your database, your dialect

We adapt the exercises to your database engine and migration tool and work on your schema or an anonymised copy. Remote or on-site, in English or German, with neooutput AI Code Engineers.

Frequently asked questions

Can agents access our database via MCP?

Yes, MCP servers exist for many databases. We recommend connecting them only to local or test databases with read-only users and defining which queries the agent may run.

Which databases do you cover?

PostgreSQL, MySQL and MariaDB, Microsoft SQL Server, Oracle and SQLite are common. We focus the exercises on your engine and its dialect, because agents tend to mix syntax between databases.

Will the agent replace our DBA?

No. Agents speed up routine work such as migrations, query drafts and reading plans. Capacity planning, backup strategy and approving production changes stay with experienced people.

Workshop

Get in touch

Want agents to speed up your database work without putting your data at risk?

Tell us roughly how many people will join and pick dates that work – we will get back to you within 24 hours with a proposal for content, format and schedule.

Prefer to talk first?

15 minutes, free and without obligation – with our AI Trainers and AI Code Engineers.

Book a call for free (opens in new tab) +49 761 519 751 50 (24/7)

Request a training / workshop

Workshop: SQL & Databases with AI Coding Agents: Hands-On Workshop · 1 day

Dates that work for you (optional)

Suggestions about 2 weeks ahead – pick as many as you like

Reply usually within 24 hours · jocapps is ISO 27001 certified · Privacy