Start studying
Module 5 · SQL Module contents
Module 5  ·  Card 1 / 14beginner

Relational Tables in SQL

In SQL, a relational table is a structured collection of data organised into named vertical columns and horizontal rows.

Each column has a specified data type, such as integers, text strings, or calendar dates, which constrains the values it can hold.

Each horizontal row represents a single distinct entity or transactional event within the table.

A primary key is a designated column or set of columns whose values uniquely identify every individual row in the table.

Relational databases enforce schemas across tables, ensuring data integrity before queries or analytical models ever read the records.

Learn in depth ↓
Module 05 · SQL · 14 concepts
In depth  /  15 lines

Relational Tables in SQL, in more detail

The relational table model was proposed by Edgar Codd at IBM in nineteen seventy, revolutionising business data storage.

In relational algebra, a table is formally known as a relation, rows are called tuples, and columns are called attributes.

Every column in a table has a strictly defined data type that enforces domain constraints on stored entries.

Common data types include fixed and variable character text, integers, floating point numbers, booleans, and timestamps.

Columns can also carry integrity constraints, such as forbidding missing values through NOT NULL specifications.

A primary key uniquely distinguishes every row, preventing duplicate entity records from corrupting the dataset.

Candidate keys are all columns capable of uniquely identifying rows, from which one is chosen as the primary key.

Foreign keys create relational links by referencing the primary key columns of external tables.

Referential integrity rules ensure that foreign key values must match existing primary keys in the referenced table.

Tables are physically stored on storage media as either row-oriented blocks or columnar chunks.

Row-oriented storage suits transactional processing, where entire single records are inserted and updated frequently.

Columnar storage suits analytical data science workloads, where queries scan and aggregate few columns across billions of rows.

Database engines use indexing structures, such as B-trees, to accelerate row lookups without scanning entire physical tables.

Designing tables without redundant data is achieved through database normalisation, reducing anomalies during write operations.

A frequent beginner trap is treating relational tables like unstructured spreadsheets with arbitrary formatting across cells.

Want the full technical article? Wikipedia ↗
Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
A database table records customer orders. What is the fundamental requirement of the column chosen as the primary key?
SQL

14 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close