0% found this document useful (0 votes)
10 views16 pages

Database 3

This document discusses attributes in a database system. It defines attributes as the properties or characteristics of an entity type that an organization wants to store information about. Attributes can be required or optional, simple or composite, single-valued or multi-valued, and stored or derived. Examples of each type of attribute are provided. The document also discusses choosing identifier attributes and naming conventions for attributes.

Uploaded by

upxwbn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views16 pages

Database 3

This document discusses attributes in a database system. It defines attributes as the properties or characteristics of an entity type that an organization wants to store information about. Attributes can be required or optional, simple or composite, single-valued or multi-valued, and stored or derived. Examples of each type of attribute are provided. The document also discusses choosing identifier attributes and naming conventions for attributes.

Uploaded by

upxwbn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Introduction to Database System

Ghalib University
Computer Science Department
Zabihullah Rahmani

1 Ghalib University By Zabihullah Rahmani


Table of contents
 Attribute and its different types

2 Ghalib University By Zabihullah Rahmani


Attributes
 The properties or characteristics of an entity type in which the organization

interest to keep information is called attribute.

 Each entity type has a set of attributes associated with it.

 Example

3 Ghalib University By Zabihullah Rahmani


Cont..

4 Ghalib University By Zabihullah Rahmani


Types of Attributes
 Attributes may be of different types.They may be:

 Required Versus Optional Attributes

 SimpleVersus Composite Attributes

 Single valued Versus multi-valued Attributes

 Stored Versus Derived Attributes

5 Ghalib University By Zabihullah Rahmani


Cont..
 RequiredVersus Optional Attributes

 Required Attributes

 An attribute that must be present for each entity instance is called a required
attribute.
 E.g. Reg_No, Name

 Optional Attribute
 An attribute that may not have a value for every entity instance.
 E.g. Overtime_Houre, Email

 In various E-R diagramming notations, a symbol might appear in front

of each attribute to indicate whether it is required (e.g., *) or optional

6 Ghalib University By Zabihullah Rahmani


Cont..

7 Ghalib University By Zabihullah Rahmani


Cont..
 SimpleVersus Composite Attributes

 Simple

 A simple (or atomic) attribute is an attribute that cannot be broken down into

smaller components that are meaningful for the organization.


 E.g. all the attributes associated with AUTOMOBILE are simple: Vehicle ID,
Color,Weight, and Horsepower.
 Composite
 An attribute that has meaningful component parts
 E.g. Address which can be broken down into components like House_NO, Street,
City, State.

8 Ghalib University By Zabihullah Rahmani


Cont..
 Single valued Versus multi-valued Attributes

 Single-Value Attributes

 An Attribute that can take one and only one value for a given entity instance. e.g.

Reg_No, Roll_No

 Multi-Value Attributes
 An Attribute that may take more than one value for a given entity instance. e.g.

Phone_No, Skill.

9 Ghalib University By Zabihullah Rahmani


Cont..
 Store versus Derived Attributes

 Store Attributes

 An attributes that value are store in database are called store attributes. E.g.

Reg_NO, name, address, phone, etc.

 Derived Attributes

 An attribute whose value can be calculated from related attribute values is called

derived attributes. E.g. EMP_AGE.

10 Ghalib University By Zabihullah Rahmani


Symbols For Attributes

11 Ghalib University By Zabihullah Rahmani


Example

12 Ghalib University By Zabihullah Rahmani


Identifier Attribute
 The ERM uses identifiers, that is, one or more attributes that uniquely

identify each entity instance.

 No two instances of the entity type may have the same value for the identifier

attribute.
 In the relational model, such identifiers are mapped to primary keys (PKs) in
tables. Identifiers are underlined in the ERD.

13 Ghalib University By Zabihullah Rahmani


Choosing Identifier Rules
 Choose an identifier that will not change its value over the life of each

instance of the entity type.

 Choose an identifier such that for each instance of the entity, the attribute

is guaranteed to have valid values and not be null (or unknown).

 Try to select single attribute for identifier.

14 Ghalib University By Zabihullah Rahmani


Naming and Defining Attributes
 The general guidelines for naming:

 An attribute name is a singular noun. Such as Customer_ID, Age

 An attribute name should be unique

 An attribute definition should make it clear what is included and not

included in the attribute’s value

15 Ghalib University By Zabihullah Rahmani


Any question…?????

16 Ghalib University By Zabihullah Rahmani

You might also like