Introduction to Relational Database Management Systems (RDBMS)

Introduction to Relational Database Management Systems (RDBMS)

In our SQL class, we started by learning about different types of Database Management Systems (DBMS). These include:

  1. Hierarchical DBMS
  2. Network DBMS
  3. Object-Oriented DBMS
  4. Relational DBMS (RDBMS)

While the first three types became obsolete during the 1960s and 1970s, the fourth one, Relational DBMS, is still widely used today. Let's dive deeper into RDBMS and its key features.


What is a Relational DBMS?

A Relational Database Management System (RDBMS) is a type of DBMS that stores data in the form of tables (rows and columns). This model was designed by the data scientist E.F. Codd. Any DBMS that follows the rules set by E.F. Codd is considered an RDBMS.

An RDBMS allows you to organize data logically and efficiently. Structured Query Language (SQL) is used to communicate with and manage the data in RDBMS.


Key Concepts of RDBMS

  • Tables: A table is the fundamental unit in an RDBMS, where data is stored in the form of rows and columns.
  • Cells: A cell is the intersection between a row and a column. It is the smallest unit where data is stored in a table.

EF Codd’s Rules for RDBMS

E.F. Codd defined several rules to ensure the proper functioning of a relational database. Here are the primary ones:

  1. Single Value per Cell: Each cell in a table must hold only one value. Storing multiple values in a cell can lead to data loss or inconsistency.
  2. Everything Stored in Tables: In RDBMS, everything, including metadata, is stored in the form of tables.
  3. Relationships Between Tables: Data can be stored in multiple tables, and relationships between tables should be established using key attributes.
  4. Data Validation: Data can be validated in two ways:
    • By assigning appropriate data types to columns.
    • By applying constraints to columns.

Metadata in RDBMS

  • Metadata refers to details about the data itself. For instance, metadata contains information about the structure of the database, such as table names, column names, and data types.
  • Metadata is stored in a special table called the data dictionary or metadata table, which is automatically generated by the RDBMS.

Data Types in RDBMS

Data types are essential in RDBMS because they define the type of data that can be stored in a column. Here are the main types of data types supported by RDBMS:

  1. CHAR:

    • Used to store fixed-length strings.
    • Example: CHAR(10) can store a string of 10 characters.
    • Range: Up to 2000 characters.
  2. VARCHAR / VARCHAR2:

    • Used to store variable-length strings.
    • Example: VARCHAR(50) stores a string of variable length, but up to 50 characters.
    • Difference: VARCHAR2 is an updated version of VARCHAR in Oracle.
    • Range: Up to 4000 characters.
  3. DATE:

    • Used to store dates only (day, month, year).
    • Example: DATE stores data in the format 'DD-MON-YYYY' (e.g., '23-FEB-2025').
  4. NUMBER:

    • Used to store numerical values (both integer and decimal).
    • Syntax: NUMBER(precision, scale)
    • Precision defines the number of digits, and scale defines the number of digits after the decimal point.
  5. Large Objects:

    • Used to store large data such as text, photos, videos, etc.
    • CLOB (Character Large Object): Used to store large amounts of text data (up to 4GB).
    • BLOB (Binary Large Object): Used to store binary data like images, videos, and audio (up to 4GB).

Understanding Number Data Type: Precision and Scale

  • Precision: Refers to the total number of digits stored. It is mandatory and has a range of 1–38.
  • Scale: Refers to the number of digits after the decimal point. It is optional and has a range of -84 to 127. The default value for scale is zero.

Conclusion

In this SQL class, we have covered the basic introduction to RDBMS and its essential features. RDBMS is a powerful tool for organizing and managing data efficiently in relational tables, allowing us to ensure data integrity and scalability. The knowledge of data types, metadata, and validation techniques will form the foundation for working with RDBMS in real-world applications.

Stay tuned for more topics on SQL and Java in upcoming lessons. Thank you for reading!

Comments

Popular posts from this blog

Budgeting Made Easy: Understanding Fixed and Variable Expenses for Newcomers | The Z Blogs

Effective Strategies for Saving Money on a Tight Budget: Tips You Need to Know | The Z Blogs