Chapter 3 Data Modeling Discussion Questions Almost every AIS AIS must organize and store data in in permanent files. This leads to the need for databases that help business and governmental users store, modify, extract, and distribute accounting data. The text discusses discusses seven specific reasons why databases are important to AISs: !" the fact that AIS databases usually store critical information, #" the large volume of data in some databases, which increases the importance of organizing data efficiently, efficiently, $" the complexity of modern database designs e.g., because of client%server networ&s, '" the need for privacy and security, security, (" the fact that most AIS databases contain irreplaceable data, )" the importance of accuracy, and *" Internet uses such as storing online customer transactions. The first section of the the chapter discusses each of these these reasons in greater detail. 3-1.
The hierarchy of data describes the fact that AISs store the data in a database in logical structure. The date hierarchy in ascending order is: is: data field + record + file + database Specific examples with vary by students. 3-2.
The data field in each record that uniuely distinguishes one record from another on a computer file is called the primary key. Typically,, the primary &ey is numeric, although key. Typically alphabetic or alphanumeric primary &eys are also possible. A primary &ey can be a simple simple number such as a customer account number, or a complicated value such as !" a composite number e.g., a ban& account number including branch and individual account number" or #" a large number with imbedded codes e.g., a credit-card number".
3-3.
AIS databases also use foreign record keys to lin& the records in one database table to the records in other tables. The presence of all these record &eys &eys may seem complicated, complicated, but their uses are vital to the efficient functioning of the databases used by AISs. ere are some examples of typical accounting information system files and the potential primary record &ey used for each:
3-4.
Computer File
Potential Primary Record Key
Accounts /eceivable 0aster 1ile 1ile 2ustomer account number Accounts 3ayable 0aster 1ile Supplier account number 4mployee 3ayroll 1ile 4mployee social security number 4mployee 3e 3ersonnel 1i 1ile 4mployee so social se security number 2hart of Accounts 1ile 5ournal category code 6eneral 7edger 1ile 6eneral 7edger account number 8udget 1ile 6eneral 7edger account number 3urchase 9rder 1ile Invoice number Inventory 1ile Inventory 3art number 2hec&-riting 1ile 2hec& number Transaction 1ile Account number and date
S0 $.!
The data in large, commercial databases pose special challenges for database designers and users. users. Some ma;or concerns are: !" data integrity: the reuirement that stored data are both complete and completely accurate #" transaction accuracy and completeness: the concern that any changes made to a database are performed properly and completely $" concurrency: ensuring that two users do not access and seuentially change the same database record at the same time '" security: the reuirement that database information be protected from external access and fraudulent manipulation. 3-5.
Specific examples will vary by students. The term 4A= is an acronym acronym for for example, information about inventories resources", cash sales events", and customers agents". The /4A model differs from traditional accounting systems in that /4A databases tend to store information about resources, events, or agents that do not immediately affect the financial statements of a company. Two Two examples of such information mentioned in the text are
?atabase cardinalities represent the relationships between database entities>for example, one-to-one, one-to-many, one-to-many, or many-to-many. many-to-many. In a payroll application, application, for example, a one-to-one relationship would be
3-7.
The entity-relationship entity-relationship (E-R) model is is a graphic tool for helping developers design databases. 9vals denote data attributes e.g., e.g., hourly pay rate", rectangles denote file entities e.g., an employee", diamonds denote relationships e.g., one-to-many", and straight lines denote data flows. 3-8.
Assuming that the records in the Salesperson table stores information about individual sales people e.g., name, employee number, office office phone number, etc." and that the records in the Sales table stores information about individual sales transactions e.g., date, amount, type of payment, salesperson number, etc.", the relationship between these two tables is one-to-many . This means that each salesperson salesperson could have many sales transactions, transactions, but each sales transaction could have, at most, one salesperson. To show the sales for each salesperson in any given month, you would need to create a relationship between them to lin& the file records in these two tables together. The use of foreign &eys would be sufficient to do this, and you would not need need to create an intermediate relationship table for this purpose. 3-9.
@ow suppose that more than one salesperson could ma&e a sale to the same customer. Then, the relationship between if challenging>topics in AIS. @ormalization is a process for ensuring that attributes are stored in the most appropriate tables and are non-redundant. The text describes the first first three levels of normalization: first normal form, form, second normal form, and third normal form. If databases are
3-10.
S0 $.#
not normalized, they can suffer from database anomalies such as the inability to add information to the database, the inability to delete data without deleting related information, and difficulty updating data.
Problems 3-11.
a" ?efi ?efini niti tion ons: s: !" Field : A set of characters that describe or define a person, event, or thing in the database, e.g., the employee number field in a payroll file". #" Record : A set of data fields about one file entity, e.g., the set of data fields that describe an employee in a payroll file". $" File: A collection of records about similar file entities, e.g., a collection of employee records in a payroll file". b" !" A data databas base e is a collec collectio tion n of data data files files that that are are share shared d by one or or more acco accounti unting ng applications. Typical Typical database files include files containing the accounting data themselves e.g., payroll information", as well as a set of auxiliary files such as uery files and index files that help manage this data. #" ?atabase advantages: a" 4limin 4liminate ates s or reduce reduces s data data redunda redundancy ncy b" /educes /educes data conflicts conflicts that that often result result from files files of duplicate duplicate informati information on c" 2entra 2entraliz lizes es file file info informa rmatio tion n d" Separates Separates file data data from the applicatio applications ns that use them, them, enabling enabling the application application to focus on its tas&s rather than the format of the data e" 4nables users to create convenient reports both at the the time they they first create a database as well as later as new needs dictate f" Availabili Availability ty of excelle excellent nt software software for for easily easily altering, altering, inuiri inuiring, ng, or reporti reporting ng file data data $" ?isa ?isadv dvan anta tage ges: s: a" Increases Increases wor& wor& of creating creating and maintaining maintaining databases databases b" Increases Increases coordinat coordination ion among the data data needs of several several department departments s reuiring, reuiring, or collecting, the data in the database c" Increases Increases the the need for for security security to to protect protect informati informational onal assets assets d" Increases Increases complex complexity ity of the systems systems that use use them them e" Incr Increa ease ses s cos costt ?ata items li&ely to be included in a cash table are: 2ash Account Account , Type Type of Account, 8an&, 8eginning 8alance, 8eginning 8alance ?ate. ?ate. As suggested by the underlining, the 2ash Account Account would be the primary &ey. &ey. 3-12.
The 2ash /eceipts table would include: 2ash /eceipt , B2ash Account C, ?ate /eceived, B4mployeeC, and Amount. Amount. 2ash /eceipt is a primary &ey, &ey, 2ash Account Account and 4mployee are foreign &eys. 3-13.
a" Teachers Teachers can teach zero to many courses, and each course is taught by one teacher. 2ourses can be taught many times or may not have even been taught. b" A surgery surgery involves one patient, one nurse, and one doctor. doctor. A patient can have zero to many surgeries. A doctor can perform zero to many surgeries. A nurse can perform zero to many surgeries. S0 $.$
3-14.
See following diagram:
3-15.
See following diagram:
3-16.
ere are some potential data fields for a 2ustomer Table: Table: Data field
Data t!e
"u##ested "i$e
2ustomer @umber 7ast @ame 1irst @ame Street Address 2ity State Abbreviation Eip 2ode 2redit 7imit
Text Text Text Text Text Text @umeric @umeric
' $D #D $D #D # ( or F digits" * long integer" S0 $.'
As shown here, it would be better to use separate fields for the customerGs first and last names. This will enable the system to search for a customer by either first or last name as separate items. 3-17.
2ustomer , customer name, customer address, customer phone 2hild , child name, Bcustomer C
@ote: primary &eys are underlined and foreign &eys are in B C. 3-18.
Student , student name, student address, student phone 2lass , class time, class room BStudentC, B2lassC, grade
@ote: primary &eys are underlined and foreign &eys are in B C. 3-19.
This problem is about the 8onadio 8ona dio 4lectrical Supplies company.
a. The basic differ differences ences between between a file-orient file-oriented ed system system and a database database management management system system ?80S" include: !" The file-orient file-oriented ed system system focuses focuses on individual individual applicatio applications, ns, each with with its own set of files files and with each file physically ph ysically separate from the other files #" In the database database managemen managementt system, system, the focus focus is on data data rather rather than on a particul particular ar application. This leads to data independence, data data standardization, one-time data-entry, data-entry, data security, and shared data ownership $" The records records in files typicall typically y are organized organized in only one way>for way>for example, example, seuential seuentially ly according to some &ey or chronologically. chronologically. The records in databases are typically typically normalized in at least third normal form '" 0ost files files are are local. local. 0ost databas databases es are more more centraliz centralized ed and accessed accessed by multiple multiple users b. Advantages Advantages of database database management management systems: systems: !" /educe /educed d data redunda redundancy ncy and incon inconsis sisten tencie cies s #" Ability to to expand data fields fields without affect affecting ing application application programsH programsH instead, instead, simple simple alterations are needed only in the ?80S $" Single Single data data entry entry and shar shared ed inform informati ation on '" ?ata accessibili accessibility ty increases increases the timeliness, timeliness, effective effectiveness, ness, and availability availability of informatio information n ?isadvantages of database management systems: !" Typically Typically more difficult to create create initially #" 0ore highly trained trained technical technical personnel personnel are are reuired reuired $" Increased Increased vulnerabili vulnerability ty as a common database database is highly highly integrated integrated A brea&down brea&down in hardware or software has a much more severe effect than in a system having separate files and applications." '" Audit trails trails being being somewhat somewhat obscured obscured as the result result of multipl multiple e users and and perhaps multiple copies of the same database c. The duties duties and respons responsibili ibilities ties of the the database database administ administrator rator include include:: !" ?esign ?esign and control of a firmGs firmGs database database This This responsibili responsibility ty includes includes ensuring ensuring application application independence and bac&-up and recovery procedures." #" ?efini ?efinitio tion n and control control of the data data dictio dictionary nary S0 $.(
$" Assignment Assignment of of user codes codes and and maintenance maintenance of of other other security security measures measures '" 2ontrol 2ontrol of all changes changes in data and and in programs programs that that use the database database
%ase &nalses 3-20.
%arl 'eers (nter!rises )*nderstandin# )*nderstandin # a +elational Database,
This case helps students understand what types of information might be stored in accounting databases, and reuires them to use this information to answer important accounting uestions. Answers to specific uestions: uestions: !. Sales data that are listed by inventory item number help inventory personnel identify both fast- and slow-moving items, items, trac& customers in the the event of recalls, and replenish stoc&. stoc&. If this information were listed by invoice number, it would provide the detailed invoice information needed to reconstruct the invoice amounts listed in the sales by invoice number records this would ma&e it a lot easier to answer uestion #". #. Invoice J-$ J-$ shows a sale to customer 2-(, or ?. 7und, Inc. ?etails of this sale, found in the the sales by inventory number records, are: tem
!uantity
Price
E"tension
I-! I-$ I-( To Total
! ) #
#,DDD !,DDD ',DDD
#,DDD ),DDD K,DDD !),DDD
$. Invoice J-# J-# shows that 5.3. 5.3. 2arpenter purchased L!D,DDD worth of euipment, but made a payment of only L!,))). Thus, this customer has opted to pay over six months. months. '. The uarterly sales amounts amounts for the sales staff are: a" LK*,)D LK*,)DD D for for salesp salespers erson on S-!D S-!D b" L#$,DD L#$,DDD D for for sale salespe sperso rson n S-! S-!! ! c" L*,#DD L*,#DD for salesp salespers erson on S-!# S-!# @ote that accounting personnel would have to ma&e additional computations based on information readily available in the databases" if sales commissions were only paid on the paid sales of customers instead of gross sales. (. The net accounts receivable amounts are: a" 2-! M D b" 2-# M L),) L),)KK KK c" 2-$ M L$(, L$(,DD DDD D d" 2-' M L#$ L#$,D ,DDD DD e" 2-( M D
S0 $.)
3-21 3-21..
art artin ins s "/oe "/oes s nc nc.. )Pla )Plann nnin in# # a Dat Datab abas ase e *sin *sin# # +(& +(& and and (-+ (-+ Dia Dia#r #ram ams, s,
!. The resources resources are cash cash and inventory inventory.. The events events are are sales orders, orders, shipping shipping goods, goods, and cash collections. The agents are customer, customer, sales personnel, shipping shipping cler&s, and billing cler&s. #. See See foll follow owin ing g diag diagra ram: m:
$. ?atabase ?atabase tables tables are: are: cash, cash, sales orders, orders, shipped shipped goods, goods, cash cash collections collections,, customers customers,, and employees. There should also be a table for the order%inventory and ship goods%inventory relationships as these are many-to-many relationships. An example of the data fields in the cash table includes: account number, cash type, beginning balance, and authorized personnel. Since no data is given in the assignment, assignment, table data will vary by student.
S0 $.*
3-22.
"ouder les and rane P )Data odelin# it/ +(&,
!. See See foll follow owin ing g diag diagra ram: m:
2.
9rder 6oods Table: 9rder , B4mployeeC, BJendorC, ?ate, 2omments /eceive 6oods Table: /eceipt , B4mployeeC, BJendorC, ?ate, 2omments 3ay for 6oods Table: 2ash 3ayment, Amount 3aid, ?ate, B4mployeeC, BAccountC 0erchandise Inventory Table: Table: Item, ?escription, Nnit 2ost, Sales 3rice, Ouantity on and 2ash Table: Account, Account Account Type, Type, 8an&, 2urrent 8alance 4mployee Table: 4mployee, 1irst @ame, 0iddle @ame, 7ast @ame, Address, 2ity, State, State, Eip 2ode, ?ate of 8irth, ?ate ired, 7ast ?ate of /eview Inventory%9rder Table: B9rderC, BItemC, Ouantity, O uantity, 3rice Inventory%/eceive Table: B/eceiptC, BItemC, Ouantity, 3rice 9rder%/eceive Table: S0 $.K
B9rderC, B/eceiptC, Ouantity /eceived /eceive%3ay Table: B/eceiptC, B2ash 3aymentC, Amount 3aid 3-23 -23.
"an ans "u!!li !lies )or )orma mali li$ $in# in# Data Data,,
The raw data is as follows: 3urchase 9rder @umber !#$'(
!#$')
2ustomer 3hone @umber
2ustomer 2ustomer Item Item ?ate @umber @ame @umber ?escription 2harles D!%D$% D!%D$%!# !# !#$-K# !#$-K#DF DF ?resser, *(#" '$$-K*$$ P$#)(( 8aseballs Inc. P$'(FK 1ootballs 8as&etball E$'(#$ oops 3atrice D!%D$%!# !#$-)*$$ SchmidtQs )*$" *K'-''(! PFK)*$ Softballs Sports P$'(FK 1ootballs SoccerP)*'($ balls
Nnit 2ost
Ouantity Nnit 9rdered
L$$.)F dozen
#D
L($.'( dozen
!D
L$'.F( each
#D
L$(.KF dozen
!D
L($.'( dozen
(
L'(.$) dozen
!D
!. The data can can be put in first first normal normal form by repeati repeating ng the purchase purchase order order information information as as shown below. The data are now in first first normal form because they can be stored in computer records. 3urchase 9rder @umber !#$'( !#$'( !#$'( !#$')
!#$')
!#$')
2ustomer ?ate
@umber
2ustomer Name
D!%D$%!# !#$-K#DF 2harles ?resser, Inc. 2harles D!%D$%!# !#$-K#DF ?resser, Inc. 2harles D!%D$%!# !#$-K#DF ?resser, Inc. 3atrice D!%D$%!# !#$-)*$$ SchmidtQs Sports 3atrice D!%D$%!# !#$-)*$$ SchmidtQs Sports 3atrice D!%D$%!# !#$-)*$$ SchmidtQs Sports
2ustomer 3hone @umber
Item
Item
Nnit
@umber ?escription 2ost
Ouantity Nnit
9rdered
*(#" '$$-K*$$ P$#)(( 8aseballs
L$$.)F dozen
#D
*(#" '$$-K*$$ P$'(FK 1ootballs
L($.'( dozen
!D
*(#" *(#" '$$'$$-K* K*$$ $$ E$'( E$'(#$ #$
8as&etball L$'.F( ea e ach oops
#D
)*$" *K'-''(! PFK)*$ Softballs
L$(.KF dozen
!D
)*$" *K *K'-''(! P$'(FK 1ootballs
L($.'( dozen
(
L'(.$) dozen
!D
)*$" )*$" *K'*K'-'' ''(! (! P)*' P)*'($ ($
S0 $.F
Soccerballs
#. To reorganize reorganize the data data in part ! into second normal normal form, form, it is necessary necessary to split the the file in two>a
(primary key)
2ustomer @umber !#$!#$-)* )*$$ $$ !#$!#$-K# K#DF DF
3hone 2ustomer @ame @umber 3atr 3atric ice e Sch Schmi midt dtQs Qs Spor Sports ts )*$ )*$"" *K' *K'-' -''( '(! ! 2har 2harle les s ?res ?resse serr, Inc. Inc. *(#" *(#" '$$'$$-K* K*$$ $$
rders ile primary &ey - both items" 3urchase 9rder @umber !#$'( !#$'( !#$'( !#$') !#$') !#$')
Item @umber P$#)(( P$'(FK E$'(#$ PFK)*$ P$'(FK P)*'($
It Item ?escription 8aseballs 1ootballs 8ball oops Softballs 1ootballs Soccerballs
Nnit 2ost L$$.)F L($.'( L$'.F( L$(.KF L($.'( L'(.$)
Nnit dozen dozen each dozen dozen dozen
Ouantity 9rdered #D !D #D !D ( !D
?ate D!%D$%!# D!%D$%!# D!%D$%!# D!%D$%!# D!%D$%!# D!%D$%!#
foreign &ey" 2ustomer @umber !#$-K#DF !#$-K#DF !#$-K#DF !#$-)*$$ !#$-)*$$ !#$-)*$$
$. The records records in the orders orders file file contain contain transitive transitive dependenc dependencies. ies. To put put these data data into third third normal form, we must create a new products file and a new 9rders file to eliminate these dependencies as follows: %ustomer ile 2ustomer
(primary key)
2ustomer @umber !#$-)*$$ *$$ !#$!#$-K# K#DF DF
2ustomer @ame 3atrice Sc SchmidtQs Sp Sport orts 2har 2harle les s ?res ?resse serr, Inc. Inc.
3hone @umber )*$" *$" *K *K'-' '-''(! *(#" *(#" '$$'$$-K* K*$$ $$
Purc/ase rders ile (primary key)
3urchase 9rder @umber !#$'( !#$')
(foreign key)
?ate D!%D$%!# D!%D$%!#
2ustomer @umber !#$-K#DF !#$-)*$$
S0 $.!D
rdered Products primary &ey - both items" Item
3urchase
Ouantity
@umber
9rder
9rdered
P$#)((
!#$'(
#D
P$'(FK
!#$'(
!D
P$'(FK
!#$')
(
P)*'($
!#$')
!D
PFK)*$
!#$')
!D
E$'(#$
!#$'(
#D
Product ile (primary key)
Item @umber P$#)((
Item ?escription 8aseballs
Nnit 2ost L$$.)F
Nnit dozen
P$'(FK P)*'($ PFK)*$ E$'(#$
1ootballs Soccerballs Softballs 8ball oops
L($.'( L'(.$) L$(.KF L$'.F(
dozen dozen dozen each
S0 $.!!