What is a Table?
A table is a collection of structured data organized in rows and columns. In NocoDB:- Rows represent individual records (e.g., a customer, task, or product)
- Columns represent fields that describe attributes (e.g., name, email, date)
- Relationships link tables together for complex data models
Flexible Schema
Add, remove, and modify columns without downtime
Multiple Views
Visualize the same data in Grid, Gallery, Kanban, and more
Rich Field Types
Support for 40+ field types from text to formulas
Data Validation
Enforce rules and constraints on your data
Table Types
NocoDB supports two main types of tables:Standard Tables
Regular tables that store data directly:- Full CRUD operations (Create, Read, Update, Delete)
- Support all field types and relationships
- Can be sorted, filtered, and grouped
Model.ts:54-56
Database Views
Read-only tables that represent SQL views:- Reflect data from underlying database views
- Limited modification capabilities
- Useful for reporting and aggregations
Model.ts:57-60
Creating a Table
Configure table settings
- Table Name: Choose a descriptive name (e.g., “Customers”, “Orders”)
- Icon (optional): Select an emoji or icon
- Source: Choose which data source to use
Add initial fields
Define your columns:
- The first column is automatically created as the primary field
- Add additional fields as needed
- Set field types (Text, Number, Date, etc.)
Table Properties
| Property | Description | Type |
|---|---|---|
id | Unique identifier | string |
table_name | Database table name | string |
title | Display name in UI | string |
description | Optional description | string |
type | Table type (table/view) | ModelTypes |
base_id | Parent base ID | string |
source_id | Data source ID | string |
order | Display order | number |
schema | Table schema metadata | object |
enabled | Active status | boolean |
mm | Is junction table flag | boolean |
tags | Categorization tags | string |
Model.ts:65-96
Primary Key & Display Value
Primary Key
Every table must have a primary key column:- Auto-generated: NocoDB creates an
Idfield by default - Composite Keys: Multiple columns can form a primary key
- Auto-increment: Optional automatic numbering
Model.ts:163-176
Display Value
The display value is the human-readable identifier for each record:- Shows in link fields and relationships
- Defaults to the first non-primary column
- Can be customized to any suitable field
Model.ts:178-193
Managing Tables
Listing Tables
Getting Table Details
Updating Table Metadata
Renaming a Table
Model.ts:902-972
Deleting a Table
Table Operations
Column Management
View Management
Setting Primary Display Column
Model.ts:1040-1120
Junction Tables (Many-to-Many)
Junction tables enable many-to-many relationships:- Created automatically when establishing M2M relations
- Marked with
mm: trueflag - Usually hidden from the UI
- Contain foreign keys to both related tables
Model.ts:974-996
Advanced Features
Table Ordering
Control the display order of tables in the sidebar:Alias Mapping
Map between column names and display titles:Table Validation
Model.ts:1226-1294
Working with Data
BaseModelSqlv2
NocoDB provides a powerful query interface for working with table data:Model.ts:593-650
Best Practices
Use descriptive table names
Use descriptive table names
Choose clear, plural nouns (e.g., “Customers”, “Orders”) that describe the data.
Design schema upfront
Design schema upfront
Plan your table structure and relationships before creating tables to avoid major restructuring later.
Choose appropriate display values
Choose appropriate display values
Select a display value column that uniquely identifies records (like name or title, not ID).
Use consistent naming
Use consistent naming
Follow a naming convention across all tables (e.g., snake_case for database names, Title Case for display).
Index for performance
Index for performance
Add indexes on frequently queried or filtered columns for better performance.
Normalize your data
Normalize your data
Split data into multiple related tables rather than duplicating information.
Related Resources
Fields
Learn about the 40+ field types available
Views
Visualize your table data in different ways
Relations
Connect tables with relationships
Filters & Sorting
Query and organize your data