Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for...

33
Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems

Transcript of Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for...

Page 1: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Databases and Data

Modeling for Accounting

Information Systems

Databases and Data Modeling for Accounting Information

Systems

Page 2: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

An Overview of Databases

• A database is a large collection of related data that are stored in computerized and linked files

NotNot every collection of data is every collection of data is databasedatabase

Databases and Data Modeling for Accounting Information

Systems

Page 3: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

The importance of database to AISsThe importance of database to AISs

• Valuable information• Volume• Complexity• Privacy• Irreplaceable data• Internet users

Databases and Data Modeling for Accounting Information

Systems

Page 4: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Storing Data in Databases

• To be useful, the data in an organization’s databases must be stored and organized efficiently.

• Three important concepts are :1. Data hierarchyBit → character→ data field→ record→ file →database

2. Record structures3. Record keys

primary key Secondary key foreign key

Databases and Data Modeling for Accounting Information

Systems

Page 5: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

How to Create Databases With REA

The REA is a tool for designing databases. Using this model, an AIS captures data about

an organization’s resources, events and agents (REA).Resources are an organization’s assets.Events are identifiable activities associated with a

business processes.Agents are the people associated with business

activities.

Databases and Data Modeling for Accounting Information

Systems

Page 6: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

How to Create Databases With REA

REA models requires some steps :REA models requires some steps :1.1. Identify business and economic events .Identify business and economic events .

2.2. Identify entities Identify entities

3.3. Identify relationships among entities Identify relationships among entities

4.4. Create entity relationship diagramsCreate entity relationship diagrams

5.5. Identify the attributes of data entities Identify the attributes of data entities

6.6. Create database tables and validate the database Create database tables and validate the database

Databases and Data Modeling for Accounting Information

Systems

Page 7: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

How to Create Databases With REA

Economic events : Economic events : impact animpact an organization's organization's financial statements and are captured in financial statements and are captured in accounting transactions .accounting transactions .

Business events : Business events : do not affect financial do not affect financial statement but can impact an organization in a statement but can impact an organization in a value – added way .value – added way .

Database entities :Database entities : include business and include business and economic events economic events + + information about who and information about who and what was involved in those activities .what was involved in those activities .

Databases and Data Modeling for Accounting Information

Systems

Page 8: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Entity-Relationship

The cardinality of a relationship describes the number of occurrences of one entity that may be associated with a single occurrence of the other entity.

One-to-one (1:1) One-to-many or many-to-one (1:N), (N:1) None to one or none to many ( 0:1) , (0:N) Many-to-many (N:N)

Cardinalities provide useful information about the nature of the company being modeled and the business policies that it follows.

Databases and Data Modeling for Accounting Information

Systems

Page 9: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Entity-Relationship Diagrams An entity-relationship (ER) diagram

graphically depicts a database’s contents. ← ovals denote attribute

← connecting lines show relationship ←a rectangle depicts of entity the diamond ←describe

the relationship

Databases and Data Modeling for Accounting Information

Systems

Social Security number

Hourly pay

Rate

DateOfhire

Sales person

Is madeby Sales person Sale

Page 10: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Attributes of entities

Two guidelines we can use to decide what to Two guidelines we can use to decide what to include as attributes of an entities :include as attributes of an entities :

1.1. The attributes should describe one entity and that The attributes should describe one entity and that entity only .entity only .

2.2. To keep in mind that the attributes included in the To keep in mind that the attributes included in the tables will drive the outputs of the database system.tables will drive the outputs of the database system.

Databases and Data Modeling for Accounting Information

Systems

Page 11: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Create Database Records

• A particular method used to organize records in a database is called the database’s structure.

• The objective is to develop this structure efficiently so that data can be accessed quickly and easily.

• Three types of structures are:

1) hierarchical 2) network 3) relational.

Databases and Data Modeling for Accounting Information

Systems

Page 12: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Hierarchical Structures

Databases and Data Modeling for Accounting Information

Systems

• Accounting data are often organized in a hierarchy.

• A hierarchical structure has successive levels of data in an inverted treelike pattern, also known as tree structures.

• Higher level records are parent records and lower level records are child records.

• Two records on same level are sibling records.

Page 13: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Network Structures

Databases and Data Modeling for Accounting Information

Systems

• Databases can use a network

structure to link related records

together and capture many-to-many relationships.

• The linking is accomplished with pointer fields.

• The pointers maintain the data relationships.

Page 14: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Relational Structures

Databases and Data Modeling for Accounting Information

Systems

• Relational databases are more flexible.

• Users can define relationships at the time the database is created or at later points in time.

Page 15: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

NormalizationNormalization• Flat filesFlat files are files with no sequence or order to them, except perhaps are files with no sequence or order to them, except perhaps

chronological.chronological.• Flat files make it almost impossible to find a particular record easily or use file Flat files make it almost impossible to find a particular record easily or use file

data productively.data productively.• NormalizationNormalization is a process of examining and arranging file data in a way that is a process of examining and arranging file data in a way that

enables designers to avoid problems when these files are used or modified later.enables designers to avoid problems when these files are used or modified later.

Databases and Data Modeling for Accounting Information

Systems

Page 16: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Un-normalized Parking Ticket Data Un-normalized Parking Ticket Data (0 Normal Form)(0 Normal Form)

Databases and Data Modeling for Accounting Information

Systems

Social Social Security Security NumberNumber

Last Last NameName

First First NameName

Phone No.Phone No. LicenseLicense

StateState

LicenseLicense

NumberNumber

Ticket Ticket NoNo

DateDate CodeCode FineFine

123-56-7783123-56-7783 CurryCurry DorothyDorothy (916)3584448(916)3584448 CACA 123MCD123MCD 1015110151 10/15/9810/15/98 AA $10$10

1015210152 10/16/9810/16/98 BB $20$20

1012110121 11/12/9811/12/98 BB $20$20

134-56-7783134-56-7783 FongFong MayMay (916)5637865(916)5637865 CACA 253DAL253DAL 1023110231 10/23/9810/23/98 CC $50$50

1205112051 12/05/9812/05/98 AA $10$10

Page 17: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Databases and Data Modeling for Accounting Information Systems

First Normal FormFirst Normal Form

A database is in first normal form (1NF) if all the record’s attributes (data fields) are well defined and the information can thus be stored in a flat file.

Problems:

1. data redundancy

2. insertion anomaly

3. deletion anomaly

Page 18: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

First Normal FormFirst Normal Form

Databases and Data Modeling for Accounting Information

Systems

Social Social Security Security NumberNumber

Last Last NameName

First First NameName

Phone No.Phone No. LicenseLicense

StateState

LicenseLicense

NumberNumber

Ticket Ticket NoNo

DateDate CodeCode FineFine

123-56-7783123-56-7783 CurryCurry DorothyDorothy (916)358-4448(916)358-4448 CACA 123MCD123MCD 1015110151 10/15/9810/15/98 AA $10$10

123-56-7783123-56-7783 CurryCurry DorothyDorothy (916)358-4448(916)358-4448 CACA 123MCD123MCD 1015210152 10/16/9810/16/98 BB $20$20

123-56-7783123-56-7783 CurryCurry DorothyDorothy (916)358-4448(916)358-4448 CACA 123MCD123MCD 1012110121 11/12/9811/12/98 BB $20$20

134-56-7783134-56-7783 FongFong MayMay (916)563-7865(916)563-7865 CACA 253DAL253DAL 1023110231 10/23/9810/23/98 CC $50$50

134-56-7783134-56-7783 FongFong MayMay (916)563-7865(916)563-7865 CACA 253DAL253DAL 1205112051 12/05/9812/05/98 AA $10$10

Page 19: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Second Normal FormSecond Normal Form

Databases and Data Modeling for Accounting Information

Systems

* A database is in second normal form (2NF) if it is in first normal form and all the data items in each record depend on the record’s primary record key.

* This approach results in a more efficient design and eliminates much of

the first file’s data redundancy.

Page 20: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Second Normal FormSecond Normal Form

Databases and Data Modeling for Accounting Information

Systems

Car Registration Car Registration FileFile

Social Security Social Security NumberNumber

Last Last NameName

First First NameName

Phone No.Phone No. License PlateLicense Plate

State NumberState Number

123-56-7783123-56-7783 CurryCurry DorothyDorothy (916)358-4448(916)358-4448 CACA 123MCD123MCD

134-56-7783134-56-7783 FongFong MayMay (916)563-7865(916)563-7865 CACA 253DAL253DAL

.. .. .. .. .. ..

Ticket FileTicket File

Ticket No Ticket No DateDate CodeCode FineFine [License Plate] State Number[License Plate] State Number

1015110151 10/15/9810/15/98 AA $10$10 CACA 123MCD123MCD

1015210152 10/16/9810/16/98 BB $20$20 CACA 123MCD123MCD

1012110121 11/12/9811/12/98 BB $20$20 CACA 123MCD123MCD

1023110231 10/23/9810/23/98 CC $50$50 CACA 253DAL253DAL

1205112051 12/05/9812/05/98 AA $10$10 CACA 253DAL253DAL

Page 21: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Third Normal Form

Databases and Data Modeling for Accounting Information

Systems

Our goal is to create a database that is minimally in third normal form (3NF).

A database is in third normal form if it is in second normal form and contains no

transitive dependencies - i.e., no relationships in which data field A

determines data field B.

Page 22: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Third Normal Form

Databases and Data Modeling for Accounting Information

Systems

Car Registration File

Social Security Social Security NumberNumber

Last Last NameName

First First NameName

Phone No.Phone No. License PlateLicense Plate

State NumberState Number

123-56-7783 Curry Dorothy (916)358-4448 CA 123MCD

134-56-7783 Fong May (916)563-7865 CA 253DAL

. . . . . .

Ticket FileTicket File

Ticket

No

Date [Code] [License Plate]

State Number

1015110151 10/15/9810/15/98 AA CACA 123MCD123MCD

1015210152 10/16/9810/16/98 BB CACA 123MCD123MCD

1012110121 11/12/9811/12/98 BB CACA 123MCD123MCD

1023110231 10/23/9810/23/98 CC CACA 253DAL253DAL

1205112051 12/05/9812/05/98 AA CACA 253DAL253DAL

Violation Code Violation Code FileFileCodeCode FineFine ExplanationExplanation

AA $10$10 Meter expiredMeter expired

BB $20$20 Parking in no-Parking in no-parking zoneparking zone

CC $50$50 No parking stickerNo parking sticker

Page 23: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Database Management Database Management SystemsSystems

Databases and Data Modeling for Accounting Information

Systems

•A database management systems (DBMS) is a set of separate computer programs that enable users to create,

modify, and utilize database information more efficiently.

•The data definition language (DDL) of a DBMS enables users to define the record

structure of any particular database table.

•The data manipulation language (DML) enables users to perform tasks such as

querying, changing records and deleting records.

•Many relational databases support structured structured query language (SQL).query language (SQL).

Page 24: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

EMPEMP##

DEPTDEPT##

EMP EMP NAMENAME

JOB JOB CODECODE

JOB JOB TITLETITLE

LOCATIONLOCATION HOURS HOURS WORKEDWORKED

120120 0101 AbrielAbriel 11 AccountantAccountant New OrleansNew Orleans 3737

120120 0808 AbrialAbrial 11 AccountantAccountant Los AngelesLos Angeles 1212

121121 0101 BayerBayer 11 AccountantAccountant New OrleansNew Orleans 4545

121121 0808 BayerBayer 11 AccountantAccountant Los AngelesLos Angeles 2121

121121 1212 BayerBayer 11 AccountantAccountant New YorkNew York 107107

270270 0808 BoudreauxBoudreaux 22 SupervisorSupervisor Los AngelesLos Angeles 1010

270270 1212 BaudreauxBaudreaux 22 SupervisorSupervisor New YorkNew York 7878

273273 0101 WolbretteWolbrette 33 ManagerManager New OrleansNew Orleans 2222

274274 1212 ScanlonScanlon 22 SupervisorSupervisor New YorkNew York 4141

279279 0101 RichardsRichards 11 AccountantAccountant New OrleansNew Orleans 2727

279279 0808 RichardsRichards 11 AccountantAccountant Los AngelesLos Angeles 2020

279279 1212 RichardsRichards 11 AccountantAccountant New YorkNew York 5151

301301 0101 DalyDaly 11 AccountantAccountant New OrleansNew Orleans 1616

Data Normalization for Relational DBMSData Normalization for Relational DBMS

Databases and Data Modeling for Accounting Information Systems

Page 25: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

data manipulation language (DML)data manipulation language (DML)

Databases and Data Modeling for Accounting Information

Systems

• The totality of information in a database and The totality of information in a database and the relationships of its tables (records) is the relationships of its tables (records) is called the databasecalled the database schema.schema.

• The databaseThe database schemaschema is a map or plan of the is a map or plan of the entire database.entire database.

• Any particular user or application program will Any particular user or application program will be interested in only a subset of the schema, be interested in only a subset of the schema, called thecalled the subschemasubschema.

• A database must be flexible enough to satisfy A database must be flexible enough to satisfy the subschema uses required. the subschema uses required.

Page 26: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Example: Schemas and SubschemasExample: Schemas and Subschemas

• Schema for aSchema for a Customer RecordCustomer Record– ACCOUNT-NUMBERACCOUNT-NUMBER– CUSTOMER-NAMECUSTOMER-NAME– CUSTOMER CUSTOMER

ADDRESSADDRESS– SALES-DIVISIONSALES-DIVISION– CREDIT-LIMITCREDIT-LIMIT– BALANCEBALANCE– CREDIT-TERMSCREDIT-TERMS– TOT-YEARS-SALETOT-YEARS-SALE– DATE-RECENT-SALEDATE-RECENT-SALE

• Subschema for aSubschema for a Sales Order Entry Application– ACCOUNT-NUMBERACCOUNT-NUMBER– CUSTOMER-NAMECUSTOMER-NAME– CUSTOMER-ADDRESSCUSTOMER-ADDRESS– CREDIT-LIMITCREDIT-LIMIT– BALANCEBALANCE– CREDIT-TERMSCREDIT-TERMS

• Subschema for aSubschema for a Sales Analysis Application– ACCOUNT-NUMBERACCOUNT-NUMBER– CUSTOMER-NAMECUSTOMER-NAME– CUSTOMER-ADDRESSCUSTOMER-ADDRESS– SALES-DIVISIONSALES-DIVISION– TOT-YEARS-SALESTOT-YEARS-SALES

Databases and Data Modeling for Accounting Information Systems

Page 27: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Databases and Data Modeling for Accounting Information Systems

TheThe SELECTSELECT OperationOperationQuery language commend: Query language commend: SELECT ABBOTT OF SELECT ABBOTT OF EMPLOYEE DISPLAY EMP EMPLOYEE DISPLAY EMP NAME AND JOBNAME AND JOB

EMP#EMP# EMP NAMEEMP NAME JOBJOB

1111 Smith, A.Smith, A. 44

1414 Garcia, B.Garcia, B. 22

2727 Wong, C.Wong, C. 33

2929 Riley,D.Riley,D. 44

3333 O’Hara, E.O’Hara, E. 11

3636 Weiss, F.Weiss, F. 11

4141 Abbott, G.Abbott, G. 33

4545 Powski, H.Powski, H. 44

SELECT

Display: Display: EMP NAMEEMP NAME JOBJOB

Abbott,G. 3Abbott,G. 3

The PROJECT OperationQuery language commend: PROJECT EMP NO AND PAY RATE OF PAY-RATE

EMPEMP##

HIRE HIRE

DATDATAA

PAY PAY

RATRATEE

1111 19X919X9 10.0010.00

1414 19X819X8 10.0010.00

2727 19X919X9 10.0010.00

2929 19X819X8 10.0010.00

3333 19X919X9 20.0020.00

3636 19X819X8 20.0020.00

4141 19X919X9 20.0020.00

4545 19X819X8 20.0020.00

EMP#EMP#

PAYPAY

RATERATE

1111 10.0010.00

1414 10.0010.00

2727 10.0010.00

2929 10.0010.00

3333 20.0020.00

3636 20.0020.00

4141 20.0020.00

4545 20.0020.00

Operate Relational Database Operate Relational Database Using Query Language (DML)Using Query Language (DML)

PROJECTPROJECT

Page 28: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Operate Relational Database Operate Relational Database Using Query Language (DML)Using Query Language (DML)

The The JOIN JOIN OperationOperationQuery language Query language commend: JOIN commend: JOIN EMPLOYEE WITH EMPLOYEE WITH JOB/DEPT DISPLAY JOB/DEPT DISPLAY DEPT AND NAMEDEPT AND NAME

EMP#EMP# EMP NAMEEMP NAME JOBJOB

11 Smith, A. 4

14 Garcia, B. 2

27 Wong, C. 3

29 Riley,D. 4

33 O’Hara, E. 1

36 Weiss, F. 1

41 Abbott, G. 3

45 Powski, H. 4

JOBJOB DEPTDEPT

11 11

22 22

33 11

44 22

EMP#EMP# EMP EMP NAMENAME

JOBJOB DEPTDEPT

1111 Smith, A.Smith, A. 44 22

1414 Garcia, B.Garcia, B. 22 22

2727 Wong, C.Wong, C. 33 11

2929 Riley,D.Riley,D. 44 22

3333 O’Hara, E.O’Hara, E. 11 11

3636 Weiss, F.Weiss, F. 11 11

4141 Abbott, G.Abbott, G. 33 11

4545 Powski, H.Powski, H. 44 22

JOINJOIN

Databases and Data Modeling for Accounting Information Systems

Page 29: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Online Analytical Processing•Complex multidimensional data Complex multidimensional data analysis performed on database analysis performed on database information is calledinformation is called online online analytical processing (OLAP).analytical processing (OLAP).

•OLAP packages allow end users OLAP packages allow end users to perform their own database to perform their own database analysis, including data mining.analysis, including data mining.

Databases and Data Modeling for Accounting Information Systems

Page 30: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Object-Oriented and Multimedia DatabasesObject-Oriented and Multimedia Databases

* The* The object-oriented database (OODB)object-oriented database (OODB) is is a type of database that contains both a type of database that contains both the text data of traditional databases, the text data of traditional databases, plus information about the set of actions plus information about the set of actions that can be taken on the data fields.that can be taken on the data fields.

* Most OODBs are* Most OODBs are multimedia databasesmultimedia databases that can include graphics, audio that can include graphics, audio information and animation.information and animation.

Databases and Data Modeling for Accounting Information Systems

Page 31: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Characteristics of a Data Characteristics of a Data WarehouseWarehouse•AA data warehousedata warehouse pools data from separate pools data from separate

applications into a large common body of applications into a large common body of information. information.

Characteristics of data warehousesCharacteristics of data warehouses

1.1.Data are “clean” of errors and defined Data are “clean” of errors and defined uniformly.uniformly.

2.2.Data are stored in several databases, not Data are stored in several databases, not just one.just one.

3.3.Data Warehouses span a longer time Data Warehouses span a longer time horizon than the company’s transaction horizon than the company’s transaction systems.systems.

4.4.The data relations are optimized for The data relations are optimized for answering complex questionsanswering complex questions.

Databases and Data Modeling for Accounting Information Systems

Page 32: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

* Data are “clean” of errors and defined uniformly.

* Data are stored in several databases, not just one.

* Data Warehouses span a longer time horizon than the company’s transaction systems.

* The data relations are optimized for answering complex questions.

* Make organizational information available on a corporate-wide basis.

* Facilitates data mining and enables users to identify

target markets or its most desirable customers.

Advantages of Data WarehouseAdvantages of Data Warehouse

Databases and Data Modeling for Accounting Information Systems

Page 33: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

PREPEARED BY :EMAN AL AQEELPREPEARED BY :EMAN AL AQEEL

Databases and Data Modeling for Accounting Information

Systems