RDBMS is not to be missed when learning about SQL.What is RDBMS?What components does it contain?We will learn together in this lesson offline.

relational database management system

relational database management system

What is RDBMS?

RDBMS Relational Database stands Management System (Management Systemdatabaserelations).RDBMS is the foundation forSQLas well as for all other database systems such as MS SQL Server, IBM DB2, Oracle, MySQL and Microsoft Access.

A relational database management system is a relational database management system (DBMS) introduced by the EFCodd.

What is a table?

If you know about SQL you probably already know the tables in it.It can be said that the data in the RDBMS stored in the database objects are called tables.This table is basically a collection of relational data items and it consists of multiple columns and rows.

Remember, tables are the simplest and most common form of data storage in a relational database.Here is an example of a SAN_PHAM table:

| ID | TEN      |  SL |    GIA    |THANH_TIEN|
|  1 | Tui01    |  2  |  150000   | 300000.00|
|  2 | Tui02    |  20 |  100000   |2000000.00|
|  3 | Tui03    |  10 |  300000   |3000000.00|
|  4 | Vi01     |  15 |  200000   |3000000.00|
|  5 | Vi02     |  5  |  100000   | 500000.00|

What is a school?

Every table can be divided into smaller items called fields.The fields in the SAN_PHAM table are: ID, TEN, SL, GIA and THANH_TIEN.A field is a column in a table, which is designed to maintain specific information about every record in the table.

What is a record or row?

A record is often called a data row, which is an individual item that exists in the table.For example, there are 5 records in the table SAN_PHAM on.And here is a row or data table in the SAN_PHAM table:

|  1 | Tui01    |  2  |  150000   | 300000.00|

The record is a horizontal entity in the table.

What is a column?

A column is a vertical entity in the table, containing all the information associated with a field in the table.For example, a column in the SAN_PHAM table is TEN, describing the product name and is displayed as below:

| TEN      |
| Tui01    |
| Tui02    |
| Tui03    |
| Vi01     |
| Vi02     |

What is a NULL value?

NULL value in the table is the value in the empty field, otherwise, the field does not contain a value, it is empty when the record is created.You need to remember that NULL is a blank field, completely different from zero or whitespace.A field with NULL values is a field that was left empty from the record creation process.

Constraint in SQL

relational database management system

relational database management system

Constraints are rules that enforce the data columns of a table.They are used to limit the type of data that can be entered into a table.These constraints help ensure the accuracy and reliability of the data in the database.

There are two main types of constraints: column-level constraints (applied only in columns) and table-level constraints (applied throughout the data table).

Here is a list of the most commonly used constraints in SQL:

  • NOT NULL: Ensure that the column does not contain a NULL value.
  • DEFAULT: Provides a default value for the column when no value is specified for the column.
  • UNIQUE: Ensures that all values in a column are different.
  • PRIMARY KEY: We usually call this primary key, which defines a unique record in a database table.
  • FOREIGN Key: This constraint uniquely identifies a record in any database table.It’s hard to understand, right?You can simply assume that a foreign key is one or a group of columns in the database table, which acts as a bridge between the data in two different tables.It acts as a cross-reference between tables because it references the primary key of another table, thus setting it to a link between tables.Most tables in a database system follow the foreign key concept.In complex databases and data warehouses, data in a domain must be added to multiple tables, thus maintaining the relationship between them.The concept of referential integrity is also derived from this foreign key theory.Executing an extra key is more complex than a primary key.
  • CHECK: The CHECK constraint ensures that all values in a column meet certain conditions.
  • INDEX: Typically used to create and extract data from a database quickly.

Data integrity in SQL

Data integrity is a complete, accurate and consistent whole of data, which ensures that new, modified values are guaranteed to be accurate and reasonably consistent with the overall data.Integrity is usually established during the database design phase through the use of standard procedures and rules.Various methods of error checking and validation procedures will be developed to maintain the integrity of the data.If the data entered into the table violates the rules and procedures of data integrity then it will not be saved to the database.

Here are some types of data integrity that exist in each RDBMS:

Entity Integrity: Ensures that there are no duplicate records in the table.

Domain Integrity: Ensures that data entered into a specific column is subject to certain restrictions such as data type, format, or data range.

Referential integrity: Refers to the accuracy and consistency of the data in the relationship.In relational databases, data is linked between two or more tables.This is achieved through foreign keys.Therefore, referential integrity ensures that the row is deleted when it is used by another record, that is, the data must remain intact on both sides of the reference.

User-Defined Integrity: Apply some user-defined data integrity rules, provided that the rule is different from the data integrity types above.

Standardize the database

Standardization of databases is the process of organizing data efficiently in a database.Why need to implement this process?There are two reasons:

  • First, remove duplicate data, such as the same data stored on multiple tables.
  • Second, ensure that the dependency of meaningful data, such as properly stored data, related data, is stored on the same table.

These two reasons are well worth the standardization of the database, as they reduce the amount of storage space that the database uses and ensures that the data is stored logically.Standardization includes a series of instructions that help you create a good database structure.

Standardized instructions are divided into Normal Forms (the format or structure of a database structure) with the purpose of organizing the database structure so that it conforms to the First Normal Form (1NF) Second Normal Form (2NF) and finally Third Normal Form (3NF).We will learn more about these Normal Forms in later papers.

This whole theory, the concept of a tangle as a jumble, but you try to capture the main idea as it is the basis for the implementation of the next content in SQL.The following article is also a theory, talking about the database: D

Read More:


Overview of SQL

Leave a Comment