Identifying Physical Database Requirements
Identifying Physical Database Requirements
Entity Instance is a single occurrence of a particular entity type. An entity type is described just one time in the
data model, but many instances of that entity type may be represented by data stored in the database.
Example: - There may be hundreds or thousands of employees in an organization – each one is an instance of
the Employee entity type.
Entity type name EMPLOYEE PROJECT
Attributes name Name, Age, salary Pname, Pcode, Location
e1 P1
(Abebe, 25, 3500) (Database, p001, Bahir Dar) One entity instance
e2 P2
Entity set (Daniel, 42, 2500) (Water, P002, Gonder) One entity instance
(Entity e3 P3
Extension) (Aster, 32, 3000) (Construction, P003, Gonder)
. . One entity instance
. .
*
. .
pn *
en *
Relationships
A relationship is an association that exist b/n two or more participating entities.
- The function of relationship is to share data between entities.
- In E-R Diagram, a relationship is represented by a diamond shape.
- It can also be represented by listing them within the entity rectangle, under the entity name.
Example: EMPLOYEE
Emp_Id
Fname
Lname
*
*
*
Types of attributes
An attribute can be: - simple or composite, single-value or multi-value, stored or derived or null able.
1) Simple (Atomic) vs Composite attribute
. Simple attributes cannot be further divisible; whereas Composite attributes can be divided into
smaller subparts.
› ID, Salary, Gender, etc are examples of simple attributes.
› Name, Address, etc are examples of composite attributes
. In E-R Diagram, simple attributes can be represented by an ellipse shape. Example:
. In E-R Diagram, composite attributes can be represented by branched ellipse shape:
Example:
. The value of composite attribute is the concatenation of the values of its constituent simple attributes.
2) Single-valued vs Multi-valued attributes
- Most attributes have a single value for a particular entity.
- In some cases, an attribute can have a set of value for the same entity, called multi-valued.
Example: colour attribute for a car, college degree for a person.
- In E-R Diagram, Multi-valued attributes can be represented by double ellipse (oval) shape.
3) Stored vs derived attributes
. In some cases, the value of two or more attributes can be related.
Example: the Age and Birth-Date attributes of a person
-- The Age attribute is derived from the Birth-Date attribute.
-- Age attribute is derived attribute, and the Birth-Date attribute is stored attributed
In E-R Diagram, Derived attributes can be represented by dotted ellipse.
Key attributes
- Attributes can be classified as identifiers or descriptors.
- Identifiers (more commonly called keys or key attributes) which uniquely identify each instance of an
entity, called candidate key. If such an attribute doesn't exist naturally, a new attribute is defined for that purpose,
for example an ID number or code.
- In some cases, more than one attribute is required to identify a unique entity, called composite candidate key.
- A descriptor describes a non-unique characteristic of an entity instance.
- When identifying attributes of entities, identifying key attribute is very important.
- In E-R Diagram, key attributes (identifiers) can be represented by ellipse shape with underline.
i) Choose a candidate key that has values that do not change over the life of each instance of the entity type.
ii) Choose a candidate key that is guaranteed to always have valid values and not be null for each instance.
iii) If a candidate key is a composite of two or more attributes, consider creating a new key with a single
value.
Types of Keys in Relational Database Model
. Super key
. Candidate key
. Primary key
. Alternate key
. Foreign key
* Super Key is an attribute or a composite attribute which functionally determines all of the entity’s attributes.
- Since, a super key may contain additional columns that are not necessary for unique identification; we’re interested in
identifying super keys that contain only the minimum number of columns necessary for unique identification.
* Candidate Key is a super key whose values are not repeated in the table records.
- It is a super key that contains only the minimum number of columns necessary for unique identification.
- When the values in a super key are not repeated in the table’s records, then such a key is called a candidate key.
- It is possible to have more than one choice of candidate key in a particular table. In that case, the selection of the
primary key would be driven by the designer’s choice or by end user requirements.
* Primary Key is a candidate key which doesn’t have repeated values nor does it comes with a NULL value
in the table.
- A primary key in any table is both a super key as well as a candidate key.
- The candidate keys that are not selected to be the primary key are called alternate keys.
- Every entity in the data model must have a primary key whose values uniquely identify instances of the entity.
* Alternate key is the candidate keys that are not selected as the primary key of the entity.
* A foreign key is a column or group of columns in a relational database table that is used to establish and
enforce a link between data in two tables. You can create a foreign key by defining a FOREIGN KEY constraint
when you create or modify a table.
2.4. Developing database reports using acceptance criteria
What does Database Reports mean?
Database reports are the formatted result of database queries and contain useful data for decision-making and
analysis. Most good business applications contain a built-in reporting tool; this is simply a front-end interface that
calls or runs back-end database queries that are formatted for easy application usage.
For example, a banking software application may contain specifically defined reports on all customers with large
deposits or reports on monthly loan summaries for all customers.
- Database reports are developed based on acceptance criteria and requirements.
The reports are normally used to provide hard copy printouts for reviews at meetings or to mark up the information
in your database that needs updating.
An audit trail (or audit log) is a record showing who has accessed a computer system and what operations he or she
has performed during a given period of time. Audit trails are useful both for maintaining security and for recovering
lost transactions.
Most accounting systems and database management systems include an audit trail component. In addition, there are
separate audit trail software products that enable network administrators to monitor use of network resources.
Database auditing involves observing a database so as to be aware of the actions of database users.
Database administrators and consultants often set up auditing for security purposes.
LO4. Seek Client feedback and approval
Presenting DB scope and technical requirements to user for feedback
Present database scope, technical requirements and security documentation to user for feedback is very important to
develop a successful database.
. Review user feedback and adjust database as required
. Present database and documentation to user for final approval
What is feedback?
Feedback is a Process in which the effect or output of an action is 'returned' to modify the next action.
Reviewing user feedback to adjust DB.
Presenting DB and documentation to user for final approval