Relational Database

 Relational Database



relational database is a digital database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relational database systems have an option of using the SQL (Structured Query Language) for querying and maintaining the database. 

source: wikipedia

Relational model

This model organizes data into one or more tables("relations) of columns and rows, with a unique key identifying each row. Row are also called record or tuples. Columns are also called attributes. Habitually, each table(relation) represents one "entity type" (customer or product). The rows represent instances of that type of entity ("Lee" or "char") and columns representing values attributed to that instance("address" or "price"). 

For example, each row of a class table corresponds to a class, and a class corresponds to multiple students, so the relationship between the class table and the student table is "one to many"

Keys

Each row in a table has its own unique key. Rows in a table can be linked to rows in other tables by adding a column for the unique key of the row (foreign keys). 

The primary keys within a database are used to define the relationships among the tables. Most relational database designs resolve many-to-many relationships by creating an additional table that contains the PKs from both of the other entity tables. when the FKs combined together to a PK. 



Relationships

Relationships are a logical connection between different tables, established on the basis of interaction among these tables. 


Terminology

The table below summarizes some of the most important relational database terms and the corresponding SQL term:
SQL termRelational database termDescription
RowTuple or recordA data set representing a single item
ColumnAttribute or fieldA labeled element of a tuple, e.g. "Address" or "Date of birth"
TableRelation or Base relvarA set of tuples sharing the same attributes; a set of columns and rows
View or result setDerived relvarAny set of tuples; a data report from the RDBMS in response to a query


source: wikipedia
Previous Post Next Post