AIS Lec2
AIS Lec2
Introduction to Databases
The enterprise database is at the heart of Accounting Information Systems The chapter discusses the major types of databases that are available and how organizations undertake database design for accounting information systems. Larger organizations store information in data warehouses in ways that let managers analyze it to gain important insights. Many companies combine their data resources with decision support systems, executive information systems, group decision systems, and other advanced technology-based systems to improve decision making and operations.
2 2
The logical database view is how the data appear to the user to be stored.
This view represents the structure that the user must use to extract data from the database.
9
Disadvantages of DBMS
1. Expensive to implement 2. If the DBMS fails, all of the organizations information processing halts. 3. Database recovery and contingency planning are more important than in the applications approach 4. When more than one user attempts to access data at the same time, the database can face contention or concurrency problems.
Record locking can help mitigate such problems but are beyond the scope of this course
5. Territorial disputes over who owns the data, such as who is responsible for data maintenance (additions/deletions/changes) to customer data.
Sales department might think it should own those data Credit department or AR might argue with that contention.
To cope with these and other problems, most companies that have adopted the database approach have found it necessary to create a database administrator function
10
11
Spreadsheet
12
13
A primary key contains a value that uniquely identifies a specific row in a table
A candidate attribute (a column or collection of columns) in a table is that tables primary key if: 1. All attributes in the table are functionally dependent on the candidate attribute. 2. No collection of other columns in the table, taken together, has the first property.
14
15
Entity-relationship diagram
16
REA
Identify Entities
Categories of entities
Resources Events Agents Locations
Characteristics of Relationships
Relationships between entities are determined by analyzing the system The cardinality is the degree to which each entity participates in the relationship, e.g., 1:N, pronounced one-to-many.
18
Key Attributes
A unique attribute/value is needed to locate the desired record in the database
An attribute with a unique value is known as a key attribute In implementing the database, the key attribute becomes the primary key Figure 6.2 follows next
20
21
Relationships
Relationships are associations between entities. Entities must be logically linked to show the relationships between them These relationships map and define how data can be extracted from the database This mapping is the development of the E-R diagram A three-step strategy is generally most effective in identifying all the relationships that should be included in a model.
1. 2. 3.
Identify users existing and desired information requirements to determine whether relationships in the data model can fulfill those requirements. Evaluate each of the entities in pairs to determine whether one entity in the pair provides a better description of an attribute contained in the other entity in the pair. Evaluate each entity to determine if there would be any need for two occurrences of the same entity type to be linked.
22
REA Approach
The Figure 6.3 shows three entities and their attributes. Using REA, we have identified one event and two agents for business process of billing for professional services.
The WORK_COMPLETED entity is an event. The CLIENT and EMPLOYEE entities are agents.
Relationship Types in the REA Model of the Client Billing Business Process
24
Recursive relationship
A recursive relationship is a relationship between two different instances of an entity. When one employee supervises other employees, this relationship should be shown in our database The previous slide shows how a recursive relationship is displayed in an REA data model diagram. We could show employees and supervisors as separate entities in the model. Unfortunately, this separate entity approach yields data redundancies when the supervisor is supervised by a third employee. Thus, it is easier and more logically correct to use a recursive relationship to the entity, EMPLOYEE. In this recursive relationship, a link is created between the employee and his/her supervisor. As shown in part (b) of Figure 6.3 the diamond represents the recursive relationship, Supervises, just as it would be used to show any relationship such as the Works_For relationship in part (a)
25
26
The many cardinality in part (a) of the diagram only specifies the maximum participation in the relationship, not the minimum.
The minimum participation in the relationship can be zero or one. The notation (0,N) on the line on the right in part (b) reflects the range of zero to many occurrences of work being completed on client projects, where the numbers reflect (minimum, maximum). The notation (1,1) on the line on the left side in part (b), illustrates that for any given occurrence of work completed for a client, the maximum of one employee providing the specific service still holds. The (1,1) relationship reflects that there is a required participation of one, and only one, employee.
28
29
A tuple is a set of data that describes a single instance of the entity represented by a relation
For example, one employee is an instance of the EMPLOYEE relation.
Attributes, as in an E-R model, represent an item of data that characterizes an object, event, or agent.
Attributes are often called fields.
30
Example of a Relation
31
32
An Integrated REA Model for the Client Billing and Human Resources Processes
33
5.
Create separate relational table for each entity. Determine primary key for each relation. The primary key must uniquely identify any row within table. Determine the attributes for each of the entities Implement the relationships among the entities by ensuring that the primary key in one table also exists as an attribute in every table for which there is a relationship specified in the REA diagram. Determine attributes, if any, for relationship tables
34
35
Determine attributes for each of the entities In Figure 6.5, a complete REA model includes all the attributes, including the key attribute The key attribute specified in the REA model is matched to the corresponding attribute in the relation
An example is Employee_Number in the EMPLOYEE agent entity shown in Figure 6.5
To create a composite primary key, you simply break the key down into its component subattributes.
For instance, in the implementation of the WORK_COMPLETED event relation, Employee_No, Date, and Client_No are three distinct attributes in the relation, but also combine to form the composite primary key.
Note the direct mapping between the entities and attributes in the REA model and the relations and attributes, respectively, in the relational schema
The completed schema is presented in Figure 6.8
36
Schema for the Client Billing and Human Resources Portion of the Database
37
Implement the relationships among the entities by ensuring that the primary key in one table also exists as an attribute in every table for which there is a relationship specified in the REA diagram. With the availability of the full REA model, the mapping of the relationships in the model to the relationships in the relational schema is straightforward. References to the key attributes of one entity are captured by including a corresponding attribute in the other entity that participates in the relationship. All of the relationships in Figure 6.5 are 1:N relationships, which simplifies the process.
The REA model for the client billing and human resource process
38
Step 4 continued
One-to-many (1:N or N:1) relationships are implemented by including the primary key of the table on the one side of the relationship as an attribute in the table on the many side of the relationship
This is the situation we have for all the relationships in Figure 6.5: The Integrated REA Model for the Client Billing and Human Resources Process
The linking between these relationships in the schema are drawn in Figure 6.9
The recursive relationship with EMPLOYEE uses Supervisor_No identifies the correct EMPLOYEE as the supervisor
39
40
Step 4 continued
Many-to-many (M:N) relationships are implemented by creating a new relation whose primary key is a composite of the primary keys of the relations to be linked.
We dont have any M:N relationships in the current REA Model We would need a relationship between the EMPLOYEE and CLIENT entities, which would then be an M:N relationship. This creates problems because these tables (that have been normalized) cannot store multiple client numbers in a single EMPLOYEE tuple. Similarly, a single CLIENT tuple cannot store multiple employee numbers. In that situation, we would need to develop a M:N relation to link the EMPLOYEE and CLIENT relations as shown Figure 6.10
41
42
43
44
45
46
GSS use technology to solve the time and place dimension problems associated with group work Also known as GDSS or Group Decision Support Systems
47
Expert Systems: ES
An information system that emulates the problem solving techniques of human experts
48