Page 454 - Computer_Science_F5
P. 454

birth whose values may be Juma, 11101  values we can assign to an attribute and
              Kivukon, and 2/3/1980, respectively.     can be considered as a constraint on the
                                                       attribute’s value. Each attribute has a
              (c) Relation                             domain. For example,  for an attribute
              It is a set of tuples or records with the  “Grade” in a student database, its domain
          FOR ONLINE READING ONLY
              same attributes; a set of columns and rows  can be a positive number between 0       Chapter Eight: Databases and Database Management Systems
              as in Figure 8.8. Also, we refer to it as an  and 100.  Another example  could be
              entity that is a generalised class of people,  an attribute “Regions” in the Tanzania
              places, concepts, or things for which data  census database in which by March 2022,
              is collected, stored, and maintained. The  there were 31 regions (26 from Tanzania
              entity is also named Table in a database.  mainland and 5 from Zanzibar); thus, the
              For example, a school database may  domain  alphabetically  is “Arusha, Dar
              include Students, Classes, and Courses.  es Salaam, Dodoma, Kaskazini Pemba,
                          Attribute                    Kusini Unguja , Tabora, Tanga”.


                                                       (e) Primary key
                                                       The primary key is a tuple, field, or set
                                                       of tuples or fields that uniquely identify a
              Tuple                                    record or tuple concerning a table. A table
                                                       can have only one primary key, often
                                                       denoted as PK. The primary key cannot
                              Relation Or Entity       be null due to the dependency of other

                Figure 8.8: Illustration of some relational  fields concerning a table. A good example
                                    database basic terminologies  is a National Identification Number in the
                                                       National Identification Authority (NIDA)
              (d) Domain                               database or a student registration number
              The domain is a set of allowable values   in a student database, as indicated in
              for an attribute. It refers to a group of   Figure 8.9 as “StudID.”




















                     Figure 8.9:  Example of the primary, candidate and alternate keys using a student

                                                    445
               Student’s Book  Form Five



     Computer Science Form 5.indd   445                                                     23/07/2024   12:34
   449   450   451   452   453   454   455   456   457   458   459