Professional Documents
Culture Documents
Tables or Entities
Tables or Entities
In the context of Relational Database Management Systems (RDBMS), a table, also known as an
entity, is a fundamental concept used to organize and store data. It's a structured way to represent
data in rows and columns, similar to a spreadsheet. Let's look into into this concept in detail and
include a simple diagram for illustration.
Tables or Entities:
A table is a collection of related data organized into rows and columns. Each row represents a
record, also known as a tuple, and each column represents a specific attribute or field of that
record. Tables are used to store information about entities in the real world, such as customers,
orders, products, employees, etc.
Diagram:
+------------+-----------+----------+-------------------+-------------------------+
| CustomerID | FirstName | LastName | Email | Phone |
+------------+-----------+----------+-------------------+-------------------------+
|1 | John | Smith | john@example.com | 555-123-4567 |
|2 | Jane | Doe | jane@example.com | 555-987-6543 |
|3 | Michael | Johnson | michael@example.com | 555-555-5555 |
+------------+-----------+----------+-------------------+-------------------------+
In this diagram:
1. Primary Key: One or more columns that uniquely identify each row in the table. In the example,
"CustomerID" could be the primary key.
2. Foreign Key: A column that establishes a relationship between two tables. For example, if you
have an "Orders" table, you might have a foreign key "CustomerID" that references the
"Customers" table.
3. Normalization: The process of organizing data in a way that reduces redundancy and improves
data integrity.
4. Data Types: Each column has a defined data type, such as text, numeric, date, etc., which
specifies the kind of data that column can hold.
5. Constraints: Rules that govern the data stored in the table, like uniqueness, not null, default
values, etc.
6. Queries: SQL (Structured Query Language) is used to interact with and manipulate data in
tables, allowing you to perform operations like retrieving, updating, deleting, and inserting data.
Tables are fundamental building blocks of RDBMS, and their structure is designed to efficiently
manage and retrieve data while maintaining its integrity and consistency.