Therefore referential integrity ensures that it will be impossible to assign a

Therefore referential integrity ensures that it will

This preview shows page 14 - 16 out of 16 pages.

tuple (row) in another relation. Therefore, referential integrity ensures that it will be impossible to assign a non-existing foreign key value to a table. Entity integrity describes a condition in which all tuples within a table are uniquely identified by their primary key. The unique value requirement prohibits a null primary key value because nulls are not unique. Referential integrity describes a condition in which a foreign key value has a match in the corresponding table or in which the foreign key value is null. The null foreign key “value” makes it possible not to have a corresponding value, but the matching requirement on values that are not null makes it impossible to have an invalid value.
Image of page 14
Entity integrity requires a primary key at the time the table is created. For example, a unique employee number is assigned to new employees. Thus, a payroll check could not be made without an employee having a unique employee identification number. Referential integrity refers to the requirement that all foreign keys match existing primary key values or be null. An example of referential integrity is when an employee has a department number in the employee table. This number must come from a valid department number in the department table. Question 25 40 / 40 pts (CO 4) Explain the terms entity and attribute. Describe an example of an entity and then list two attributes. Using your examples, explain the data types that would be used to capture the attributes. Your Answer: In clinical data, the entity is typically a clinical event, as described above. In more general-purpose settings, the entity is a foreign key into an "objects" table that records common information about every "object" (thing) in the database at the minimum, a preferred name, and brief description, as well as the category/class of entity to which it belongs. Every record (object) in this table is assigned a machine-generated object ID. The "objects table" is now standard in most large bioinformatics databases. The use of an objects table does not mandate the concurrent use of an EAV design: conventional tables can be used to store the category-specific details of each object. In the EAV table itself, this is just an attribute ID, a foreign key into an Attribute Definitions table, as stated above. However, there are usually multiple metadata tables that contain attribute- related information, and these are discussed shortly. An entity is defined as a person, place, thing, or concept about which we wish to store data. Examples: customer, employee, teachers, products, books, appointments, and so on. Attributes can be defined as the type of data we want to keep about each entity in our tables. For example, a customer entity would have attributes, such as first name, last name, address, phone number, account number, and so forth. Using the example of customer entity, we can collect the phone number attribute using the text data type. The address attribute would be collected using the text data type.
Image of page 15
Image of page 16

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture