Knowledgebase

Understanding Tables, Rows and Columns Print

  • databasesphpmyadmin, databases, woocommerce, guide, howto, solution, zillionkinghost, hosting
  • 0

The structure of stored data.

A TABLE

Holds one kind of thing. A posts table holds posts; a users table holds users.

Each table has a defined set of columns.

A COLUMN

One piece of information, with a type: a number, text, a date.

The type determines what can be stored. A column defined for short text rejects a long value.

A ROW

One record. One post, one user, one order.

THE PRIMARY KEY

A column, usually called id, uniquely identifying each row. Almost always a number that increments automatically.

Other tables reference rows by this id rather than duplicating the data.

HOW TABLES RELATE

An orders table stores a customer id rather than the customer's full details.

That is why deleting a row can break things elsewhere: something may still reference it.

WHY THIS MATTERS PRACTICALLY

When you edit data directly, you are editing rows. Understanding that a row may be referenced elsewhere is what prevents breaking the site.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot