• 20 heures
  • Moyenne

Ce cours est visible gratuitement en ligne.

course.header.alt.is_video

course.header.alt.is_certifying

J'ai tout compris !

Mis à jour le 29/08/2024

Discover the concept of the relation

One sunny day in 1970, Edgar Codd of San Jose’s IBM research laboratory created the relational model. He must have done something right, because it has certainly caught on!

Today, the relational model is used in the vast majority of databases and is the conceptual basis of relational database management systems (RDBMS), including:

  • IBM System R

  • Oracle

  • DB2

  • MySQL.

It also gave rise to SQL, one of the world's most popular languages used to manipulate data.  

The (theoretical) object that we will be manipulating throughout this course is called a relation. Simply put, a relation is a table in which data is placed. In a table, a single row represents a single object, and all rows represent objects of the same kind. 

Think about a representation of a basket of apples. We can refer an apple's weight (in grams), their diameter (in centimeters), and their color (red, green or yellow). We can also assign each one an identifier, that is, a unique number (or code) that makes it possible to differentiate them from one another.

Identifier

Weight

Diameter

Color

1

151 g

8.3 cm

red

2

169 g

9.1 cm

green

3

134 g

8.0 cm

green

Learn the appropriate terminologies

For example, a relation in a database table is referred to as a table in relational terminology!

A tuple in a database table is equivalent to a row in relational model terminology.  In our previous example, apple 2 is represented by the following tuple:  (2, 169, 9.1, "green").

You might come across even more terms used for tuple and row, such as n-tuple, record, or vector. There are so many to choose from!

Similarly, an attribute is in a database table is equivalent to a column in relational model terminology. In our previous example, weight is an attribute. 

Finally, a domain describes the set of possible values for a given attribute. A domain is roughly equivalent to the column type in database terminology.  For example, the domain of the color attribute is the set:  {green, red, yellow} . The domaine of the weight attribute can be comprised of any real and positive value (that is, any decimal number greater than 0). The domaine of the identifier attribute is a set of whole numbers and can be any whole number value. 

Summary

  • In this course, we will manipulate tables, which can also be referred to as relations.

  • In these tables, a row (= tuple) represents an object. All rows within a table represent objects of the same kind.

  • We will often use relational algebra terms and database terms interchangeably: you will need to know what the words refer to in each system!

Exemple de certificat de réussite
Exemple de certificat de réussite