---
title: "Database structure and tables"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:database-structure-requirements@main"
source: "ApiOverview/Database/DatabaseStructure/Index.rst"
rendered: "2026-09-21T11:24:09+00:00"
---

# Database structure and tables {#database-structure-requirements}

TYPO3 distinguishes between **internal** and **managed** tables.

**Table of contents**

-   [Internal tables](https://docs.typo3.org/permalink/t3coreapi:internal-tables@main)
-   [Managed tables](https://docs.typo3.org/permalink/t3coreapi:managed-tables@main)
-   [The pages table](https://docs.typo3.org/permalink/t3coreapi:the-pages-table@main)
-   [Many-to-many (MM) relations](https://docs.typo3.org/permalink/t3coreapi:many-to-many-mm-relations@main)

## Internal tables {#database-structure-other-tables}

Used internally by TYPO3 and not accessible in the backend (e.g. tables such as
`be_sessions`, `sys_registry`, cache tables). They are accessed via TYPO3
APIs such as the [caching framework](https://docs.typo3.org/permalink/t3coreapi:caching@main). These tables are not
editable unless a specific backend module provides access.

Typical categories include:

-   **Cache tables**: Created automatically when using a database-based cache
    backend
-   **Session tables**: `fe_sessions`, `be_sessions`
-   **System tables**:

    -   `sys_registry`: Global configuration
    -   `sys_log`: Viewable via **Administration > Log**

## Managed tables {#database-structure-managed}

Defined in the [TCA](https://docs.typo3.org/m/typo3/reference-tca/main/en-us/Index.html#start) and, by default, editable in the
**Content > Records** module. TYPO3 derives database schemas from the TCA
configuration. Required fields such as `uid` and `pid` are generated
automatically.

**Required fields:**

-   `uid`: Primary key (auto-incremented)
-   `pid`: Page reference (from the `pages` table)

**Typical fields:**

-   `title`: Title displayed in backend lists
-   `crdate`: Creation timestamp
-   `tstamp`: Last modification timestamp
-   `sorting`: Manual sort order
-   `deleted`: Soft delete flag
-   `hidden` or `disabled`: Visibility control

These fields and their behavior are defined in the
[table properties (ctrl section of TCA)](https://docs.typo3.org/m/typo3/reference-tca/main/en-us/Ctrl/Index.html#ctrl).

When records are rendered in the backend using the
[FormEngine](https://docs.typo3.org/permalink/t3coreapi:formengine), entries
with the soft delete flag set (`deleted`) will not be shown.

When querying tables via TypoScript, visibility fields such as `hidden`,
`startdate`, and `enddate` are respected.

If you use the
[DBAL query builder](https://docs.typo3.org/permalink/t3coreapi:database-query-builder@main) to access
the database, the
[restriction builder](https://docs.typo3.org/permalink/t3coreapi:database-restriction-builder@main)
automatically filters records based on visibility fields unless explicitly disabled.

When using an
[Extbase repository](https://docs.typo3.org/permalink/t3coreapi:extbase-domain-repository@main), the
[query settings](https://docs.typo3.org/permalink/t3coreapi:extbase-persistence-queries-querysettings@main)
also apply visibility constraints by default, but can be reconfigured to change
this behavior.

## The `pages` table {#database-structure-pages}

Defines TYPO3's hierarchical page tree. All managed records reference a
`pages.uid` via their `pid`.

-   The root page has `pid = 0` and does not exist as a row in the table.
-   Only administrators can create records on the root level.
-   Tables must explicitly allow root-level records using
    [-](https://docs.typo3.org/m/typo3/reference-tca/main/en-us/Ctrl/Index.html#ctrl-reference-rootlevel).

## Many-to-many (MM) relations {#database-structure-mm-relations}

MM tables store relationships between records. Examples include:

-   `sys_category_record_mm`: Categories and categorized records
-   `sys_file_reference`: File usage in content and pages

These tables may appear in the backend if configured via
[inline records](https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/Inline/Index.html#columns-inline).
