Monday, February 11, 2019

B5 - Relational Database Theory

Relational database theory is the theory behind the relational model which is applied to design relational database. A database model is “a type of data model that determines the logical structure of a database and fundamentally determines in which manner data can be stored, organized and manipulated”. The relational database is one of the most popular examples of a database model which uses a table-based format. The theory of it is firstly proposed by E. F. Codd in 1969 when he tried to find an approach to “satisfy the widest possible ranges of users and uses”.

A database is defined by Wikipedia as “A structured collection of records or data” and can also be understood as “an organized, machine-readable collection of symbols.” When these machine-readable symbols are organized into a collection of relations, it becomes a relational database. Here, many people use the word “table” as an alternative to “relation” as this model using columns and rows of tables to organize data. Note that the SQL also uses table instead of relation. However, every relation can be considered as a table, not every table is a relation. There can be multiple tables represent one relation in many cases. In tables of relational database, there must be “a column or group of columns, called primary key, to uniquely identify each row”. That means each row in a table has its own unique key. When people want to link different tables, they can add a column for the unique key of the linked row. This column is called foreign keys. Primary keys and foreign keys give people a way to tie different tables together so the tables can communicate when people need to perform some specific commands. “The primary keys within a database are used to define the relationships among the tables. When a PK migrates to another table, it becomes a foreign key in the other table.” Usually, people call these rows as records or tuples and call these columns as attributes. In codding format, a set of attributes is also called the head and a set of tuples is called the body. So a relation is “a set consisting of two elements: a head and a body. We can represent a relation as {Head, Body}.”

There are two integrity rules for relational database. First is the row must be distinct. Otherwise, the system will not know which row is correct when it collects information from database. Second is that the column values cannot be repeating groups or arrays. When each row in a table is different, we can use a unique column which is the primary key mentioned above to represent that table.

Sources:
[1] The Java™ Tutorials, https://docs.oracle.com/javase/tutorial/jdbc/overview/database.html
[2] Hugh Darwen, "An introduction to relational database",  2010, from
https://dvikan.no/ntnu-studentserver/kompendier/an-introduction-to-relational-database-theory.pdf
[3] Relational Database Theory. Retrieved February 12, 2019, from http://archive.oreilly.com/oreillyschool/courses/phpsql2/phpsql203.html
[4] Relational Database - Wikipedia. Wikipedia. Retrieved February 12, 2019, from https://en.wikipedia.org/wiki/Relational_database

Commons:
Weiyi Tang, I like the picture you use. It clearly shows where the database can be applied in a practical case. And the example you used in Linux also help me a lot to understand how can database being used.

Jenny Fretta, you clearly explained what is object oriented database and even point out its advantages. Your example used in the blog represents the most important advantage of object oriented database which is saving space and time for processing while reducing the risk of information delay.

Yicheng Li, I learned a brief history of SQL and its characteristics. And I agree that SQL helps people manage and store large databases more easily and more reliably. Great introduction.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.