LearnViz CompSci
Home / Learn / Databases / Tables, Rows and Columns

Beginner Topic 4 of 51 Databases

Tables, Rows and Columns

The basic building blocks of relational storage.

How it works

A table stores data about one kind of entity. Each column has a name and data type and defines one attribute, while each row is one record, holding a value for every column or NULL. Table definitions also include constraints such as NOT NULL, UNIQUE, CHECK, primary and foreign keys and default values. Together the table definitions form the schema, created with CREATE TABLE and changed with ALTER TABLE.

Step-by-step walkthrough

  1. A table is a grid with named columns.
  2. Each column has a data type.
  3. Each row is one record, such as one customer.
  4. A cell is the value of one column in one row.
  5. The schema defines columns, types and constraints.

Where it is used

Customers, products, invoices and logs each live in their own table. Choosing clear names and appropriate types makes queries understandable and storage efficient.

Common pitfall

Using one wide table for everything duplicates data, while splitting into too many tiny tables makes queries complex. Wrong column types, like storing dates as text or money as floating point, cause errors and slow queries. Altering large tables can lock them, so plan migrations carefully. Avoid storing lists in a single column.

Where it fits in the course

Tables, Rows and Columns is topic 4 of 51 in Databases, rated Beginner. It follows Relational Model. The next topic is Primary Keys.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Databases quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Tables, Rows and Columns?
The basic building blocks of relational storage. It belongs to Databases and is a beginner-level topic.
Where do people use Tables, Rows and Columns?
Customers, products, invoices and logs each live in their own table.
What is the most common mistake with Tables, Rows and Columns?
Using one wide table for everything duplicates data, while splitting into too many tiny tables makes queries complex.
What should I learn before this topic?
Start with Relational Model, the topic just before it in Databases.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Databases quiz.
Is Tables, Rows and Columns hard to learn?
It is a Beginner topic, so it works as an entry point. If the terms are new, read the explanation twice and try the visualizer before the quiz.
How long does it take to learn Tables, Rows and Columns?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Tables, Rows and Columns?
Relational Model, Primary Keys, DBMS are closely connected. The full list is in the related topics section of this page.
What should I study after Tables, Rows and Columns?
Continue with Primary Keys, the next topic in Databases.

Related topics