---
title: Intro to databases
description: Learn how databases work on your B12 website. Use the AI Agent to add tables, change columns, link tables and control who can see your data.
---

[Skip to content](https://support.b12.io/en/v3/intro-to-databases#main-content)

[![2026 B12 company logo.](https://support.b12.io/hubfs/B12_logo.svg)](https://support.b12.io/en?hsLang=en)

- [B12 Website](https://www.b12.io/)
- Products
  
  Show submenu for Products

    - Sites
      
      Show submenu for Sites

          - [AI builder](https://www.b12.io/ai-website-builder)
          - [Backends](https://www.b12.io/backends)
    - Client engagement
      
      Show submenu for Client engagement

          - [Client intake forms](https://www.b12.io/client-intake-forms)
          - [Contact manager](https://www.b12.io/contact-manager)
- [Templates](https://www.b12.io/ai-website-prompt-gallery)
- Resources
  
  Show submenu for Resources

    - [Resource center](https://www.b12.io/resource-center)
    - [Case studies](https://www.b12.io/case-studies)
- [Pricing](https://www.b12.io/pricing)
- [Log in](https://b12.io/dashboard/)

Open main navigation

Close main navigation

- [B12 Website](https://www.b12.io/)
- Products
  
  Show submenu for Products

    - Sites
      
      Show submenu for Sites

          - [AI builder](https://www.b12.io/ai-website-builder)
          - [Backends](https://www.b12.io/backends)
    - Client engagement
      
      Show submenu for Client engagement

          - [Client intake forms](https://www.b12.io/client-intake-forms)
          - [Contact manager](https://www.b12.io/contact-manager)
- [Templates](https://www.b12.io/ai-website-prompt-gallery)
- Resources
  
  Show submenu for Resources

    - [Resource center](https://www.b12.io/resource-center)
    - [Case studies](https://www.b12.io/case-studies)
- [Pricing](https://www.b12.io/pricing)
- [Log in](https://b12.io/dashboard/)
- [Start for free](https://b12.io/signup/)

[Start for free](https://b12.io/signup/)

 How can we help?

- There are no suggestions because the search field is empty.

1. [B12 Help Center](https://support.b12.io/en?hsLang=en)
2. [Built-in features](https://support.b12.io/en/built-in-features?hsLang=en)
3. [Backends](https://support.b12.io/en/built-in-features?hsLang=en#backends)

# Intro to databases

## Learn what a database is, and how to build and change your tables with the AI Agent.

| ![ronnel](https://support.b12.io/hs-fs/hubfs/Ronnel%20DG.png?width=60&height=60&name=Ronnel%20DG.png) Written by: Ronnel DG Last updated: 01 Dec., 2026 |
| --- |

When your website needs to remember things, such as member details, saved goals or orders, it keeps them in a database. You build and change your database by asking the AI Agent, so you don't need to know any code or database terms.

### What a database is

A database is an organized place where your website stores information. It's made up of **tables**, and each table holds one kind of information. A pet groomer's site, for example, might have one table for bookings and another for the pets.

Inside a table, every **row** is one entry, and every **column** is one detail that each entry has. Here is what a simple bookings table could look like:

| Customer name | Service | Booking date |
| --- | --- | --- |
| Ana Reyes | Full groom | 12 Nov. 2026 |
| Sam Lee | Nail trim | 14 Nov. 2026 |

Your site needs a database when it has to save something and use it again later. Common examples:

- Member accounts and profile details
- Bookings, orders or requests that signed-in customers make on your site
- Listings, such as properties, recipes or products, that you add over time
- Things each signed-in person saves for themselves, such as a wishlist or a budget

If your site only shows information, such as your services, prices and contact details, it doesn't need a database.

**Note:** Only people who are signed in to your site can save information to your database. If you just want visitors to send you a message or a request without signing in, use a form instead. See [Adding and managing forms](https://support.b12.io/en/v3/adding-and-managing-forms?hsLang=en).

### Creating a database

You don't set up a database yourself. You describe the feature you want, and the AI Agent creates the database and the tables that feature needs.

1. Open the AI Agent chat and describe the feature. For example:
   
   ```
   Let signed-in members save savings goals. Each goal has a name, a target amount and a target date.
   ```
2. If Backends isn't turned on yet, a card appears in the chat. Click `Enable`.
3. Wait while the AI Agent works through its task list. It creates the tables and builds the pages that use them.
4. Click `Publish` so the feature appears on your live website.

**Tip:** Describe what you want visitors to do, not how to store it. "Let members save their favorite recipes" works better than "create a favorites table with a foreign key".

To see the tables the AI Agent made:

1. Click `Menu` at the top of the B12 Editor.
2. Select `Backends`.
3. Select `Database`.

![The Database area in Backends, showing a card for each table with its name and number of rows](https://support.b12.io/hs-fs/hubfs/image-png-Oct-06-2026-08-06-59-9989-PM.png?width=670&height=112&name=image-png-Oct-06-2026-08-06-59-9989-PM.png)

You can also ask the AI Agent where your information is, for example "Where are my saved goals?". It may ask a question to be sure what you mean, then replies with a button that takes you to the Database area.

### Changing your tables with the AI Agent

Anything that changes the shape of your database, such as adding a table or a column, is done by the AI Agent. These changes apply to your database right away, so you don't need to publish them. It also means they reach your live website right away.

#### Adding a table

To add a table:

1. Open the AI Agent chat and send a request like this one:
   
   ```
   Add a new table called [table name] to my database, with columns for [the details you need, for example goal name, target amount and target date]. Only change the database.
   ```
2. Wait for the AI Agent to finish. Its reply sums up what it created.
3. Open `Backends`, then `Database`, to see the table. It starts with no rows.

In the Database area, table names appear in lowercase with underscores, such as **savings\_goals**. Use that name when you ask the AI Agent about a table.

The AI Agent adds a few columns on its own, so your table may have more columns than you asked for:

- **Id:** a unique code for each row.
- **User id:** the signed-in person each row belongs to, when the table holds personal information.
- **Created at** and **Updated at:** when each row was added and last changed.

**Tip:** Adding "Only change the database" to your request keeps the AI Agent from also changing your pages. Leave it out if you want the AI Agent to build a page that uses the table too.

#### Changing a table's columns

You can add, rename or remove columns in a table that already exists.

1. Open the AI Agent chat and send a request like this one:
   
   ```
   In the [table name] table, add a column for [detail], and rename the "[old name]" column to "[new name]".
   ```
2. Wait for the AI Agent to finish.
3. Open `Backends`, then `Database`, and select the table to check the change.

If the table was already open while the AI Agent worked, it may still show the old columns. Go back to `Database` and open the table again to see the change.

**Caution:** Removing a column deletes the information stored in it for every row. The change reaches your live website right away, so a published page that still shows that detail can stop working. Ask the AI Agent to update those pages and publish them first, then remove the column.

#### Linking two tables

Sometimes the rows in one table belong to a row in another. For example, each deposit belongs to one savings goal, and each booking belongs to one customer. Linking the two tables keeps them connected.

1. Open the AI Agent chat and send a request like this one:
   
   ```
   Add a new table called [table name], with columns for [details]. Link each row to the [item] it belongs to in the [other table name] table.
   ```
2. Wait for the AI Agent to finish.

The new table gets a column named after the other table, such as **Savings goal id**. It holds the Id of the row each entry is linked to. If you add a row yourself in the Database area, copy that Id from the other table and paste it in. The Id is a long code of letters and numbers. If it doesn't match a row in the other table, the row won't save. [Viewing and editing your database data](https://support.b12.io/en/v3/viewing-and-editing-your-database-data?hsLang=en) shows how to add rows.

#### Removing a table

To remove a table you no longer need:

1. Make sure no page on your site still uses the table. If one does, ask the AI Agent to update that page, then publish your site.
2. Open the AI Agent chat and send a request like this one:
   
   ```
   Delete the [table name] table from my database. Don't change anything else.
   ```

**Caution:** The AI Agent deletes the table as soon as you send the request. It doesn't ask you to confirm, and every row in the table is deleted with it. The change also reaches your live website right away. Double-check the table name before you send.

### Controlling who can see your data

Every table has access rules that decide who can see, add, change and delete its rows. The AI Agent sets them up when it creates a table, so you usually don't have to do anything.

For tables that hold personal information, the AI Agent's rules let each signed-in person work only with their own rows. One member can't see another member's saved goals, for example.

**Tip:** Not sure your data is protected? Open **`Backends`**, then **`Suggestions`**. It lists security and performance issues it found. Lower-priority notes are tucked under **Show informational**. Many issues have a `Try AI fix` button that asks the AI Agent to fix it for you.

#### Checking a table's access rules

To find out who can do what with a table:

1. Open the AI Agent chat and send a request like this one:
   
   ```
   In plain words, who can see, add, change and delete rows in my [table name] table? Don't change anything.
   ```
2. Read the AI Agent's reply. It lists each action and who is allowed to do it.

#### Changing a table's access rules

You can let everyone see a table's rows. Adding, changing and deleting rows always needs people to be signed in. The AI Agent won't let visitors who aren't signed in change your data.

To change who can do what, describe the rule you want:

1. Open the AI Agent chat and send a request like this one:
   
   ```
   Let anyone visiting my site see the rows in my [table name] table, but only signed-in members can add rows.
   ```
2. Ask the AI Agent to explain the rules again, as shown above, to check the result.

**Caution:** Only open a table to everyone if its information is meant to be public, such as a list of upcoming events. Never do this for tables that hold email addresses, phone numbers or other personal details.

### FAQ

→Do I need to publish after the AI Agent changes my database?

⇒No. Changes to your tables reach your database, and your live website, straight away. If the AI Agent also changed your pages, publish to show those page changes on your live site.

→Does changing my database use AI credits?

⇒Yes. Every request you send to the AI Agent uses [AI credits](https://support.b12.io/en/v3/ai-message-credits?hsLang=en), including requests that only change your database.

→Can I create a table myself, without the AI Agent?

⇒No. Adding tables and changing their columns is done by the AI Agent. You can add, edit and remove rows yourself in the Database area.

→Why don't I see my change in the Database area?

⇒The table you have open may be showing an older view. Go back to Database and open the table again.

→Where are the people who sign in to my site?

⇒They're in Users, next to Database in Backends. See [Managing users and sign-in settings](https://support.b12.io/en/v3/managing-users-and-sign-in-settings?hsLang=en).

- [Getting started](https://support.b12.io/en/getting-started?hsLang=en#main-content)

    - [Introduction](https://support.b12.io/en/getting-started?hsLang=en#introduction)
    - [Detailed guides](https://support.b12.io/en/getting-started?hsLang=en#detailed-guides)
- [Working with B12's AI Agent](https://support.b12.io/en/working-with-b12s-ai-agent?hsLang=en#main-content)

    - [Agent Skills](https://support.b12.io/en/working-with-b12s-ai-agent?hsLang=en#agent-skills)
    - [Prompting basics](https://support.b12.io/en/working-with-b12s-ai-agent?hsLang=en#prompting-basics)
    - [Tasks & automation](https://support.b12.io/en/working-with-b12s-ai-agent?hsLang=en#tasks-automation)
- [Built-in features](https://support.b12.io/en/built-in-features?hsLang=en#main-content)

    - [Visual edit](https://support.b12.io/en/built-in-features?hsLang=en#visual-edit)
    - [Code editor](https://support.b12.io/en/built-in-features?hsLang=en#code-editor)
    - [Backends](https://support.b12.io/en/built-in-features?hsLang=en#backends)
    - [Forms & submissions](https://support.b12.io/en/built-in-features?hsLang=en#forms-submissions)
    - [Commerce](https://support.b12.io/en/built-in-features?hsLang=en#commerce)
    - [Contact manager](https://support.b12.io/en/built-in-features?hsLang=en#contact-manager)
    - [eSignatures](https://support.b12.io/en/built-in-features?hsLang=en#esignatures)
    - [Email Marketing](https://support.b12.io/en/built-in-features?hsLang=en#email-marketing)
    - [Team](https://support.b12.io/en/built-in-features?hsLang=en#team)
    - [Analytics](https://support.b12.io/en/built-in-features?hsLang=en#analytics)
    - [Website settings](https://support.b12.io/en/built-in-features?hsLang=en#website-settings)
- [Adding functionality](https://support.b12.io/en/adding-functionality?hsLang=en#main-content)

    - [Third-party integrations](https://support.b12.io/en/adding-functionality?hsLang=en#third-party-integrations)
    - [Scheduling & Productivity Integrations](https://support.b12.io/en/adding-functionality?hsLang=en#scheduling-productivity-integrations)
    - [Multimedia Integrations](https://support.b12.io/en/adding-functionality?hsLang=en#multimedia-integrations)
    - [Membership & Portal Integrations](https://support.b12.io/en/adding-functionality?hsLang=en#membership-portal-integrations)
    - [Pages & site features](https://support.b12.io/en/adding-functionality?hsLang=en#pages-site-features)
    - [Images & media](https://support.b12.io/en/adding-functionality?hsLang=en#images-media)
- [Publishing & growing](https://support.b12.io/en/publishing-growing?hsLang=en#main-content)

    - [Connecting your Domain](https://support.b12.io/en/publishing-growing?hsLang=en#connecting-your-domain)
    - [Domains FAQ](https://support.b12.io/en/publishing-growing?hsLang=en#domains-faq)
    - [Email Forwarding & Sending](https://support.b12.io/en/publishing-growing?hsLang=en#email-forwarding-sending)
    - [Growth & Marketing](https://support.b12.io/en/publishing-growing?hsLang=en#growth-marketing)
    - [Hosting](https://support.b12.io/en/publishing-growing?hsLang=en#hosting)
- [Troubleshooting](https://support.b12.io/en/troubleshooting?hsLang=en#main-content)

    - [FAQs](https://support.b12.io/en/troubleshooting?hsLang=en#faqs)
    - [Common issues](https://support.b12.io/en/troubleshooting?hsLang=en#common-issues)
- [Account & billing](https://support.b12.io/en/account-billing?hsLang=en#main-content)

    - [Account Login & Password](https://support.b12.io/en/account-billing?hsLang=en#account-login-password)
    - [Payments & cancellation](https://support.b12.io/en/account-billing?hsLang=en#payments-cancellation)
    - [Your Account](https://support.b12.io/en/account-billing?hsLang=en#your-account)
    - [Managing Multiple Websites](https://support.b12.io/en/account-billing?hsLang=en#managing-multiple-websites)
    - [Multi-user](https://support.b12.io/en/account-billing?hsLang=en#multi-user)
    - [Plans & pricing](https://support.b12.io/en/account-billing?hsLang=en#plans-pricing)
- [Getting support](https://support.b12.io/en/getting-support?hsLang=en#main-content)

    - [Professional & Advanced Plan Support (B12 2.0)](https://support.b12.io/en/getting-support?hsLang=en#professional-advanced-plan-support-b12-2-0)
- [B12 2.0](https://support.b12.io/en/b12-2-0?hsLang=en#main-content)

    - [Website Structure and Content](https://support.b12.io/en/b12-2-0?hsLang=en#website-structure-and-content)
    - [Website Style & Design](https://support.b12.io/en/b12-2-0?hsLang=en#website-style-design)
    - [Sitewide Settings](https://support.b12.io/en/b12-2-0?hsLang=en#sitewide-settings)
    - [Using the B12 Editor](https://support.b12.io/en/b12-2-0?hsLang=en#using-the-b12-editor)
    - [Analytics & SEO](https://support.b12.io/en/b12-2-0?hsLang=en#analytics-seo)
    - [Integrations - General](https://support.b12.io/en/b12-2-0?hsLang=en#integrations-general)
    - [Integrations - Communication](https://support.b12.io/en/b12-2-0?hsLang=en#integrations-communication)
    - [Integrations - Language](https://support.b12.io/en/b12-2-0?hsLang=en#integrations-language)
    - [Integrations - Ecommerce](https://support.b12.io/en/b12-2-0?hsLang=en#integrations-ecommerce)
    - [Professional & Advanced Plan Features](https://support.b12.io/en/b12-2-0?hsLang=en#professional-advanced-plan-features)
    - [Troubleshooting & Resources](https://support.b12.io/en/b12-2-0?hsLang=en#troubleshooting-resources)
    - [Contact Forms](https://support.b12.io/en/b12-2-0?hsLang=en#contact-forms)
    - [Online Scheduling](https://support.b12.io/en/b12-2-0?hsLang=en#online-scheduling)
    - [Advanced Editing (Experts Only)](https://support.b12.io/en/b12-2-0?hsLang=en#advanced-editing-experts-only)

[![B12\_logo\_2025](https://support.b12.io/hs-fs/hubfs/B12_logo_2025.png?width=53&height=24&name=B12_logo_2025.png "B12_logo_2025")](https://www.b12.io)

© 2025 B12. All rights reserved.

<https://twitter.com/b12> <https://www.facebook.com/B12io> <https://www.youtube.com/@b12io> <https://www.instagram.com/b12io>

×