AIS e12 CH04

Embed Size (px)

Citation preview

  • 8/19/2019 AIS e12 CH04

    1/67

    CHAPTER 4

    RELATIONAL DATABASES

    SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

    4.1 Contrast the lo!"al an# the $h%s!"al &!e' o( #ata an# #!s")ss 'h% se$arate &!e's are

    ne"essar% !n #ata*ase a$$l!"at!ons. Des"r!*e 'h!"h $ers$e"t!&e !s +ost )se()l (or ea"h o( the(ollo'!n e+$lo%ees, a $rora++er- a +anaer- an# an !nternal a)#!tor. Ho' '!ll

    )n#erstan#!n lo!"al #ata str)"t)res ass!st %o) 'hen #es!n!n an# )s!n #ata*ase s%ste+s

    Databases are possible because of their database management system (DBMS). As shown in Figure4.! the DBMS is a software program that sits between the actual data stored in the system and theapplication programs that use the data. As shown in Figure 4.4! this allows users to separate theway they "iew the data (called the logical "iew) from the way the data is actually stored (the physical "iew). #he DBMS interprets the users$ re%uests and retrie"es! manipulates! or stores thedata as needed. #he two distinct "iews separate the applications from the physical information! pro"iding increased fle&ibility in applications! impro"ed data security! and ease of use.

    'n a database system! the manager will rarely need to understand or be familiar with the physical"iew of the data. or! in most instances! will the internal auditor and the programmer as moste"erything they do in"ol"es the logical "iew of the data.

    'f accountants understand logical data structures and the logical "iew of the data! they are betterable to manage! use! and audit a database and its data.

    4./ The relat!onal #ata +o#el re$resents #ata as *e!n store# !n ta*les. S$rea#sheets are another

    tool that a""o)ntants )se to e+$lo% a ta*)lar re$resentat!on o( #ata. What are so+e

    s!+!lar!t!es an# #!((eren"es !n the 'a% these tools )se ta*les Ho' +!ht an a""o)ntant0s

    (a+!l!ar!t% '!th the ta*)lar re$resentat!on o( s$rea#sheets (a"!l!tate or h!n#er learn!n ho' to

    )se a relat!onal DBS

    A maor difference between spreadsheets and databases is that spreadsheets are designed primarilyto handle numeric data! whereas databases can handle both te&t and numbers. *onse%uently! the%uery and sorting capabilities of spreadsheets are much more limited than what can beaccomplished with a DBMS that has a good %uery language.

    Accountants+ familiarity with spreadsheets might hinder their ability to design and use relationalDBMS because many lin,s in spreadsheets are preprogrammed and designed in! whereas a well-designed relational database is designed to facilitate ad-hoc %ueries.

    Accountants+ familiarity with spreadsheets sometimes leads them to use a spreadsheet for a tas,

    that a database could handle much better. "er the years! the /ournal of Accountancy has publisheda number of "ery good articles on how to use databases and when to use databases and when to usespreadsheets. #hese articles can be found on the /ournal+s website0http011www.ournalofaccountancy.com1

    http://www.journalofaccountancy.com/http://www.journalofaccountancy.com/

  • 8/19/2019 AIS e12 CH04

    2/67

    Accounting Information Systems

    4.2 So+e $eo$le *el!e&e #ata*ase te"hnolo% +a% el!+!nate the nee# (or #o)*le3entr% a""o)nt!n.

    Th!s "reates three $oss!*!l!t!es, 15 the #o)*le3entr% +o#el '!ll *e a*an#one#6 /5 the #o)*le3

    entr% +o#el '!ll not *e )se# #!re"tl%- *)t an e7ternal3le&el s"he+a *ase# on the #o)*le3entr%

    +o#el '!ll *e #e(!ne# (or a""o)ntants0 )se6 or 25 the #o)*le3entr% +o#el '!ll *e reta!ne# !n

    #ata*ase s%ste+s. Wh!"h alternat!&e #o %o) th!n8 !s +ost l!8el% to o"")r Wh%

    #here is no correct answer to this %uestion because it is as,ing the student to e&press his opinion onwhat will happen in the future. #herefore! the %uality of his answer depends on the ustifications pro"ided. 2ood answers should address the following0

    • Database technology does permit abandonment of double entry! but there will li,ely be great

    resistance to such a radical change. #hus! students choosing this option need to presentreasons why they thin, such a radical change would succeed.

    • #he use of a schema for accountants seems %uite plausible. 't does eliminate the redundancy

    of double entry from the database system! yet it still pro"ides a framewor, familiar and useful

    to accountants and financial analysts.

    • #here is a good possibility that double entry will remain! e"en in databases! due to inertia.

    'ndeed! many modern A'S! such as 35 systems! use databases but also retain the principlesof double entry.

    4.4 Relat!onal DBS 9)er% lan)aes $ro&!#e eas% a""ess to !n(or+at!on a*o)t the

    oran!:at!on0s a"t!&!t!es. Does th!s +ean that onl!ne- real3t!+e $ro"ess!n sho)l# *e )se# (or

    all transa"t!ons Does an oran!:at!on nee# real3t!+e (!nan"!al re$orts Wh% or 'h% not

    n-line real-time processing is not necessary for e"ery business transaction. For e&ample! batch processing is ade%uate for payroll0 there is little need for the data to be current e&cept on payday.

    eal-time financial statements are useful for planning and pro"ide management with better abilityto react to changes in the en"ironment. e"ertheless! real-time financial statements may presentdistorted pictures of reality if accruals ha"e been ignored or not properly recogni6ed.

    4-

  • 8/19/2019 AIS e12 CH04

    3/67

    Accounting Information Systems

    4.;  Wh% !s !t so !+$ortant to ha&e oo# #ata

    Bad data costs businesses o"er 7899 billion a year. Some people estimate that o"er :; of business data is inaccurate or incomplete. 'n addition! incorrect database data can lead to baddecisions! embarrassment! and angry users. #he te&t illustrated this with the followinge&amples0

    • For %uite some time! a company sent half its catalogs to incorrect addresses. A manager

    finally in"estigated the large "olume of returns and customer complaints and corrected thecustomer addresses in the database.

  • 8/19/2019 AIS e12 CH04

    4/67

    Accounting Information Systems

    4.< What !s a #ata #!"t!onar%- 'hat #oes !t "onta!n- an# ho' !s !t )se#

    A data dictionary contains information about the structure of the database. #able 4-= shows thatthere is a record in the dictionary describing each data element. #he DBMS maintains the datadictionary! whose inputs include new or deleted data elements and changes in data elementnames! descriptions! or uses. utputs include reports for programmers! designers! and users.#hese reports are used for system documentation! database design and implementation! and as part of the audit trail.

    4

  • 8/19/2019 AIS e12 CH04

    5/67

    Accounting Information Systems

     

    4.=  Co+$are an# "ontrast the (!le3or!ente# a$$roa"h an# the #ata*ase a$$roa"h. E7$la!n the+a!n a#&antaes o( #ata*ase s%ste+s.

    'nformation about the attributes of a customer! such as name and address! are stored in fields.Fields contain data about one entity (e.g.! one customer). Multiple fields form a record. A set ofrelated records! such as all customer records! forms a file (e.g.! the customer file). A set ofinterrelated! centrally coordinated files forms a database.

    Figure 4- illustrates the differences between file-oriented and database systems. 'n the databaseapproach! data is an organi6ational resource that is used by and managed for the entire organi6ation!not ust the originating department. A database management system (DBMS) is the interface between the database and the "arious application programs. #he database! the DBMS! and theapplication programs that access the database through the DBMS are referred to as the databasesystem.

    Database systems were de"eloped to address the proliferation of master files. #his proliferationcreated problems such as the same data stored in two or more master files. #his made it difficult tointegrate and update data and to obtain an organi6ation-wide "iew of data. 't also created problems because the data in the different files was inconsistent.

    Databases pro"ide organi6ations with the following benefits0

    • Data !nterat!on. Master files are combined into large poolsC of data that many application

     programs access. An e&ample is an employee database that consolidates payroll! personnel! and ob s,ills master files.

    • Data shar!n. 'ntegrated data is more easily shared with authori6ed users. Databases are easily

     browsed to research a problem or obtain detailed information underlying a report. #he FB'!which does a good ob of collecting data but a poor ob of sharing it! is spending eight years and

    7499 million to integrate data from their different systems.• !n!+al #ata re#)n#an"% an# #ata !n"ons!sten"!es. Because data items are usually stored

    only once! data redundancy and data inconsistencies are minimi6ed.

    • Data !n#e$en#en"e. Because data and the programs that use them are independent of each

    other! each can be changed without changing the other. #his facilitates programming andsimplifies data management.

    • Cross3()n"t!onal anal%s!s. 'n a database system! relationships! such as the association between

    selling costs and promotional campaigns! can be e&plicitly defined and used in the preparationof management reports.

    4-5

  • 8/19/2019 AIS e12 CH04

    6/67

    *h. 40 elational Databases

    SUGGESTED ANSWERS TO THE PROBLES

    4.1

    a. I#ent!(% three $otent!al )sers an# #es!n a s)*s"he+a (or ea"h. >)st!(% %o)r #es!n *%

    e7$la!n!n 'h% ea"h )ser nee#s a""ess to the s)*s"he+a #ata ele+ents.

    • #o fill out a sales order! the sales order entry cler, needs access to the following data0

    − item number 

    − description

    − %uantity-on-hand

    −  price

    − customer name

    − shipping address

    − credit limit

    − account balance

    • #o create and mail a bill (in"oice)! the billing cler, needs access to the following data

    stored in the database0

    − customer name

    − customer number 

    −  billing address

    − item numbers

    − %uantity sold

    −  price

    − terms

    • #o manage in"entory! the in"entory control department needs access to the following datastored in the database0

    − item number 

    − description

    − %uantity on hand

    • #o purchase in"entory! the purchasing department needs access to the following data

    stored in the data base0

    4-6

  • 8/19/2019 AIS e12 CH04

    7/67

    Accounting Information Systems

     − item number 

    − description

    − %uantity on hand

    −  cost

    4-7

  • 8/19/2019 AIS e12 CH04

    8/67

    *h. 40 elational Databases

    −  b. Use !"roso(t A""ess or so+e other relat!onal #ata*ase $ro#)"t to "reate the

    s"he+a ta*les. S$e"!(% the $r!+ar% 8e%s5- (ore!n 8e%s5- an# other #ata (or ea"h ta*le.

    Test %o)r +o#el *% enter!n sa+$le #ata !n ea"h ta*le.

     

    O

    t

    h

    e

    r

     

    A

    t

    t

    r

    !

    *

    )

    t

    e

    s

    − − − − *

    ost

     (s

    tandar d

     

    or 

     

    l

    ist)

    − D

    escr 

    4-8

  • 8/19/2019 AIS e12 CH04

    9/67

    Accounting Information Systems

     i pti

    on

    uantity

     

    o

    <and

    − 5

    r ice

     (standar d

     

    o

    r  

    list)

    − − −

    *

    − D

    a

    4-9

  • 8/19/2019 AIS e12 CH04

    10/67

    *h. 40 elational Databases

    te

     

    o

    f  

    sale

    − #

    er ms

    − −

    − −

    uantity

     sold

    − 5

    r ice

     

    (actu

    al

     sales

     

    4-10

  • 8/19/2019 AIS e12 CH04

    11/67

    Accounting Information Systems

      pr ic

    e)

    − − − − *

    ustomer 

     

    n

    ame

    − S

    hi p ping

     

    addr ess

    − B

    ill

    ing

     

    addr e

    4-11

  • 8/19/2019 AIS e12 CH04

    12/67

    *h. 40 elational Databases

    ss

    − *

    edit

     

    Eimit

    − A

    ccount

     

    Balance

    4-12

  • 8/19/2019 AIS e12 CH04

    13/67

    Accounting Information Systems

     4./ ost DBS $a"8aes "onta!n #ata #e(!n!t!on- #ata +an!$)lat!on- an# #ata 9)er%

    lan)aes. ?or ea"h o( the (ollo'!n- !n#!"ate 'h!"h lan)ae 'o)l# *e )se# an# 'h%.

    1. A #ata*ase a#+!n!strator #e(!nes the lo!"al str)"t)re o( the #ata*ase

    − #he DDE - this is the language used to define the database.

     

     b. The "ontroller re9)ests a "ost a""o)nt!n re$ort "onta!n!n a l!st o( all e+$lo%ees

    *e!n $a!# (or +ore than 1@ ho)rs o&ert!+e !n a !&en 'ee8.

    − #he DE - this is an e&ample of a %uery.

     

    c. A $rora++er #e&elo$s a $rora+ to )$#ate the (!7e#3assets re"or#s store# !n the

    #ata*ase.

    − #he DME - this is the language used to actually process transaction data and update the

    database.

     

    d. The h)+an reso)r"es +anaer re9)ests a re$ort not!n all e+$lo%ees 'ho are

    ret!r!n '!th!n (!&e %ears.

    − #he DE - another e&ample of a tas, that in"ol"es %uerying the database.

     

    e. The !n&entor% ser!al n)+*er (!el# !s e7ten#e# !n the !n&entor% re"or#s to allo' (or

    re"on!t!on o( a##!t!onal !n&entor% !te+s '!th ser!al n)+*ers "onta!n!n +ore than 1@

    #!!ts.

    − #he DDE and the DME - the former to alter the structure! the latter to ma,e the change.

     

    f. A )ser #e&elo$s a $rora+ to $r!nt o)t all $)r"hases +a#e #)r!n the $ast t'o

    'ee8s.

    − #he DE this listing can be produced by a %uery.

     

    g. An a##!t!onal (!el# !s a##e# to the (!7e#3asset re"or#s to re"or# the est!+ate#

    sal&ae &al)e o( ea"h asset.

    − #he DDE and the DME - the former to add the field! the latter to enter data in it.

    4-13

  • 8/19/2019 AIS e12 CH04

    14/67

    *h. 40 elational Databases

     

    4.2 Ashton 'ants to store the (ollo'!n #ata a*o)t SS0s $)r"hases o(

    !n&entor%,

     

    !te+ n)+*er #ate o( $)r"hase

     

    &en#or n)+*er &en#or a##ress

     

    &en#or na+e $)r"hase $r!"e

     

    9)ant!t% $)r"hase# e+$lo%ee n)+*er

     

    e+$lo%ee na+e $)r"hase or#er n)+*er

     

    #es"r!$t!on 9)ant!t% on han#

     

    e7ten#e# a+o)nt total a+o)nt o( $)r"hase

    a. Des!n a set o( relat!onal ta*les to store th!s #ata. Do all o( the #ata !te+s nee# to *e

    store# !n a ta*le I( not- 'h!"h ones #o not nee# to *e store# an# 'h% #o the% not

    nee# to *e store#

    *. I#ent!(% the $r!+ar% 8e% (or ea"h ta*le.

    ". I#ent!(% the (ore!n 8e%s nee#e# !n the ta*les to !+$le+ent re(erent!al !nter!t%.−

     

    T

     

    P

    r

    !

    +

    a

    r

    %

     

     

    e

    %

     

    ?

     

    O

    t

    h

    e

    r

    A

    t

    t

    r

    !

    *

    )

    t

    e

    s

    '

    − '

    tem

     

     

    um ber 

    − − D

    escri p

    tion

    uantit

    4-14

  • 8/19/2019 AIS e12 CH04

    15/67

    Accounting Information Systems

     yon<

    and

    5

    − 5

    ur chase

     

    or der 

     

    num ber 

    >

    5

    − D

    ateof pur 

    chase

    − #

    otalam

    ountof pur cha

    se

    5

    − '

    tem

     

    n

    − −

    uantit

    4-15

  • 8/19/2019 AIS e12 CH04

    16/67

    *h. 40 elational Databases

    um be

    r − 5

    ur chase

     or 

    der 

     

    num ber 

    y pur 

    chased

    − G

    nitcos

    t(actual)

    − 3

    &te

    ndedamount

    >

    − >

    endor 

     

    num

    − − >

    endorname

    4-16

  • 8/19/2019 AIS e12 CH04

    17/67

    Accounting Information Systems

      ber 

    − >

    end

    oraddr ess

    3

    − 3

    m ployee

     num ber 

     

    − − 3

    m ployeename

    −  Extended amount  and Total amount of purchase do not ha"e to be stored in the database as

    they can be calculated from other "alues.  Extended amount  is Quantity purchased  & Unit cost .Total amount of purchase is the sum of all the e&tended amounts for all items on a particular purchase order!

    #. I+$le+ent %o)r ta*les )s!n an% relat!onal #ata*ase $ro#)"t to 'h!"h %o) ha&e

    a""ess.

    e. Test %o)r s$e"!(!"at!on *% enter!n sa+$le #ata !n ea"h ta*le.

    (. Create a (e' 9)er!es to retr!e&e or anal%:e the #ata %o) store#.

    − #here is no solution to parts d through f as students will select different software pac,ages

    and come up with different %ueries.

    4-17

  • 8/19/2019 AIS e12 CH04

    18/67

    *h. 40 elational Databases

     

    4.4 Retr!e&e the SS In3Cha$ter Data*ase !n !"roso(t A""ess (or+at5 (ro+

    the te7t0s We* s!te or "reate the ta*les !n Ta*le 43; !n a relat!onal DBS $ro#)"t5. Wr!te

    9)er!es to ans'er the (ollo'!n 9)est!ons.  Note, ?or so+e 9)est!ons- %o) +a% ha&e to "reate

    t'o 9)er!esone to "al")late an !n&o!"e total an# the se"on# to ans'er the 9)est!on as8e#.

    − Answers depend upon the specific DBMS and %uery language used.

  • 8/19/2019 AIS e12 CH04

    19/67

    Accounting Information Systems

     −

    4-19

  • 8/19/2019 AIS e12 CH04

    20/67

    *h. 40 elational Databases

    *. Ho' +an% sales 'ere +a#e #)r!n O"to*er

    − uery

    − uery esult

    4-20

  • 8/19/2019 AIS e12 CH04

    21/67

    Accounting Information Systems

     −

    . What 'ere total sales !n O"to*er

    uery

    uery esult

    4-21

  • 8/19/2019 AIS e12 CH04

    22/67

    *h. 40 elational Databases

    d. What 'as the a&erae a+o)nt o( a sales transa"t!on

    − #his %uestion re%uires the use of a total in"oice calculation! thus! a total in"oice table is

     prepared as a Microsoft Ma,e #able ueryC in Microsoft ffice. A Ma,e #able uery is preparedthe same as a normal %uery e&cept that the user selects the Ma,e #able uery option in the uery#ype portion of the uery Design #ools ribbon.

    Ma,e #able uery

    #able esult

    4-22

  • 8/19/2019 AIS e12 CH04

    23/67

    Accounting Information Systems

     

    uery

    4-23

  • 8/19/2019 AIS e12 CH04

    24/67

    *h. 40 elational Databases

    uery esult

     

    e. Wh!"h sales$erson +a#e the larest sale

    − Ma,e #able uery

    4-24

  • 8/19/2019 AIS e12 CH04

    25/67

    Accounting Information Systems

     −

    − uery esult

    4-25

  • 8/19/2019 AIS e12 CH04

    26/67

    *h. 40 elational Databases

    − uery

    − uery esult

    4-26

  • 8/19/2019 AIS e12 CH04

    27/67

    Accounting Information Systems

     (. Ho' +an% )n!ts o( ea"h $ro#)"t 'ere sol#

    − uery

    − uery esult

    4-27

  • 8/19/2019 AIS e12 CH04

    28/67

    *h. 40 elational Databases

     

    . Wh!"h $ro#)"t 'as sol# +ost (re9)entl%

    uery

     

    uery esult

     

    4-28

  • 8/19/2019 AIS e12 CH04

    29/67

    Accounting Information Systems

     4.;

     

    Enter the ta*les !n Ta*le 431; !nto a relat!onal DBS $a"8ae. Wr!te

    9)er!es to ans'er the (ollo'!n 9)est!ons.  Note, ?or so+e 9)est!ons- %o) +a% ha&e to "reate

    t'o 9)er!esone to "al")late a total an# the se"on# to ans'er the 9)est!on as8e#.

    − Answers depend upon the specific DBMS and %uery language used.

  • 8/19/2019 AIS e12 CH04

    30/67

    *h. 40 elational Databases

    *. Who has the larest "re#!t l!+!t

    − uery

    − uery esult

    4-30

  • 8/19/2019 AIS e12 CH04

    31/67

    Accounting Information Systems

     −

    4-31

  • 8/19/2019 AIS e12 CH04

    32/67

    *h. 40 elational Databases

    − ". Ho' +an% sales 'ere +a#e !n O"to*er

    − uery

    − uery esult

    4-32

  • 8/19/2019 AIS e12 CH04

    33/67

    Accounting Information Systems

     −

    4-33

  • 8/19/2019 AIS e12 CH04

    34/67

    *h. 40 elational Databases

     

    #. What 'ere the !te+ n)+*ers- $r!"e- an# 9)ant!t% o( ea"h !te+ sol# on !n&o!"e

    n)+*er 1@2

    − uery

    − uery esult

    4-34

  • 8/19/2019 AIS e12 CH04

    35/67

    Accounting Information Systems

     − e. Ho' +)"h #!# ea"h sales$erson sell

    − uery

    − uery esult

    4-35

  • 8/19/2019 AIS e12 CH04

    36/67

    *h. 40 elational Databases

    (. Ho' +an% ")sto+ers l!&e !n Ar!:ona

    − uery

    − uery esult

    4-36

  • 8/19/2019 AIS e12 CH04

    37/67

    Accounting Information Systems

     . Ho' +)"h "re#!t #oes ea"h ")sto+er st!ll ha&e a&a!la*le

    − uestions g and i re%uire the use of a total customer sales calculationH thus! a customer total

    sales table is prepared as a Microsoft Ma,e #able ueryC in Microsoft ffice. A Ma,e #able

    uery is prepared the same as a normal %uery e&cept that the user selects the Ma,e #able ueryoption under the uery Design menu tab.

    − Ma,e-#able uery

    −  

    − #able esult

    −  

    4-37

  • 8/19/2019 AIS e12 CH04

    38/67

    *h. 40 elational Databases

    − uery

    −  

    − uery esult

    −  

     

    NOTE, The a*o&e 9)er% onl% !n"l)#es ")sto+ers that ha&e a"t)all%

    $)r"hase# !te+s. There are ")sto+ers !n the #ata*ase 'ho ha&e not

    $)r"hase# !te+s an# "onse9)entl% 'ere not !n"l)#e# !n the 9)er% res)lts.

    4-38

  • 8/19/2019 AIS e12 CH04

    39/67

    Accounting Information Systems

     h. Ho' +)"h o( ea"h !te+ 'as sol# In"l)#e the #es"r!$t!on o( ea"h !te+ !n %o)r ans'er.5

    − uery

    − uery esult

    4-39

  • 8/19/2019 AIS e12 CH04

    40/67

    *h. 40 elational Databases

    !. Wh!"h ")sto+ers st!ll ha&e +ore than 1-@@@ !n a&a!la*le "re#!t

    − uery

    uery esult

    4-40

  • 8/19/2019 AIS e12 CH04

    41/67

    Accounting Information Systems

      . ?or 'h!"h !te+s are there at least 1@@ )n!ts on han#

    uery

    uery esult

     

    4-41

  • 8/19/2019 AIS e12 CH04

    42/67

    *h. 40 elational Databases

     

    4.< The B)s%B Co+$an% 'ants to store #ata a*o)t e+$lo%ee s8!lls.

    Ea"h e+$lo%ee +a% $ossess one or +ore s$e"!(!" s8!lls an# se&eral e+$lo%ees +a% ha&e the

    sa+e s8!ll. In"l)#e the (ollo'!n (a"ts !n the #ata*ase,

     

    #ate

    h!re# 

    #ate

    o( *!rth

     

    #ate

    s8!ll a"9)!re# 

    e+$l

    o%ee na+e

     

    e+$l

    o%ee n)+*er 

    $a%

    rate

    a. Des!n a set o( relat!onal ta*les to store these #ata.

     

    *. I#ent!(% the $r!+ar% 8e% (or ea"h ta*le- an# !#ent!(% an% nee#e# (ore!n

    8e%s.

    − #he necessary tables! with their attendant primary and foreign ,eys! are as

    follows0

     

    T

     

    P

    r!

    +

    a

    r

    %

     

     

    e

    %

     

    ?

    or

    e

    !

    n

     

     

    e

    %

    s

     

    O

    3

    − 3

    m ployee

      um b

    er 

    − S

    u per "isor 

     nu

    m ber 

     (an

    3

    5

    D

    D

    4-42

  • 8/19/2019 AIS e12 CH04

    43/67

    Accounting Information Systems

     othe

    r  em ployee

     n

    um ber )

    S

    − S

    , ill

     num ber 

    − −

    S

    3

    − S

    , ill

     num ber 

    − 3

    m

    − −

    D

    4-43

  • 8/19/2019 AIS e12 CH04

    44/67

    *h. 40 elational Databases

     ploy

    ee

     

    num ber 

     

    ". I+$le+ent %o)r s"he+a )s!n an% relat!onal DBS. S$e"!(% $r!+ar% an#

    (ore!n 8e%s- an# en(or"e re(erent!al !nter!t%. De+onstrate the so)n#ness o( %o)r

    #es!n *% enter!n sa+$le #ata !n ea"h ta*le.

    − #here is no single solution to part c as students will select different software pac,ages and

    enter different data in the tables.

    4-44

  • 8/19/2019 AIS e12 CH04

    45/67

    Accounting Information Systems

     4.= Fo) 'ant to e7ten# the s"he+a sho'n !n Ta*le 431< to !n"l)#e !n(or+at!on

    a*o)t ")sto+er $a%+ents. So+e ")sto+ers +a8e !nstall+ent $a%+ents on ea"h !n&o!"e.

    Others 'r!te a "he"8 to $a% (or se&eral #!((erent !n&o!"es.

     

    a. o#!(% the set o( ta*les !n Ta*le 431< to store th!s a##!t!onal #ata.

     

    *. I#ent!(% the $r!+ar% 8e% (or ea"h ne' ta*le %o) "reate.

    − #he following additional tables! with their attendant primary ,eys! are needed to

    store the other new attributes. ote that customer name is already stored in the customer table

     

    P

    r

    !

    +

    a

    r%

     

    e

    %

     

    ?ore!n

    e%s

     

    O

    − − *

    ash ecei pt um ber 

    − *ustomer 

    number 

    − 3mploye

    e processing

    −  payment(employeenumber)

    D

    #o

    − − '

    n"oice pay

    − −

    A

    4-45

  • 8/19/2019 AIS e12 CH04

    46/67

    *h. 40 elational Databases

    ment

    a p plies

    −  

    to('n

    "oicenum ber )

    − *ash ecei ptn

    um ber 

     

    ". I+$le+ent %o)r s"he+a )s!n an% relat!onal DBS $a"8ae. In#!"ate

    4-46

  • 8/19/2019 AIS e12 CH04

    47/67

    Accounting Information Systems

     'h!"h attr!*)tes are $r!+ar% an# (ore!n 8e%s- an# enter sa+$le #ata !n ea"h ta*le %o)

    "reate.

    − #here is no solution to part c as students will select different software pac,ages and enter

    different data in the tables.

    4-47

  • 8/19/2019 AIS e12 CH04

    48/67

    *h. 40 elational Databases

    4. Create relat!onal ta*les that sol&e the )$#ate- !nsert- an# #elete ano+al!es !n Ta*le 431=.

    − #o a"oid the update! insert! and delete anomalies! four separate relational tables

    are created.

    − #ABE3 4-=I

    'n"oice J−

    Date

    rder Date

    *ustomer

    *ustomer

    'temJ

    Desc

    ua

    :

    8-=?-=:

    :-:-=:

    9=

    /ohnson

    =9@

    #re, 

    :

    :

    8-=?-=:

    :-:-=:

    9=

    /ohnson

    =

     im

    :

    8-=?-=:

    :-:-=:

    9=

    /ohnson

    =9

    '66o

    ==

    :

    8-=?-=:

    :-:-=:

    9=

    /ohnson

    I=

    ED

    =

    4-48

  • 8/19/2019 AIS e12 CH04

    49/67

    Accounting Information Systems

     

    :I

    8-9-=:

    8-9=-=:

    @9:

  • 8/19/2019 AIS e12 CH04

    50/67

    *h. 40 elational Databases

     

    I

    n

    &

    o

    !"

    e

    P

     

    ?

     

    5

     

    It

     

    Q

    − :

    =

    :

    − :

    =

    − :

    =

    =

    − :

    I

    =

    − :I

    :

    =

    − :

    I

    =

    =

    − :

    I

    =

    :

    − *GS#M3 #ABE3

    C

     

    C

    )

    s

    t

    4-50

  • 8/19/2019 AIS e12 CH04

    51/67

    Accounting Information Systems

     o

    +

    e

    r

    N

    a

    +

    e

    − /

    ohnson

    @

    − <

    enr y

    − 'tem #able

     

    Ite+

    P5

     

    D

    − =9   −

    '

    − I=   −

    E

    =9@  −

    #

    − ==:   −

     

    − =   −

     

    4-51

  • 8/19/2019 AIS e12 CH04

    52/67

    *h. 40 elational Databases

    − :@:   −

    #

    −  ote0 5L-5rimary Ley! FL Foreign Ley! 5L1FL 5rimary Ley1Foreign Ley

    4-52

  • 8/19/2019 AIS e12 CH04

    53/67

    Accounting Information Systems

     4.J Create relat!onal ta*les that sol&e the )$#ate- !nsert- an# #elete ano+al!es !n

    Ta*le 431.

    − #ABE3 4-=

     

    P)r"hasePart  

    Des"r! 

    Un!t

     

    Pr!"e

     

    Q)ant!t% Ken#or  

    Ken#or Ken

    @1?1=:

    @@4

    KN

    7@9

    @

    :94

    LE

    I:

    @1?1=:

    @=

    5D

    7:9

    :

    :94

    LE

    I:

    @1?1=:

    444

    KKM

    79

    8

    :94

    LE

    I:

    @

    41:1=:

    @=

    5D

    7:9

    ?

    scan

    ::

    4-53

  • 8/19/2019 AIS e12 CH04

    54/67

    *h. 40 elational Databases

    − 5A# #ABE3

     

    Part

     

    De

     

    Un!t

    @@4

    @9

    @=

    5

    :9

    444

    K

    9

    − 5G*

  • 8/19/2019 AIS e12 CH04

    55/67

    Accounting Information Systems

     P

    )

    r

    "

    h

    a

    s

    e

     

    O

    r

    #

    e

    r

     

     

    P

     

    5

     

    Ke

     

    P

    −   −

    :9

    @1

    − @   −

    41

    4-55

  • 8/19/2019 AIS e12 CH04

    56/67

    *h. 40 elational Databases

    − >3D #ABE3

    K

     

    K

     

    K

    :

    I

    :

    − 5G*

  • 8/19/2019 AIS e12 CH04

    57/67

    Accounting Information Systems

     4.1@ ?ro+ the #ata*ase "reate# !n the "o+$rehens!&e $ro*le+- $er(or+ 9)er!es

    *ase# on the ta*les an# 9)er% r!# sho'n !n Ta*le 431J.

    − #he %ueries and the answers to the %ueries for the %uestions about the

    comprehensi"e problem data (#able 4-=?) are shown below.

    a. Wh!"h *orro'ers )se A#&ent A$$ra!sers

    − uery

    − uery esult

    4-57

  • 8/19/2019 AIS e12 CH04

    58/67

    *h. 40 elational Databases

    4-58

  • 8/19/2019 AIS e12 CH04

    59/67

    Accounting Information Systems

     − *. What !s the a&erae a+o)nt *orro'e# (ro+ Nat!onal ortae

    − uery

    − uery esult

    4-59

  • 8/19/2019 AIS e12 CH04

    60/67

    *h. 40 elational Databases

     

    ". L!st all o( the $ro$ert% a$$ra!sers.

    − uery

    − uery esult

    4-60

  • 8/19/2019 AIS e12 CH04

    61/67

    Accounting Information Systems

     #.L!st all o( the len#ers.

    − uery

    − uery esult

    − uery

    4-61

  • 8/19/2019 AIS e12 CH04

    62/67

    *h. 40 elational Databases

    4-62

  • 8/19/2019 AIS e12 CH04

    63/67

    Accounting Information Systems

     e. L!st the len#ers that lent +ore than 1@@-@@@.

    −  #30 'n order to get a list of lenders without duplicates the property sheet of

    the %uery needs to be modified by setting the "alue of the Unique Values propertyto Yes. #his can be seen in the screenshot below. #he property sheet is foundunder the Design tab of the ribbon. Setting Unique Values to Yes is thee%ui"alent of entering the DISTINCT  ,eyword in SE select statements.

    4-63

  • 8/19/2019 AIS e12 CH04

    64/67

    *h. 40 elational Databases

    − uery esult

    4-64

  • 8/19/2019 AIS e12 CH04

    65/67

    Accounting Information Systems

     (. Wh!"h *orro'er re9)este# the larest +ortae

    − uery

    −  otice that in the Design section on the ribbon! you must set the eturn "alue to

    = (located in the uery Setup group). #his indicates to Access to only return thetop result. See the image below for a screenshot of this.

    − uery esult

    4-65

  • 8/19/2019 AIS e12 CH04

    66/67

    *h. 40 elational Databases

     

    . Wh!"h *orro'er re9)este# the s+allest +ortae

    − uery

    −  

    − uery esult−

     

    As with problem 4-=9-f! you must set the eturn "alue to = in the Design section

    of the ribbon (located in the uery Setup group). #his indicates to Access to only return the top result.See the image below for a screenshot of this.

    4-66

  • 8/19/2019 AIS e12 CH04

    67/67

    SUGGESTED ANSWERS TO THE CASES

     

    4.1 As !n all areas o( !n(or+at!on te"hnolo%- DBSs are "onstantl% "han!n an#

    !+$ro&!n. Resear"h ho' *)s!nesses are )s!n DBSs- an# 'r!te a re$ort o( %o)r (!n#!ns.

    A##ress the (ollo'!n !ss)es,

    1. Wh!"h $o$)lar DBS $ro#)"ts are *ase# on the relat!onal #ata +o#el

    /. Wh!"h DBS $ro#)"ts are *ase# on a lo!"al +o#el other than the relat!onal #ata

    +o#el

    2. What are the relat!&e strenths an# 'ea8nesses o( the #!((erent t%$es relat!onal &ers)s

    other lo!"al +o#els5 o( DBSs

    − o single answer e&ists with this caseH indeed! solutions will "ary depending upon student

    ingenuity and creati"ity. eports should be graded in terms of how well each issue was addressedand in terms of writing %uality. Students should be able to find the following information0

    • elational DBMSs include DB! racle! SE Ser"er and Access.

    • Many newer products are based on the obect-oriented data model! or are a hybrid of the

    relational and obect-oriented approaches. lder mainframe DBMS are based on hierarchicalor networ, logical models.