Zero-Code AI App BuilderZero-Code AI App Builder
Builder Foundations

Databases

Where your app keeps its data

When you close a browser tab, everything on the page disappears. So where do your products, users, and orders live? In a database.

What is a database?

A database is the pantry of the restaurant. It's where the app stores everything it needs to remember, even after you close the page or turn off your computer.

If you've used a spreadsheet, you already understand the basics:

  • A table is like one sheet. It holds one kind of thing, like products or orders.
  • A column is one piece of information, like name or price.
  • A row is one item, like one single product.

An example products table

For example, imagine an online shop that sells home goods. Here is what its products table might look like.

Featureidpricecategoryin_stock
Ceramic plant pot124.00GardenYes
Woven basket238.00StorageNo
Linen cushion332.00Living roomYes
A products table. Each row is one product, each column is one detail about it.

Let's break this down:

  • The id column holds a unique number for each row. That way the app never mixes up two products.
  • Each column holds one type of data: text, a number, or true/false.
  • A real store has several tables: products, users, orders, and wishlists. They link to each other using ids.

Asking your AI to design tables

You don't have to design tables alone. Describe your app in plain words, and ask the AI to suggest the tables before it builds anything.

Prompt
I'm building an online store for handmade home goods.
Shoppers can browse products, add them to a cart or wishlist, and place orders.
Admins can add and edit products.
Suggest the database tables I need. For each table, list the columns, what type of data each holds, and how the tables link together.
Explain it simply. Don't write any code yet.

The AI will usually reply with a plan, and sometimes with SQL. SQL is the language databases understand. You don't need to write it, but here is a tiny example so it looks familiar:

sql
select name, price from products where price < 40;

In plain English: "show me the name and price of every product under $40."

Meet Supabase

A popular choice for AI-built apps is Supabase. Supabase is an online service that gives you a ready-made database plus extra tools, all on a free starter plan.

  • Database: a Postgres database, with a Table Editor that looks like a spreadsheet.
  • Auth: sign up, log in, and log out for your users.
  • Storage: a place to keep files like product images.
  • Row Level Security (RLS): rules that decide who can read or change each row.
Always ask your AI to turn on Row Level Security for every table. Without it, anyone who finds your public key could read or change your data.

Common mistakes

  • Storing data only in the browser. It vanishes when the user switches devices. Real data belongs in the database.
  • Putting everything in one giant table. Ask the AI to split products, users, and orders into separate tables.
  • Leaving Row Level Security off "just for now." It's easy to forget. Turn it on from day one.
  • Deleting rows by hand in a live app without a backup. Test changes on sample data first.

Practice

Try these exercises to lock in what you just learned.

Quiz
Not started
In a products table, what does one row represent?
Quiz
Not started
You're using Supabase for an online shop. What should you ask your AI to turn on for every table?

What's next?

You now know all the parts of an app. Next, let's see how to take it from your laptop and put it on the internet with hosting.