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
- A table is a grid with named columns.
- Each column has a data type.
- Each row is one record, such as one customer.
- A cell is the value of one column in one row.
- 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
- Open the interactive lesson, with a mini quiz.
- Take the Databases quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- 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?
Where do people use Tables, Rows and Columns?
What is the most common mistake with Tables, Rows and Columns?
What should I learn before this topic?
How can I practice it?
Is Tables, Rows and Columns hard to learn?
How long does it take to learn Tables, Rows and Columns?
Which topics are related to Tables, Rows and Columns?
What should I study after Tables, Rows and Columns?
Related topics
- Relational Model (Databases)
- Primary Keys (Databases)
- DBMS (Databases)
- Foreign Keys (Databases)
- Truth Tables (Computer Architecture & Logic)
- Hash Tables (Data Structures)
- Symbol Tables (Languages & Compilers)