Accounting Information Systems - Relational Databases

Embed Size (px)

Citation preview

  • 8/3/2019 Accounting Information Systems - Relational Databases

    1/51

    Chapter 4

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    2/51

    1. Explain the difference between database and file-based legacy systems.

    2. Describe what a relational database is and how it

    organizes data.3. Explain the difference between logical and physical

    views of a database.4. Create a set of well-structured tables to properly store

    data in a relational database.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    3/51

    Ashton Fleming, the accountant for S&S,

    believes that the best way to provide Susan

    Gonzalez and Scott Parry with easy access tothe information they need to run their

    business is to build S&Ss new AIS as adatabase system.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    4/51

    Ashton decides to prepare a brief report

    for them addressing the following

    questions:

    What is a database system?

    What is a relational database system?

    How do you design a relational

    database?

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    5/51

    This chapter explains what a database is

    and how it differs from a file-oriented

    system.

    It also describes the structure of a

    relational database system.

    The chapter concludes by discussing the

    basic steps involved in designing adatabase.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    6/51

    Data a collection of facts made up of text, numbersand dates:

    Murray 35000 7/18/86

    Information - the meaning given to data in the way it isinterpreted:

    Mr. Murrayis a sales person whose annualsalaryis$35,000 andwhose hire date isJuly 18, 1986.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    7/51

    Data Information Knowledge Action

    Is to transformIs to transform

    Data driven decision makingData driven decision making

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    8/51

    What is a file?

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    9/51

    A structured collection of related data

    An filing cabinet, an address book, atelephone directory, a timetable, etc.

    Google and your email is a database

    School Student Information System

  • 8/3/2019 Accounting Information Systems - Relational Databases

    10/51

    Records

    Fields

    Name GatorLink Phone College

    Graff rgraff 392-3900 Pharmacy

    Harris bharris 392-5555 Medicine

    Ipswich zipswich 846-5656 PHHP

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    11/51

    Name User Phone College

    Graff rgraff 392-3900 Pharmacy

    Harris bharris 392-5555 Medicine

    Ipswich zipswich 846-5656 PHHP

    To ensure that each record is unique in each table, we

    can set one field to be aPrimary Key field.

    A Primary Key is a field that that will contain no

    duplicates and no blank values.

    Foreign Keys link to data in other tables

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    12/51

    A set of all related records forms afile (e.g., thestudent file).

    I

    f this university only had three students and fivefields for each student, then the entire file would bedepicted below.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    13/51

    A set of interrelated, centrally coordinated filesforms a database.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    14/51

    Two basic types of files are used to store

    data.

    1 The masterfile, which is similar to a ledger in

    a manual system.

    2 The transactionfile, which is similar to a

    journal in a manual system.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    15/51

    For many years, companies created new files

    and programs each time an information need

    arose.

    This increase of master files created

    problems:1 Often the same data was stored in two or more separate files.

    2 The specific data values stored in the different files were not

    always consistent.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    16/51

    Shipping

    Program

    Sales

    Program

    File 1

    Fact A

    Fact B

    Fact C

    File 2

    Fact B

    Fact D

    Fact E

    Billing

    Program

    File 3

    Fact A

    Fact G

    Fact E2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    17/51

    The database approach views data as anorganizational resource that should be used by, andmanaged for, the entire organization, not just the

    originating department or function.

    Its focus is data integration and data sharing.

    Integration is achieved by combining master filesinto larger pools of data that can be accessed bymany application programs.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    18/51

    Database managementsystem (DBMS) is theprogram that manages and controls access to

    the database.

    Database system is the combination of thedatabase, theDBMS, and the application

    program that uses the database.

    Database administrator(DBA) is the personresponsible for the database.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    19/51

    BillingProgram

    Shipping

    Program

    Databasemanagement

    system

    Sales Program

    Fact A

    Fact B

    Fact C

    Fact D

    Fact E

    Database

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    20/51

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    21/51

    As accountants, you are likely to audit or workfor companies that use database technology tostore, process, and report accountingtransactions.

    Many accountants work directly with databases andwill enter, process, and query databases.

    Some will develop and evaluate internal controlsnecessary to ensure database integrity.

    Others will be involved in the design andmanagement of databases.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    22/51

    Describe what a relational

    database is and how itorganizes data.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    23/51

    Adata modelis an abstract representation of

    the contents of a database.

    The relationaldata modelrepresents

    everything in the database as being stored inthe form of tables.

    Technically, these tables are called relations.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    24/51

    Each row in a relation, called a tuple, contains

    data about a specific occurrence of the type

    of entity represented by that table.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    25/51

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    26/51

    A relational database is a collection of tables fromwhich data can be accessed in many different wayswithout having to reorganize the database tables.

    DONTDUPLICATEDATA

    That is, once relationships are created, tables can talk

    to each other. We can link (relate) the tables to find: Which schools are in a system?

    Which students are in which class?

    Which classes are filling up?

  • 8/3/2019 Accounting Information Systems - Relational Databases

    27/51

  • 8/3/2019 Accounting Information Systems - Relational Databases

    28/51

  • 8/3/2019 Accounting Information Systems - Relational Databases

    29/51

    Relationships

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    30/51

    Explain the difference between logical and

    physical views of a database.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    31/51

    A major advantage of database systems over

    file-oriented systems is that the database

    systems separate the logical and physicalview of data.

    What is the logical view?

    It is how the user or programmer conceptuallyorganizes and understands the data.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    32/51

    What is the physical view?

    It refers to how and where the data are physically

    arranged and stored on disk, tape, CD-ROM, orother media.

    TheDBMS controls the database so that

    users can access, query, or update it without

    reference to how or where the data arephysically stored.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    33/51

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    34/51

    Program-data independence is the

    separation of the logical andphysical views of data.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    35/51

    A schema describes the logical structure of a

    database.

    There are three levels of schemas:1 Conceptual-level schema

    2 External-level schema

    3 Internal-level schema

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    36/51

    The conceptual-level schema is an organization-wide view of the entire database.

    The external-level schema consists of a set ofindividual user views of portions of the database,also referred to as a subschema.

    The internal-level schema provides a low-levelview of the database.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    37/51

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    38/51

    The data dictionarycontains information

    about the structure of the database.

    For each data element stored in thedatabase, such as the customer number,

    there is a corresponding record in the datadictionary describing it.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    39/51

    The data dictionary is often one of the firstapplications of a newly implementeddatabase system.

    What are some inputs to the data dictionary? records of any new or deleted data elements

    changes in names, descriptions, or uses of

    existing data elements

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    40/51

    What are some outputs of the datadictionary? reports useful to programmers, database

    designers, and users of the informationsystem

    What are some sample reports? lists of programs in which a data item is

    used

    lists of all synonyms for the dataelements in a particular file

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    41/51

    EveryDBMS must provide a means ofperforming the three basic functions:1 Creating the database

    2 Changing the database3 Querying the database

    The sets of commands used toperform these functions are referred

    to as the data definition, datamanipulation, and data querylanguages.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    42/51

    The data definition language (DDL) is usedto... build the data dictionary.

    initialize or create the database.

    describe the logical views for each individual useror programmer.

    specify any limitations or constraints on securityimposed on database record or fields.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    43/51

    The data manipulation language (DML) is

    used for data maintenance.

    What does it include? updating portions of the database

    inserting portions of the database

    deleting portions of the database

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    44/51

    The data query language (DQL) is used to

    interrogate the database.

    TheDQL retrieves, sorts, orders, andpresents subsets of the database in response

    to user queries.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    45/51

    Create a set of well-structured tables to

    properly store data in a relational database.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    46/51

    1. Each column in a row must be single valued.2. Primary keys cannot be null.3. Foreign keys, if not null, must have values that

    correspond to the value of a primary key in an otherrelation.

    4. All non-key attributes in a table should describe acharacteristic about the object identified by the

    primary key.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    47/51

    UpdateAnomaly: When changes (updates)to data values are not correctly recorded.

    Instead of having to update once, each recordin the single table has to be updatedindividually in order to avoid inconsistencies inthe database.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    48/51

    InsertAnomaly:There is no way to store

    information about one entity in the database

    without it being associated with anotherentity

    In the text, we would not be able to storeinformation on new customers without their

    being associated with transactions first!

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    49/51

    DeleteAnomaly:Unintended results arisingfrom deleting a row of data pertaining to oneentity and resulting in the deletion of data

    regarding another entity as well. In the text, if a particular Inventory item were

    discontinued and hence removed from the databasetable, we would lose information on the customerassociated with that inventory item as well.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    50/51

    Normalization

    Starts with the assumption that all data is initially stored ina large non-normalized table.

    This table is then decomposed using a set of normalizationrules to create a set of tables in the ThirdNormal Form.

    SemanticDataModeling

    The database designer uses his/her knowledge about thebusiness structure to create a set of relational tables.

    2/10/2012

  • 8/3/2019 Accounting Information Systems - Relational Databases

    51/51

    Database systems have the potential to

    significantly alter the nature of external

    reporting. Perhaps the most significant effect of

    database systems will be in the way thataccounting information is used in decision

    making.

    2/10/2012