Database Reference
In-Depth Information
value of StudentID identiies an instance of the entity STUDENT, which is an individual student.
Sometimes, an identiier may consist of more than one attribute, for example, a combination of
the irst name and last name.
When an identiier can uniquely distinguish each individual entity instance, it is called a key .
In general, an identiier does not have to be unique. For example, if the last name attribute is used
as an identiier, there may be several students that have the same last name. When there is no attri-
bute in an entity that can serve as a unique identiier, you can use a sequence of unique integers
as the key, which is often called a surrogate key and the integers used by this type of key can be
generated automatically by a DBMS.
A domain is a set of possible values that an attribute can use. For example, possible values for
the attribute Grade are A, B, C, D, and F. hen, the domain for the attribute Grade is a set of char-
acters {A, B, C, D, F}. A domain is used to specify the data type and constraints for an attribute.
In Table 2.6, domains are deined for each attribute in the entity STUDENT.
From the requirement analysis, we come up with the attributes for the other entities CLASS,
COURSE, CLASSROOM, BUILDING, TIMEBLOCK, SEMESTER, and FACULTY listed in
Figure 2.5.
For some of the entities such as SEMESTER, an integer ID attribute is added as the key
instead of using SemesterName as the key. A semester name could be a long string. It is not as
convenient as using an integer. Also, an integer key can be automatically generated by the DBMS.
Table 2.6
Attributes and Their Domains
Attribute
Domain Deinition
StudentID
A set of distinct positive integers
First Name
A set of character strings with variable length
Last Name
A set of character strings with variable length
Major
A set of character strings with variable length
CLASS
STUDENT
TIMEBLOCK
FACULTY
ClassID
StudentID
TimeID
FacultyID
CourseID
TimeID
SemesterID
DayID
FirstName
LastName
Major
Block
FirstName
LastName
Department
SEMESTER
SemesterID
BUILDING
BuildingID
COURSE
CourseID
CLASSROOM
ClassroomID
SemesterName
BuildingID
DAYS
DaysID
BuildingName
CourseName
Prerequisite
Credit
Description
Capacity
Weekday
Figure 2.5
IDEF1X icon representing entities and their attributes.
 
Search WWH ::




Custom Search