Presentation is loading. Please wait.

Presentation is loading. Please wait.

RELATIONAL DATABASES SYSTEMS Unit 3. This unit shift attention to database as an important component of AIS. Understanding the fundamentals of database.

Similar presentations


Presentation on theme: "RELATIONAL DATABASES SYSTEMS Unit 3. This unit shift attention to database as an important component of AIS. Understanding the fundamentals of database."— Presentation transcript:

1 RELATIONAL DATABASES SYSTEMS Unit 3

2 This unit shift attention to database as an important component of AIS. Understanding the fundamentals of database system, its design and implementation. Also worth noting is that Relational databases underlie most modern integrated AISs. They are the most popular type of database used for transaction processing. Let’s take a cruise through relational databases systems. Introduction

3 Learning Objectives After reading this unit you should be able to: 1.Explain the importance and advantages of databases. 2.Describe the difference between database systems and file-based legacy systems. 3.Explain the difference between logical and physical views of a database. 4.Explain fundamental concepts of database systems such as DBMS, schemas, the data dictionary, and DBMS languages. 5.Describe what a relational database is and how it organizes data

4 SESSION 1-3: DESIGN AND IMPLEMENTATION OF AIS DATABASE 1-3.1: File versus Databases 1-3.2: Database systems 1-3.3: Data Hierarchy of a Business Entity 1-3.4: The Role and Functions of Database Administrator (DBA) 1-3.5: Importance and advantages of Data Systems 1-3.6: Logical and Physical 1-3.7: Schemas 1-3.8: Data Dictionary 1-3.9: DBMS Languages 1-3.10: Report Writer SESSION 2-3: RELATIONAL DATABASES 2-3.1: Relational Database

5 SESSION 1-3: DESIGN AND IMPLEMENTATION OF AIS DATABASE This session looks at the importance and advantages of databases, the difference between database systems and file-based legacy systems, difference between logical and physical views of a database etc. 1-3.1 File versus Databases i.An entity It is about what the organization wishes to store data. At your college or university, one entity would be the student. STUDENT Student IDLast NameFirst NamePhone NumberBirth Date 24086012 BoatengJanet024427627610/11/84 24086112 AmpongKwabena023378654011/24/86 24086212 ArthurJoseph027765432904/20/85

6 ii. Attributes Information about the an entity (e.g., the student’s ID number and birth date) are stored. iii. Fields It is where the attributes are stored. STUDENT Student IDLast NameFirst NamePhone NumberBirth Date 24086012 BoatengJanet024427627610/11/84 24086112 AmpongKwabena023378654011/24/86 24086212 ArthurJoseph027765432904/20/85

7 iv. Records It is all the fields containing data about one entity (e.g., one student). The example below shows the record for Arthur Joseph. STUDENT Student IDLast NameFirst NamePhone NumberBirth Date 24086012 BoatengJanet024427627610/11/84 24086112 AmpongKwabena023378654011/24/86 24086212 ArthurJoseph027765432904/20/85 v. File It is the set of all related records (e.g., the student file). If this university only had three students and five fields for each student, then the entire file would be depicted below. STUDENT Student IDLast NameFirst NamePhone NumberBirth Date 24086012 BoatengJanet024427627610/11/84 24086112 AmpongKwabena023378654011/24/86 24086212 ArthurJoseph027765432904/20/85

8 vi. Database A set of interrelated, centrally coordinated files. Refer to Figure 1-3.2B Student FileClass File Advisor File 1-3.2 Database Systems – Proliferation of Master Files Database systems were developed to address the problems associated with the proliferation of master files. For years, each time a new information need arose, new files and programs are created leading to a significant increase in the number of master files. Problems: Often the same information was stored in multiple master files. Made it more difficult to effectively integrate data and obtain an organization-wide view of the data Also, the same information may not have been consistent between files.  For instance, If a student changed his phone number, it may have been updated in one master file (eg. Master File 1) but not others (Master File 2 & 3) as shown in the figure 1-3.2Abelow:

9 Master File 1 Fact A Fact B Fact C Grades Program Enrollment Program Financial Aid Program Master File 3 Fact A Fact B Fact C Master File 2 Fact A Fact B Fact C Figure 1-3.2A

10 Database Fact A Fact B Fact C Fact D Fact E Fact F Database Management System (DBMS) Enrollment Program Financial Aid Program Grades Program The combination of the converted Master Files into a database, the DBMS, and the Programs that access the database is known as the Database System Figure 1-3.2B Solutions to Master File Proliferations

11 1-3.3 Data Hierarchy of a Business Entity Database Inventory File Sales Files Customer File Record 100 Customer 1000 Field 6: Zip code Field 5: State Field 3: Street Address Field 2: Customer Name Field 1: Customer Number Field 4: City Record 3: Customer 3 Record 2: Customer 2 Record 1: Customer 1

12 1-3.4 The Role and Functions of Database Administrator (DBA) The person responsible for the database is the database administrator (DBA).The specific elements in a DBA’s role can vary widely from organization to organization. 1.Database designer and maintainer: The DBA is responsible for establishing and maintaining data definitions and authorizing data and authorizing views of the database for specific classes of users. 2.Policy and procedure setter: [Installation and Operation of a DBMS], the DBA should play a key role in developing database policies and procedures. 3.Security officer: Typically, the DBA determines user authorization privileges and monitors access to the database. 4.Consultant to users and programmers on use of DBMS: In this role, the DBA offers a considerable amount of technical expertise. 5.DBMS performance evaluator: The DBA should closely monitor the DBMS’s efficiency and effectiveness. 6.Resource arbitrator: Once users become accustomed to a database system approach, many companies find that users develop new ways to use the DBMS that can place increasing demands on system resources. It generally falls to the DBA to manage the resolution of multiple and sometimes conflicting demands for use of system resources.

13 1-3.5 Importance and advantages of Data Systems Database technology is universal. Most AISs are implemented using a database approach. Database technology stores, processes, and reports accounting transactions. Many accountants work directly with databases since they are directly involved in entering, processing, and querying the data in databases. Also responsible for developing and evaluating internal controls necessary to ensure database integrity. Some will become designers and managers of databases. Benefits of Database Technology 1.Data integration: is achieved by combining master files into larger “pools” of data that many application programs can access. E.g. an employee database consolidates data formerly contained in payroll, personnel, and job skills master files. Makes it easier for information combination in unlimited ways. 2.Data sharing: Integration makes it easier to share data with all authorized users. 3.Reporting flexibility: Reports revision and Drill-down and multi-dimension of summary report. 4.Minimal Redundancy & Inconsistencies: Data is stored only once to minimise redundancy and inconsistencies. 5.Data independence: Data and programs are independent of each other, changing one without having to change the other. Programming is easier and data management simple. 6.Central Data Management: is more efficient because a database administrator is responsible for coordinating, controlling, and managing data. 7.Cross-functional analysis: Relationships such as between selling costs and promotional campaigns can be explicitly defined and used in the preparation of management reports.

14 1-3.6 Logical and Physical In file-oriented systems, programmers must know the physical location and layout of records used in an application program. They must reference the location, length, and format of every field they utilize. When data is used from several files, this process becomes more complex. A record layout of an account receivable file a programmer wants includes a credit report showing the customer number, credit limit, and current balance. Database systems overcome this problem by separating the storage and use of data elements. The database approach provides two separate views of the data: the physical view and the logical view. Logical view - is how the user or programmer conceptually organizes and understand the data. E.g., a sales manager may conceptualize all information about customers as being stored in the form of a table. Physical view - refers to how and where the data are physically arranged and stored in the computer system. Separating them facilitates application development, because programmers can focus on coding the logic and not be concerned with storage details. The DBMS handles the link between the physical and logical views of the data. Allows the user to access, query, and update data without reference to how or where it is physically stored. The user only needs to define the logical data requirements. Separating the logical and physical views of data also means users can change their conceptualizations of the data relationships without making changes in the physical storage. The DBA can also change the physical storage of the data without affecting users or application programs.

15 1-3.7 Schemas A schema describes the logical structure of a database. There are three levels of schemas: the conceptual, the external, and the internal. Conceptual-level schema- is the organization-wide view of the entire database. It lists all data elements and the relationships among them. External-level schema- consists of a set of individual user views of portions of the database, each of which is also referred to as a subschema. Internal-level schema -provides a low-level view of the database. It describes how the data are actually stored and accessed, including information about record layouts, definition, addresses, and indexes. The DBMS uses the mappings to translate a request by a user or program for data (expressed in logical names and relationships) into the indexes and addresses needed to physically access the data. Accountants are frequently involved in developing conceptual-and external-level schema. An employee’s access to data should be limited to the subschema of data that is relevant to the performance of his job.

16 1-3.8 Data Dictionary A key component of a DBMS is the data dictionary. It contains information about the structure of the database. For each data element, there is a corresponding record in the data dictionary describing that element. Information provided for each element includes: a)A description or explanation of the element. b)The records in which it is contained. c)Its source. d)The length and type of the field in which it is stored. e)The programs in which it is used. f)The outputs in which it is contained. g)The authorized users of the element. h)Other names for the element. Accountants should participate in the development of the data dictionary because they have a good understanding of the data elements in a business organization, as well as where those elements originate and how they are used. The DBMS usually maintains the data dictionary. It is often one of the first applications of a newly implemented database system. a)Inputs to the dictionary include: Records of new or deleted data elements. Changes in names, descriptions, or uses of existing elements. b)Outputs include: Reports that are useful to programmers, database designers, and IS users in:  Designing and implementing the system.  Documenting the system.  Creating an audit trail.

17 1-3.9 DBMS Languages Every DBMS must provide a means of performing the three basic functions of Creating, Changing and Querying a database. Creating a database The set of commands used to create the database is known as data definition language (DDL). DDL is used to: Build the data dictionary Initialize or create the database Describe the logical views for each individual user or programmer Specify any limitations or constraints on security imposed on database records or fields Changing a database The set of commands used to change the database is known as data manipulation language (DML). DML is used for maintaining the data including: Updating data Inserting data Deleting portions of the database

18 Querying a database The set of commands used to query the database is known as data query language (DQL). DQL is used to interrogate the database, including: Retrieving records Sorting records Ordering records Presenting subsets of the database The DQL usually contains easy-to-use, powerful commands that enable users to satisfy their own information needs. 1-3.10 Report Writer Many DBMS packages also include a report writer, a language that simplifies the creation of reports. Users typically specify: What elements they want printed How the report should be formatted The report writer then: Searches the database Extracts specified data Prints them out according to specified format Users typically have access to both DQL and report writer. Access to DQL and DML are typically restricted to employees with administrative and programming responsibilities.

19 SESSION 2-3: RELATIONAL DATABASES A DBMS is characterized by the type of logical data model on which it is based. A data model is an abstract representation of the contents of a database. Most new DBMSs are called relational databases because they use the relational model developed by E.F. Coddin 1970. 2-3.1 Relational Database The relational data model represents everything in the database as being stored in the form of tables(aka, relations). Technically, these tables are called relations hence the name relational data model. It is a collection of data representing multiple occurrences of a resource, event, or agent. They correspond to the entities in the E-R model and the REA model. Relational data model only describes how the data appear in the conceptual and external-level schemas. The data are not actually stored in tables, but rather in the manner described in the internal-level schema. Each row in a relation called a tuple. It contains data about a specific occurrence of the type of entity represented by that table.

20 Attributes of Relational Database Tables in a relational database have several types of attributes, namely primary and secondary keys. i.Primary key is the attribute, or combination of attributes, that uniquely identifies a specific row in a table. In some tables, two or more attributes may be joined to form the primary key. ii.Foreign keys are used to link tables. A foreign key is an attribute in a table that is a primary key in another table. An example is the attribute Customer #. It is the primary key in the Customer table and, as a foreign key in the Sales table. iii.Non-key attributes-in each table store important information about that entity which also contains information about the description, colour, quantity on hand, and price of each item.

21 Basic Requirements of Relational Database 1. Every column in a row must be single valued In a relational database there is one, and only one, value in any given cell. At firm’s account, each sales transaction can involve more than one inventory item. For example, on sales invoice number 102, the customer bought a television, a freezer, and a refrigerator. 2. Primary key cannot be null The primary key is the attribute, or combination of attributes, that uniquely identifies a specific row in a table. For this to be true, the primary key of any row in a relation cannot be null (blank), for then there would be no way to uniquely identify that row and retrieve the data stored there. A non-null value for the primary key indicates that a specific object exists and can be identified by reference to its primary key value. This is referred to as the entity integrity rule, because it ensures that every row in every relation must represent data about some specific object in the real world. However, the sales invoice # and item # columns, taken together, do uniquely identify each row. Therefore, both attributes are combined to form the primary key.

22 Basic Requirements of Relational Database Continued 3. Foreign keys, if not null, must have values that correspond to the value of a primary key in another table Foreign keys are used to link rows in one table to rows in another table. For example, the customer # is a foreign key in the sales table, and links each sales transaction with the customer who participated in that event. This is only possible, however, if the customer number values in the sales table correspond to actual customer numbers in the customer table. This constraint is referred to as the referential integrity rule because it ensures the consistency of the database. Foreign keys can contain null values, however. 4. All non-key attributes in a table should describe a characteristic about the object identified by the primary key Most tables contain other attributes in addition to primary and foreign keys. Sales invoice # is the primary key. Both customer # and salesperson are foreign keys, although the salesperson table is not shown. The remaining attribute (data) is an important fact about the sales event.

23 1-3. Self Assessment 1.Explain the importance and advantages of databases. 2.Describe the difference between database systems and file-based legacy systems. 3.Explain the difference between logical and physical views of a database 2-3. Self Assessment 1.How are databases different than file-based legacy systems? 2.Why are databases important and what is their advantage? 3.What is the difference between logical and physical views of a database? 4.What are the fundamental concepts of database systems such as DBMS, schemas, the data dictionary, and DBMS languages? 5.What is a relational database, and how does it organize data? Unit 3 Assignment How are tables structured to properly store data in a relational database?


Download ppt "RELATIONAL DATABASES SYSTEMS Unit 3. This unit shift attention to database as an important component of AIS. Understanding the fundamentals of database."

Similar presentations


Ads by Google