Vibe Coding Databases 101: Parent Tables, Child Records & Why It Matters
In this beginner-friendly video for vibe coders, Michael Firey explains why understanding databases is essential — even when you’re building apps using plain English prompts with AI tools like Replit, Cursor, or Claude.
Every time you vibe code, the AI quietly builds a database in the background to store your data. Most beginners don’t realize this is happening until their app breaks when adding new features. With over 25 years of database experience, Michael shows you how to avoid costly rewrites.
He starts with the most common mistake: cramming everything into one giant table. For a customer and order tracking system, this means repeating the customer’s name, email, phone, and address on every order record.
If a customer moves or changes their phone, you must manually update every row — or end up with inconsistent data. Adding multiple addresses, multiple contacts (owner, buyer, accounts payable), or extra phone numbers forces messy extra fields like “Address 2” or “Phone 3”. Deleting one order can accidentally delete the entire customer.
The better way is a relational database using separate parent and child tables linked by ID numbers:
- Customers (parent table): Core info like company name, customer type, source, and dates.
- Contacts (child table): Multiple people per customer with their own Contact ID.
- Addresses (child table): Multiple billing/shipping addresses, ATTN notes, and delivery info.
- Orders (child table): Links to Customer, Contact, and Address IDs.
- Products (independent table): Reusable product details.
By linking tables with Customer ID, Contact ID, and Address ID, you eliminate duplication. Change an address once and it updates everywhere. Forms can pull correct data automatically via dropdowns.
This relational approach keeps your data clean, makes edits system-wide, and helps your AI agent build stronger apps from the start.
Build it right the first time — your future self will thank you.