0% found this document useful (0 votes)
16 views4 pages

Unit 1.2 - Relational Model Basics (Tables, Rows, Columns, Keys)

The Relational Model, proposed by E.F. Codd in 1970, organizes data into tables for easy manipulation and querying using SQL. It consists of tables (relations), rows (records), columns (attributes), and keys (primary and foreign) to ensure data integrity and relationships. This model is widely used across various sectors, making it fundamental to modern database management systems.

Uploaded by

Winssis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

Unit 1.2 - Relational Model Basics (Tables, Rows, Columns, Keys)

The Relational Model, proposed by E.F. Codd in 1970, organizes data into tables for easy manipulation and querying using SQL. It consists of tables (relations), rows (records), columns (attributes), and keys (primary and foreign) to ensure data integrity and relationships. This model is widely used across various sectors, making it fundamental to modern database management systems.

Uploaded by

Winssis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Republic of the Philippines

BOHOL ISLAND STATE UNIVERSITY


Magsija, Balilihan, 6342, Bohol, Philippines
Office of Instruction
Balance I Integrity I Stewardship I Uprightness

Introduction to the Relational Model


The Relational Model is the foundation of modern databases. Proposed by E.F. Codd in 1970, it
organizes data into tables (relations) that are easy to understand, manipulate, and query using SQL
(Structured Query Language).
Key idea:
• Data is stored in tables.
• Each table consists of rows (records) and columns (attributes).
• Relationships between data are represented using keys.
This model is the most widely used in business, education, banking, e-commerce, and nearly all
information systems.

Components of the Relational Model


A. Tables (Relations)
• A table represents a collection of related data about a specific entity.
• Example: A table called Students contains information about all students.
Example Table: Students
StudentID Name Age CourseID

101 Ahon 20 C101

102 Amolata 21 C102

Key Features of Tables:


1. Each table has a unique name.
2. Data is stored in rows and columns.
3. Order of rows and columns does not matter (logical structure, not physical).

B. Rows (Tuples / Records)


• Each row represents a single record or instance of the entity.
• In the example, each row = one student.
Example:
• Row 1 = Student with ID 101 (Ahon).
• Row 2 = Student with ID 102 (Amolata).
Rules:
1. No two rows are exactly the same.
2. Each row is uniquely identified by a Primary Key.

C. Columns (Attributes / Fields)


• Each column represents a property (characteristic) of the entity.
• Example: StudentID, Name, Age, CourseID.
Key Points:
1. Each column has a name and a data type (e.g., integer, string, date).
2. Each value in a column must be atomic (indivisible) → this is called First Normal Form (1NF). o
Example: Instead of FullName = "Fiona Ahon", it should be stored as FirstName =
" Fiona", LastName = "Ahon" if separation is needed.
D. Keys in Relational Model
Keys are crucial for uniqueness and relationships in the database.

Page | 1
Republic of the Philippines
BOHOL ISLAND STATE UNIVERSITY
Magsija, Balilihan, 6342, Bohol, Philippines
Office of Instruction
Balance I Integrity I Stewardship I Uprightness

1. Primary Key (PK)


• A column (or set of columns) that uniquely identifies each row in a table.
• No two rows can have the same primary key value.
• Cannot be NULL.
Example:
• In Students, StudentID is the Primary Key.

StudentID (PK) Name Age CourseID

101 Ahon 20 C101

102 Amolata 21 C102

2. Foreign Key (FK)


• A column in one table that refers to the Primary Key in another table.
• Used to establish relationships between tables.
Example:
• CourseID in Students table is a Foreign Key referencing CourseID in Courses table.
Courses Table
CourseID (PK) CourseName

C101 Database 1

C102 Java Prog

This creates a relationship:


• Ahon (StudentID 101) → enrolled in Database 1 (C101).
• Amolata (StudentID 102) → enrolled in Java Prog (C102).

3. Candidate Key
• Any column (or set of columns) that can be a Primary Key.
• Example: Both StudentID and Email could uniquely identify a student. One is chosen as the
Primary Key.

4. Composite Key
• A key made up of two or more columns when a single column is not enough to uniquely identify a
record.
• Example: In an Enrollment table, (StudentID, CourseID) together form the key (because
a student can enroll in multiple courses, and a course has many students).

5. Alternate Key
• The keys that were not chosen as the Primary Key but could still serve as one.
Example Database with Keys
Students Table
StudentID (PK) Name Age CourseID (FK)

101 Ahon 20 C101

102 Amolata 21 C102

103 Galleto 19 C101

Page | 2
Republic of the Philippines
BOHOL ISLAND STATE UNIVERSITY
Magsija, Balilihan, 6342, Bohol, Philippines
Office of Instruction
Balance I Integrity I Stewardship I Uprightness

Courses Table
CourseID (PK) CourseName

C101 Database 1

C102 Java Prog

Relationships:
• CourseID in Students → FK referencing CourseID in Courses.
• Ensures referential integrity → a student cannot be assigned to a non-existing course.

Advantages of Relational Model


Simple and intuitive structure (tables, rows, columns).
Uses SQL for data operations.
Enforces data integrity through keys and constraints.
Flexible – supports relationships between multiple entities.
Scalable – widely used in small to large systems.

Key Takeaways
1. The relational model is based on tables, rows, and columns.
2. Primary Keys uniquely identify records; Foreign Keys link tables.
3. Proper use of keys ensures data integrity and consistency.
4. Almost all modern DBMS (MySQL, Oracle, PostgreSQL, SQL Server) are based on this model.
Page | 3

You might also like