Databasebeginner

Table (Database)

A structured collection of data organized in rows and columns within a database, like a spreadsheet.

Detailed Explanation

A database table is where your app's data lives. Think of it like a spreadsheet: columns define what kind of data is stored (title, content, user_id, created_at), and each row is one record (one post, one user, one comment).

In Supabase, tables live in a PostgreSQL database. You create and manage them through the Supabase Dashboard or with SQL commands. Every table can have:

  • Columns — Define the structure (name, type, constraints)
  • Rows — Individual records of data
  • Primary Key — A unique identifier for each row (usually id)
  • Foreign keys — References to rows in other tables
  • RLS Policies — Security rules controlling who can access what

When your loader fetches data, it queries a table: supabase.from('posts').select('*') → fetches all rows from the posts table

When your action creates data, it inserts into a table: supabase.from('posts').insert([{title, content}]) → adds a new row

Common debugging issues with tables:

  • Wrong table name → Supabase returns an error
  • Missing columns → Insert fails with a column error
  • No RLS policies → Returns empty arrays (the silent killer)
  • Wrong column types → Validation errors on insert

Related: Database, SQL, Primary Key, Foreign Key, Schema, Row Level Security, RLS Policy, Query

Tables often have indexes on frequently queried columns (like foreign keys or status fields) to speed up queries, and database triggers to automate logic when rows change.

Ready to Build Something Real?

We give you the skills to build, deploy, and own a full product. Professional stack, AI co-pilot, no coding background required.