Which of the attributes below you think would contain

This preview shows page 20 - 26 out of 40 pages.

Which of the attributes below you think would contain component attributes? -STUDENT: student ID, student name, student address, major-AUTOMOBILE: VIN, color, weight, horsepower-EMPLOYEE: employee ID, name, salary, skill, phone numberWhether a composite attribute should be broken down into smaller parts depends on the ultimate use of the attribute. For example, if the organization will want information onstudents living on a particular area code, then the phone number would be a candidate to be subdivided into two separate attributes (e.g., area code, phone number)Composite attribute has the list of component attributes identified within parenthesis ( )
17F-CST8215 – Database – Lesson 2 21 / 40 Single-Valued vs. Multi-Valued Attributes An attribute having more than one value for a given entity/relationship instance Multivalued attributes are identified within braces { }
17F-CST8215 – Database – Lesson 2 22 / 40 Stored vs. Derived Attributes A derived attribute is calculated based on other attributes Age can be derived based on date of birth and today’s date Order total can be derived by summing up the items on the order There is no hard and fast rule on which to use, but a rule-of-thumb in an OLTP database if the attribute can be derived/calculated, then do so’ In a data warehouse database, it is very common to have derived attributes stored on the database
17F-CST8215 – Database – Lesson 2 23 / 40 Identifier Attributes An attribute or combination of attributes that uniquely identify an instance of an entity type Student name would not be a suitable candidate -> more than one person with same name could be students Rules for selecting and naming identifier attributes: - Its value will never change - Its value must be valid and will always exist, cannot ever be null - Avoid intelligent identifiers, i.e. first two characters of identifier may be from the warehouse code. In the event the warehouse code changes, then, this identifier attribute is no longer valid - Name must be unique - Common practice to use a ‘code’ value generated with each new entity instance. i.e., student number format XXXX9999, where XXXX = first 4 characters of last name, 9999 = next sequential number for XXXX
17F-CST8215 – Database – Lesson 2 24 / 40 Attribute Naming Use a naming convention:-Abbreviations acceptable? If yes, then produce list of acceptable abbreviations (‘qty’, ‘nm’, ‘dt’, ‘max’, ‘loc’)-Use a singular noun or noun phrase, e.g., ‘age’, ‘initial’, ‘birth date’ instead of ‘date of birth’, ‘student name’ instead of ‘name of student’-
17F-CST8215 – Database – Lesson 2 25 / 40 Integrity Constraints Relational databases include constraints (rules) limiting acceptable values and actions.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture