database design
data organization
relational databases
table structure
database tables

multiple tables broken down into categories vs one table with many columns

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

Choosing between many category-specific tables and one wide table is a schema-design decision, not just a style preference. The right answer depends on whether the rows really represent the same kind of thing, how sparse the attributes are, and whether query convenience or data integrity should dominate the design.

Use Separate Tables for Different Entities or Repeating Relationships

Relational design is strongest when each table represents one coherent entity or one well-defined relationship. If the data naturally splits into different concepts, separate tables are usually the cleaner model.

sql
1CREATE TABLE customers (
2    customer_id INT PRIMARY KEY,
3    name VARCHAR(100) NOT NULL
4);
5
6CREATE TABLE orders (
7    order_id INT PRIMARY KEY,
8    customer_id INT NOT NULL REFERENCES customers(customer_id),
9    ordered_at TIMESTAMP NOT NULL
10);
11
12CREATE TABLE order_items (
13    order_id INT NOT NULL REFERENCES orders(order_id),
14    product_id INT NOT NULL,
15    quantity INT NOT NULL,
16    PRIMARY KEY (order_id, product_id)
17);

This is easier to constrain and reason about than putting repeated order-item columns into one giant table.

One Wide Table Is Fine When the Row Shape Is Stable

A single table with many columns can be completely reasonable when every row represents the same type of object and most columns are relevant for most rows.

sql
1CREATE TABLE employee_profiles (
2    employee_id INT PRIMARY KEY,
3    first_name VARCHAR(50) NOT NULL,
4    last_name VARCHAR(50) NOT NULL,
5    department VARCHAR(50) NOT NULL,
6    title VARCHAR(100) NOT NULL,
7    hire_date DATE NOT NULL,
8    manager_id INT NULL,
9    office_location VARCHAR(100) NULL
10);

This works because each row still describes one consistent business entity with one predictable attribute set.

The Real Warning Sign Is Sparsity

Trouble starts when a wide table tries to represent several categories that do not share the same attributes. Then the table fills with nullable columns and rules that only apply to certain row types.

Imagine one products table with columns like isbn, cpu_model, seat_material, battery_capacity, and fabric_type. Most rows would leave most columns empty. Constraints become harder to express, and the table stops meaning one clear thing.

A cleaner model is often a shared base table plus subtype tables.

sql
1CREATE TABLE products (
2    product_id INT PRIMARY KEY,
3    category VARCHAR(20) NOT NULL,
4    name VARCHAR(100) NOT NULL
5);
6
7CREATE TABLE books (
8    product_id INT PRIMARY KEY REFERENCES products(product_id),
9    isbn VARCHAR(20) NOT NULL
10);
11
12CREATE TABLE laptops (
13    product_id INT PRIMARY KEY REFERENCES products(product_id),
14    cpu_model VARCHAR(100) NOT NULL,
15    ram_gb INT NOT NULL
16);

That keeps common attributes together while letting category-specific data live where it belongs.

Performance Should Follow Access Patterns, Not Guesswork

A common argument for one table is “joins are slow.” That is too simplistic. A well-indexed normalized design can perform very well, and a huge sparse table can perform poorly because of storage bloat, cache inefficiency, and awkward indexing.

The better questions are:

  • do queries usually need all attributes together
  • are there repeating child records
  • are writes transactional and integrity-sensitive
  • is this an operational schema or a reporting schema

If reporting needs denormalized output, build a reporting table or materialized view instead of distorting the source-of-truth model.

A Practical Rule of Thumb

Use multiple tables when the data represents different entities, subtype-specific attributes, or repeating relationships. Use one table when every row has a stable, coherent column set.

That is the real decision boundary. Not “how many joins can I avoid,” but “does one row still mean one clear thing.”

Common Pitfalls

  • Building a catch-all table with many mostly-null columns for unrelated categories.
  • Over-normalizing tiny lookup-style data that is always read together and gains little from separation.
  • Designing the operational schema around reporting convenience instead of data integrity.
  • Assuming fewer joins automatically means better overall performance.
  • Ignoring how likely the categories are to diverge as the application grows.

Summary

  • Separate tables are usually best for different entities, subtype-specific data, and repeating relationships.
  • One wide table is fine when every row shares a stable and coherent set of attributes.
  • Sparse “universal” tables are often a sign that the model is mixing several concepts.
  • Performance decisions should follow actual query patterns, not join folklore.
  • Model the source of truth cleanly first, then denormalize deliberately if reporting needs it.

Course illustration
Course illustration

All Rights Reserved.