<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohamed Hedi Ben Jemaa</title>
    <description>The latest articles on DEV Community by Mohamed Hedi Ben Jemaa (@hedi22).</description>
    <link>https://dev.to/hedi22</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3949477%2F0c6d0d9f-6e27-478c-84b8-d9b3b7fd9427.jpg</url>
      <title>DEV Community: Mohamed Hedi Ben Jemaa</title>
      <link>https://dev.to/hedi22</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hedi22"/>
    <language>en</language>
    <item>
      <title>How I Built a Live SQL Workshop Where Students Can't Break Anything</title>
      <dc:creator>Mohamed Hedi Ben Jemaa</dc:creator>
      <pubDate>Sun, 24 May 2026 21:43:23 +0000</pubDate>
      <link>https://dev.to/hedi22/how-i-built-a-live-sql-workshop-where-students-cant-break-anything-2i84</link>
      <guid>https://dev.to/hedi22/how-i-built-a-live-sql-workshop-where-students-cant-break-anything-2i84</guid>
      <description>&lt;p&gt;Picture this. It's a Tuesday evening. Half the students are in the room. The other half are little rectangles on a Zoom call, cameras off, maybe paying attention. You're 40 minutes into a live SQL workshop, things are actually going well, and then one student, trying to be helpful, runs this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No WHERE clause. No hesitation. Just confidence and destruction.&lt;/p&gt;

&lt;p&gt;The table is empty. Every row, the sample data you spent 20 minutes explaining, gone. The remote students have no idea what happened. The in-room students are staring at you. And now you're digging through a folder of SQL dump files, trying to remember which one is the "clean" version, wondering why you didn't just become a frontend developer.&lt;/p&gt;

&lt;p&gt;That scenario? I've lived it. More than once.&lt;/p&gt;

&lt;p&gt;After years of teaching full stack development in hybrid environments, I can tell you: the hardest part of running live database workshops isn't the SQL. It's keeping the environment alive long enough to finish the lesson.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Every Platform Gets Wrong
&lt;/h2&gt;

&lt;p&gt;Platforms like Udemy, Scrimba, and Pluralsight have genuinely transformed how developers learn. The production quality, the pacing, the interactive sandboxes, it's remarkable. But they all solve the same problem: &lt;em&gt;recorded, self-paced learning&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Live workshops are a completely different beast.&lt;/p&gt;

&lt;p&gt;Scrimba gives each student an isolated coding environment. Great for JavaScript. Useless when you need 12 students sharing a single evolving database state, building on each other's schema, watching the same rows appear in real time, following along as the instructor adds a foreign key to a table they all created together.&lt;/p&gt;

&lt;p&gt;Pluralsight has hands-on labs. But resetting between groups? That's still your problem. It still means Docker dumps, seed scripts, manual imports. The ritual goes like this: end one session, restore the database, pray nothing is broken, start the next session, repeat. If something breaks mid-lesson, and it always breaks mid-lesson, you either scramble to recover live or you apologize and move on with a broken example.&lt;/p&gt;

&lt;p&gt;That apology is what I got tired of making.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Git Mental Model, Applied to Databases
&lt;/h2&gt;

&lt;p&gt;Here's the thing about teaching developers: they already understand Git. They commit code. They branch. They check out previous states. It's muscle memory.&lt;/p&gt;

&lt;p&gt;GFS, Git for database Systems, borrows exactly that model and applies it to PostgreSQL and MySQL. The command syntax is intentionally familiar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gfs commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"lesson-1"&lt;/span&gt;       &lt;span class="c"&gt;# save this exact database state&lt;/span&gt;
gfs log                        &lt;span class="c"&gt;# see the full history&lt;/span&gt;
gfs checkout &amp;lt;&lt;span class="nb"&gt;hash&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;            &lt;span class="c"&gt;# restore to any point instantly&lt;/span&gt;
gfs checkout &lt;span class="nt"&gt;-b&lt;/span&gt; student-alice  &lt;span class="c"&gt;# give a student their own isolated branch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under the hood, GFS runs your database in a Docker container and wraps every state change in a commit structure. Each commit is a snapshot, not a backup you restore from, but a save point you jump to. The difference matters more than it sounds. Backups are for disasters. Save points are for teaching.&lt;/p&gt;

&lt;p&gt;Install it in one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://gfs.guepard.run/install | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then initialize a database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;sql-workshop &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;sql-workshop
gfs init &lt;span class="nt"&gt;--database-provider&lt;/span&gt; postgres &lt;span class="nt"&gt;--database-version&lt;/span&gt; 17
gfs commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"initial-empty-state"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your workshop database is live, versioned, and ready.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Three-Lesson Checkpoint Structure
&lt;/h2&gt;

&lt;p&gt;The workshop I built covers three progressive SQL lessons. Each one ends with a GFS commit, a named checkpoint the instructor can return to from anywhere, at any time.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lesson&lt;/th&gt;
&lt;th&gt;Core Concept&lt;/th&gt;
&lt;th&gt;GFS Checkpoint&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;CREATE TABLE, INSERT, SELECT&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lesson-1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Foreign keys, related tables&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lesson-2&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;ALTER TABLE, JOIN queries&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lesson-3&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Lesson 1&lt;/strong&gt; creates the foundation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gfs query &lt;span class="s2"&gt;"CREATE TABLE students (
  id SERIAL PRIMARY KEY,
  name TEXT NOT NULL,
  age INT
);"&lt;/span&gt;

gfs query &lt;span class="s2"&gt;"INSERT INTO students (name, age) VALUES
  ('Alice', 22), ('Bob', 25), ('Carol', 21);"&lt;/span&gt;

gfs commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"lesson-1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Lesson 2&lt;/strong&gt; introduces relationships:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gfs query &lt;span class="s2"&gt;"CREATE TABLE grades (
  id SERIAL PRIMARY KEY,
  student_id INT REFERENCES students(id),
  subject TEXT NOT NULL,
  score INT
);"&lt;/span&gt;

gfs commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"lesson-2"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Lesson 3&lt;/strong&gt; adds complexity, &lt;code&gt;ALTER TABLE&lt;/code&gt; and a real JOIN:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gfs query &lt;span class="s2"&gt;"ALTER TABLE students ADD COLUMN email TEXT;"&lt;/span&gt;

gfs query &lt;span class="s2"&gt;"SELECT students.name, grades.subject, grades.score
FROM students
JOIN grades ON students.id = grades.student_id
ORDER BY students.name;"&lt;/span&gt;

gfs commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"lesson-3"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After all three lessons, &lt;code&gt;gfs log&lt;/code&gt; shows the full history:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lesson-3   →  ALTER TABLE + JOIN demo
lesson-2   →  grades table with FK
lesson-1   →  students table + seed data
initial    →  empty database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four commits. Four checkpoints. Any of them is one command away.&lt;/p&gt;




&lt;h2&gt;
  
  
  Every Student Gets Their Own Branch
&lt;/h2&gt;

&lt;p&gt;This is where the teaching dynamic fundamentally shifts. Before GFS, student experimentation was a liability. Letting someone freestyle on a shared database meant risking the entire session. So most instructors, myself included, discouraged it. "Don't try that yet. Wait until you're on your own machine." It killed curiosity right when curiosity was highest.&lt;/p&gt;

&lt;p&gt;With GFS, every student gets a branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gfs checkout lesson-2          &lt;span class="c"&gt;# start from this checkpoint&lt;/span&gt;
gfs checkout &lt;span class="nt"&gt;-b&lt;/span&gt; student-alice  &lt;span class="c"&gt;# Alice gets her own copy&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alice can now run anything. Drop tables. Insert garbage. Break every foreign key constraint she can find. Her branch absorbs all of it. And when she's done experimenting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gfs checkout main
gfs query &lt;span class="s2"&gt;"SELECT * FROM students;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alice, Bob, Carol. Exactly as left. Main branch untouched.&lt;/p&gt;

&lt;p&gt;For hybrid sessions specifically, this changes the remote dynamic in a real way. Students joining via Zoom tend to participate less, partly because they feel more like observers than participants. Giving them their own branch makes the experimentation feel real and safe at the same time. It signals: &lt;em&gt;your curiosity won't cost anyone else their session.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Demo That Earns the Room
&lt;/h2&gt;

&lt;p&gt;Here's the moment I now run at the start of every workshop. It's a deliberate act of sabotage.&lt;/p&gt;

&lt;p&gt;With the full lesson history in place, I simulate what happens when something goes wrong:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gfs query &lt;span class="s2"&gt;"DROP TABLE grades;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gfs query &lt;span class="s2"&gt;"SELECT * FROM grades;"&lt;/span&gt;
&lt;span class="c"&gt;# ERROR: relation "grades" does not exist&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The table is gone. I let that sit for a second. Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gfs checkout HEAD~1
gfs query &lt;span class="s2"&gt;"SELECT * FROM grades;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csvs"&gt;&lt;code&gt; &lt;span class="k"&gt;id&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt; &lt;span class="k"&gt;student&lt;/span&gt;&lt;span class="err"&gt;_&lt;/span&gt;&lt;span class="k"&gt;id&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt; &lt;span class="k"&gt;subject&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt; &lt;span class="k"&gt;score&lt;/span&gt;
&lt;span class="err"&gt;----+------------+---------+-------&lt;/span&gt;
  &lt;span class="mf"&gt;1&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt;          &lt;span class="mf"&gt;1&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt; &lt;span class="k"&gt;Math&lt;/span&gt;    &lt;span class="err"&gt;|&lt;/span&gt;    &lt;span class="mf"&gt;88&lt;/span&gt;
  &lt;span class="mf"&gt;2&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt;          &lt;span class="mf"&gt;1&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt; &lt;span class="k"&gt;English&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt;    &lt;span class="mf"&gt;92&lt;/span&gt;
  &lt;span class="mf"&gt;3&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt;          &lt;span class="mf"&gt;2&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt; &lt;span class="k"&gt;Math&lt;/span&gt;    &lt;span class="err"&gt;|&lt;/span&gt;    &lt;span class="mf"&gt;75&lt;/span&gt;
&lt;span class="err"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every row. Back. Three seconds.&lt;/p&gt;

&lt;p&gt;Without GFS, that recovery takes 5 to 10 minutes, find the dump file, stop the container, restore, verify, explain to remote students what just happened, lose the thread of the lesson entirely. With GFS, it's one command and a breath. The lesson continues like nothing broke.&lt;/p&gt;

&lt;p&gt;The room's reaction to that demo is always the same. Something clicks. Not just about GFS, about what version control &lt;em&gt;actually means&lt;/em&gt; when it's applied to data, not just code.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Changes When You Teach This Way
&lt;/h2&gt;

&lt;p&gt;Something subtle shifts when you know you have an undo button.&lt;/p&gt;

&lt;p&gt;As an instructor, the low-grade anxiety that lives in every live demo, &lt;em&gt;what if something breaks, what if a student touches the wrong table, what if the seed script doesn't run cleanly this time&lt;/em&gt;, it quietly disappears. You stop designing lessons around what students &lt;em&gt;can't&lt;/em&gt; be allowed to touch. You start designing around what they &lt;em&gt;should&lt;/em&gt; try.&lt;/p&gt;

&lt;p&gt;Students feel that. They experiment more. They ask "what happens if I do this?" instead of waiting to be told. In a hybrid room, the remote students stop lurking and start running queries on their branches. The energy is different when nobody's afraid of breaking something that can't be fixed.&lt;/p&gt;

&lt;p&gt;That shift, from a fragile shared environment that everyone tiptoes around, to a versioned system where every mistake is recoverable, that's the real value of GFS in a teaching context. Not the commands. The psychological safety those commands create.&lt;/p&gt;

&lt;p&gt;The full workshop, including lesson SQL files, a student worksheet, and complete replay instructions, lives on GitHub: &lt;strong&gt;&lt;a href="https://github.com/LHedi22/sql-workshopt-gfs" rel="noopener noreferrer"&gt;https://github.com/LHedi22/sql-workshopt-gfs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Set it up. Build the checkpoints. Then run the DROP TABLE demo in front of your next group and watch &lt;code&gt;gfs checkout HEAD~1&lt;/code&gt; do its thing.&lt;/p&gt;

&lt;p&gt;Some tools you adopt because they're useful. This one you'll keep because it changes how you teach.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;GFS is open source and actively developed. Find it at &lt;a href="https://github.com/Guepard-Corp/gfs" rel="noopener noreferrer"&gt;github.com/Guepard-Corp/gfs&lt;/a&gt;. Join the community on &lt;a href="https://discord.gg/SEdZuJbc5V" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>sql</category>
      <category>development</category>
      <category>database</category>
      <category>devtool</category>
    </item>
  </channel>
</rss>
