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

24
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.

Databases and Data

Modeling for Accounting

Information Systems

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.

NormalizatiNormalizationon

• Flat filesFlat files are files with no sequence or order to them. are files with no sequence or order to them.• Flat files make it almost impossible to find a particular Flat files make it almost impossible to find a particular

record easily or use file data productively.record easily or use file data productively.• Normalization Normalization is a process of examining and arranging file is a process of examining and arranging file

data in a way that enables designers to avoid problems data in a way that enables designers to avoid problems when these files are used or modified later.when these files are used or modified later.

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.

Example: Un-normalized Parking Ticket Data Example: 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 5: 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.

Example:Example: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 6: 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 .

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

Example: Second Normal Example: Second Normal FormForm

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

StateState NumberNumber

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 8: 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 9: 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 10: 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, and modify database information more

efficiently.

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

structure of any particular database table.

Data Sets A,B,C,D,E,F

Database Management

System(DBMS)

Application Program 1

Application Program 3

Application Program 2

Users

Page 11: 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 WORKEWORKE

DD

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 12: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Database Management SystemsDatabase Management SystemsDatabases and Data Modeling

for Accounting Information Systems

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

Databases and Data Modeling for Accounting Information Systems

Database Management SystemsDatabase Management Systems

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

Database Management SystemsDatabase Management SystemsDatabases and Data Modeling

for Accounting Information Systems

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

Database Management SystemsDatabase Management SystemsDatabases 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.

User Views: Schemas and Subschemas

Databases and Data Modeling for Accounting Information

Systems

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

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

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

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

Page 17: 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 Sales Order Entry ApplicationOrder Entry Application– ACCOUNT-NUMBERACCOUNT-NUMBER– CUSTOMER-NAMECUSTOMER-NAME– CUSTOMER-ADDRESSCUSTOMER-ADDRESS– CREDIT-LIMITCREDIT-LIMIT– BALANCEBALANCE– CREDIT-TERMSCREDIT-TERMS

• Subschema for aSubschema for a Sales Sales Analysis ApplicationAnalysis 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 18: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Query Language (DML)Query Language (DML)Databases and Data Modeling

for Accounting Information Systems

•The data manipulation language (DML) enables users to perform tasks such as querying, changing records and deleting records.

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

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

Query Language (DML)Query Language (DML)

Databases and Data Modeling for Accounting Information Systems

Page 20: 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

EMPEMP##

EMP EMP NAMENAME

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 21: 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 JOINJOIN 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

JOB DEPT

11 11

22 22

33 11

44 22

EMP# EMP NAME

JOB DEPT

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 22: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

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

Databases and Data Modeling for Accounting Information Systems

Object-Oriented and Multimedia DatabasesObject-Oriented and Multimedia Databases

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

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

Data WarehouseData Warehouse•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.

•Advantages of data warehouses:Advantages 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 just Data are stored in several databases, not just one.one.

3.3.Data Warehouses span a longer time horizon Data Warehouses span a longer time horizon than the company’s transaction systems.than the company’s transaction 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 24: Databases and Data Modeling for Accounting Information Systems Databases and Data Modeling for Accounting Information Systems.

Thank youThank you

Databases and Data Modeling for Accounting Information

Systems