A beginner friendly introduction to databases

Learn the basics of databases, SQL, and Supabase.
Almost everything you use online, Instagram, Amazon, Uber, your bank app, runs on a database. When you send a message, book a flight, order lunch, or upload a file, you’re interacting with a database.
Understanding how databases work is one of the most important concepts in software development. If you're building or vibe coding apps, or syncing tools like Supabase and Notion together, understanding databases will help you work smarter, debug faster, and build better products.
I’ve written this intro to databases to walk you through:
- Why databases exist
- Key concepts like tables, primary keys, foreign keys, and schemas
- How databases work with SQL
What relational databases are
- And finally, how to set up Supabase correctly to sync with Whalesync
Hopefully by the end of this article, you won’t just “use” a database, you’ll actually understand it.
Once you understand how databases work, you’ll be able to build faster, scale smarter, and actually understand what’s happening behind all of the apps you use and create.
Quick disclaimer: This article is meant as a beginner-friendly introduction to databases, for a deeper dive into databases and SQL, check out Harvard’s free course, CS50's Introduction to Databases with SQL.
Let’s dive in.
What is a database?
A database is a structured collection of data that allows you to store, organize, retrieve, and update information efficiently. Instead of dealing with scattered files, a database centralizes data so applications can access it reliably.
Databases are rule-driven systems designed to keep data organized, reliable, secure, and fast, even as the amount of information scales into millions (or billions) of records. You can define your database rules, whether those rules are about the data types, relationships between the data or even access permissions.
Databases handles things you don’t see, such as:
- Security: Restricting who can view or edit data.
- Data integrity: Enforcing rules so that only valid data gets saved.
- Performance: Speeding up queries even with massive data volumes.
Why do we need databases?
Two words: Organization and reliability. Imagine you’re running a small company. At first, you might track your customers using a spreadsheet: Name, ID, Email. Easy enough.
But what happens when:
- You grow to 10,000+ customers?
- You need to control who can edit the data?
- Multiple employees need to update records at the same time?
- You want to prevent duplicate or inconsistent data?
- You need to recover lost information after a crash?
You need an organized and reliable system built to specifically store and manage your data ensuring accuracy, reliability and security.
What are the different types of databases?
There are several types of databases such as relational, NoSQL, object-oriented etc. Because most of today’s apps (and Whalesync/Supabase!) use relational databases, we'll focus mainly on them.
Relational databases store data in tables with defined schemas (columns, data types). SQL is used to manage them. Examples of relational databases include PostgreSQL, MySQL. NoSQL databases store data in flexible formats like documents, graphs, or key-value pairs. Examples of NoSQL databases include MongoDB, DynamoDB.
When we say "PostgreSQL," "MySQL," or "MongoDB," we are actually talking about database management systems (DBMS).
What is a DBMS (database management system)?
A DBMS is software that interacts with the database that allows you to create, define, manipulate, and manage databases
A DBMS handles:
- Storing the data
- Enforcing rules (like data types)
- Enabling users/applications to query and update the data
- Managing user permissions
- Keeping data safe during crashes
SQL: The language of databases
SQL (Structured Query Language) is how you talk to relational databases. You use SQL to create tables, insert data, query data, update records, and delete what you don't need, the basics of CRUD (Create, Read, Update, Delete).
Most-used SQL commands:
- SELECT: Pull specific data
- INSERT: Add new records
- UPDATE: Modify existing records.
- DELETE: Remove records
- CREATE TABLE: Build a new table
- ALTER TABLE: Change a table’s structure.
What is Supabase?

Supabase is an open-source backend platform that gives you a PostgreSQL database, authentication, real-time subscriptions, and storage all in one place.
When you create a project with Supabase, it automatically sets up a full Postgres database for you, complete with APIs, authentication systems, and dashboards to manage your data.
Supabase is especially popular because it lets you work with your database directly using SQL while still giving you modern features like real-time updates, row-level security, and serverless functions, without needing to manage servers yourself.
Supabase integrates with vibe coding tools like Replit, Bolt, Lovable and others, making it easy to spin up projects, collaborate, and build full-stack applications quickly. With Whalesync, you sync Supabase with tools like Notion and Airtable, so understanding how to structure tables, set primary keys, and manage relationships is essential for reliable syncing.
Now we’ve covered the basics of databases, let’s take a look at some important database concepts.
Important concepts to understand
Here are some important concepts relating to databases.
What is a table?
A table is a structured set of rows and columns.
- Rows = individual records (e.g., one customer, one order)
- Columns = fields that define the type of data (e.g., name, email, price)
Each row is counted as one record.
What is a primary key?
A primary key is a special column that uniquely identifies each row in a table.
- No two rows can have the same primary key value.
- Every row must have a primary key value.
When syncing your Supabase data with Whalesync, your primary keys should be auto-generated (e.g., an id that defaults to a uuid or an auto-incrementing number).
Without a primary key, it’s impossible to reliably reference or update specific rows, which breaks syncing and database integrity.
What is a foreign key?
A foreign key is a field that links one table to another. For example, an orders table has a user_id column linking back to the Users table’s id. This allows us to relate data across tables.
What is a schema?
A schema defines the structure of your database. Consider it like the blueprint for your database. The schema defines what tables exist, what columns exist, what relationships are allowed. In Supabase, the default schema is called public. You can have multiple schemas to organize different parts of your database.
What is an index?
Similar to an index in a book, an index is a pointer to data in a table. An index improves the speed of searches on a database table. Without indexes, finding a specific record would require scanning the entire table (slow). Primary keys automatically create an index.
What about Supabase + Whalesync?
If you're using Whalesync to sync Supabase data to apps like Airtable or Notion, here's what you need to know:
Primary keys are mandatory. Every table must have a primary key with a default value (like a UUID or serial ID). Regarding schemas, you can sync tables in Supabase’s public schema or any other custom schema.
You cannot sync internal Supabase schemas like:
- auth
- storage
- realtime
- graphql
Most fields are supported: arrays, text, integers, booleans, enums, timestamps, etc. Some types (like dateranges and composites) are only 1-way synced. Foreign key relationships can sync across tables, but both tables must be synced.
Some things to remember:
- Renaming tables/columns after mapping will require a remap.
- Add _html to a column name if you want HTML preserved during sync.
How to sync our Supabase data with Whalesync
Now we’re going to put everything into practice to sync our Supabase data to Airtable to build an admin panel for an e-commerce business. This will enable us to have a nice handy frontend where we can view and share our data.
But first, I need to set up my Supabase database properly.
Create a new table
First, create a new table under Supabase’s default schema. Here I have called my table ‘April_orders’

Assign a primary key to your table
Assign a primary key to your table. In this case, I have made the Product_ID the primary key. I could also assign the name as the primary key. However, I cannot assign units_sold as the primary key because I may have duplicate values.
For instance, I can have the value 24 in multiple rows. Remember, a primary key has to be unique.

Now that we’ve got this out of the way, let’s go ahead and sync Supabase with Airtable.
Step 1: Connect your source app (Supabase)


Step 2: Authorize Supabase using OAuth

Step 3: Select the project you want to authorize and hit ‘Continue’

Step 4: Connect your destination app (Airtable)


Step 5: Authorize Airtable using OAuth

Step 6: Choose if you want to sync an existing tables or auto-create a new one

Step 7: Map your tables

Step 8: Map your fields

Step 9: Go over the initial sync steps

Step 10: Watch your records syncing over

Congratulations! You now have a sync between Supabase and Airtable 🎉.

Happy building 🚀
Whether you’re coding an app, syncing tools like Supabase and Notion with Whalesync, or just working with growing amounts of data, knowing how databases work gives you a major advantage.
Hopefully, now you don't just "use" a database, you actually understand how it works under the hood! What project are you going to build next using Whalesync?
Subscribe for more
Stay up to date with the latest no-code data news, strategies, and insights sent straight to your inbox!