LearnWave
Learn it. Master it.

Database Concepts

The relational data model

Find the degree and cardinality of a relation.

A data model describes a database's structure: how data is defined and represented, the relationships among data, and the constraints. The most common is the relational data model, in which tables are called relations. Relations are linked through common attributes: ATTENDANCE and STUDENT share RollNumber; STUDENT and GUARDIAN share GUID.

Terms in the relational model:

  • Attribute: a column (also called a field), holding one characteristic.
  • Tuple: a row: one related set of values (one guardian, one student).
  • Domain: the set of values an attribute may take, usually given by its data type.
  • Degree: the number of attributes (columns). GUARDIAN, with GUID, GName, GPhone and GAddress, has degree 4.
  • Cardinality: the number of tuples (rows). GUARDIAN, with 5 rows, has cardinality 5.

Three properties of a relation:

  • Attributes: each has a unique name, and the order of attributes does not matter.
  • Tuples: no two tuples are identical, and the order of tuples does not matter.
  • Values: each value is atomic (cannot be split further) and comes from the attribute's domain; each tuple has exactly one value per attribute, so a guardian cannot store two phone numbers in one GPhone value. NULL stands for a value that is unknown or not applicable.

Example (new): a LIBRARY_BOOK relation with columns AccessionNo, Title, Author, Price and Shelf, holding 250 books, has degree 5 and cardinality 250. Adding a new book changes the cardinality to 251; adding a column for Publisher changes the degree to 6.

Degree counts columns; cardinality counts rows.

Practise this lesson

Questions that get harder as you improve, a Tutor that helps without giving the answer away, and progress you can see. Free for every learner.

No account, no email address. Opens the real product.