0
0
Supabasecloud~5 mins

Creating tables via dashboard in Supabase

Choose your learning style9 modes available
Introduction

Creating tables via the dashboard helps you organize your data easily without writing code. It makes managing your data simple and visual.

When you want to quickly add a new data table without coding.
When you need to set up a database structure for a new project.
When you want to visually check and edit table columns and types.
When you prefer a user-friendly interface to manage your database.
When you want to add constraints like primary keys or unique fields easily.
Syntax
Supabase
No code needed; use the Supabase dashboard UI to create tables.
You select 'Table Editor' in the dashboard to start creating tables.
You define columns, data types, and constraints through form fields.
Examples
This example shows how to create a simple 'Customers' table with basic columns.
Supabase
1. Open Supabase dashboard
2. Go to 'Table Editor'
3. Click 'New Table'
4. Enter table name, e.g., 'Customers'
5. Add columns like 'id' (integer, primary key), 'name' (text), 'email' (text)
6. Save the table
This example shows creating a table with a foreign key to link orders to customers.
Supabase
1. In 'Table Editor', create a table named 'Orders'
2. Add columns: 'order_id' (integer, primary key), 'customer_id' (integer), 'order_date' (timestamp)
3. Set 'customer_id' as a foreign key referencing 'Customers.id'
4. Save the table
Sample Program

This step-by-step guide shows how to create a 'Products' table with essential columns using the dashboard UI.

Supabase
Steps to create a 'Products' table via Supabase dashboard:
1. Open Supabase dashboard and select 'Table Editor'.
2. Click 'New Table'.
3. Enter table name: Products.
4. Add columns:
   - product_id: integer, primary key, auto-increment.
   - product_name: text, not null.
   - price: numeric, not null.
5. Click 'Save' to create the table.
OutputSuccess
Important Notes

Always define a primary key to uniquely identify each row.

Use appropriate data types for each column to keep data consistent.

You can add indexes and foreign keys later to improve performance and relationships.

Summary

Creating tables via the dashboard is easy and code-free.

It helps organize data with clear column definitions and constraints.

Use it to quickly set up and manage your database structure visually.