1 This pre-publication material is for review purposes only. Any typographical or technical errors will be corrected prior to publication..
3 C HAPTER 6 L EARNING OBJECTIVES Databases and Information Management O PENING CASE T oronto Opens Up Its Data G overnments around the world are opening up their data stores to the public. If we think about the kinds of data that are available, the imagination can run away with ideas about research, interesting stories, and even the ability to hold offi cials accountable. We might try to fi nd out how much a particular city councillor spent on travel or how that councillor voted. We might conduct research on how a particular region of Canada was affected by World War I. Or we might want to see which areas were prone to fl ooding or bedbugs. W ith open data, all this is possible, and the City of Toronto recently took a giant step forward in opening up its data for the world to see. Toronto s open data initiative is led by a small team in the city authority s Web Department. The Department updates the data daily with raw datasets on a variety of t opics. Trish Garner, the team s head, states: I think there s a large community of developers in Toronto and across Canada which is inspired by what s going on in the U.K.... and want to see change here at home. A good majority have registered with us and are quite avidly following what we re doing. I n fact, Canada s biggest open data sites, the cities of Toronto, Vancouver, Ottawa, and Edmonton, are beginning to work together to compile a series of open data standards that would permit data among the cities to be merged to be used for research and other purposes. Jury Konga, who has been helping to create the G4 Open Data Framework, s ays that cities across Canada are beginning their own open data initiatives. According to Konga, We have also seen Open Data surface in the political arena where one of the political parties recently put forward a new policy of Open Gov Open Data and mayoral candidates in A fter reading this chapter, you will be able to answer the following questions: 1. What are the problems of managing data resources in a traditional file environment, and how are they solved by a database management system? 2. What are the major capabilities of database management systems (DBMS), and why is a relational DBMS so powerful? 3. What are some important principles of database design? 4. What are the principal tools and technologies for accessing information from databases to improve business performance and decision making? 5. Why are information policy, data administration, and data quality assurance essential for managing the firm s data resources? Toronto advocated increasing the open data program in Toronto. T he city of Toronto is still trying to decide exactly what data to make available to the public. A quick check of the open data Web site, located at Toronto.ca/ open, revealed a wide variety of datasets: bicycle counts and locations, apartment standards, bikeways, city wards, data from food and health inspections, election results by polling place, fi re station locations, attendance and voting records of city councillors, sign permit applications, traffi c signal locations, and much more. A host of location-based applications will be enabled by these datasets. The majority of data opening up is geographically based. Toronto CIO Dave Wallace indicated that the Child Care Finder dataset is one of the most popular. While only a few cities have data catalogues that are interesting and that 176
4 developers can mash up, Peter Corbett, Founder of Apps for Democracy in the United States, says, Within 10 years, I d say there [are] going to be hundreds of them, so this is very early stuff. A ccording to a city release, More datasets will become available in the future. Each new dataset will be reviewed to ensure that the privacy of the public is protected. If a citizen wants to request a new dataset, the city s new Web site, datato.org, allows a citizen to enter a request, sets priority levels on the datasets by casting votes, The City of Toronto s experience illustrates the importance of data management for the public. Even in government, performance depends on what an organization can or cannot do with its data. How organizations store, organize, and manage their data has a tremendous impact on organizational effectiveness. and permits discussions and debates about specifi c datasets. You can also follow Toronto s open data initiative on Twitter, A ccording to then Toronto mayor David Miller, Anyone can download, analyze, and mash up our data or write applications to make it more accessible and useful. It is an invitation to Torontonians to do what they do best: create, innovate, and build a better city. E ven the federal government has begun an open data initiative, called the GC Open Data Portal, making more than T he chapter-opening diagram calls attention to important points raised by this case and this chapter. Government leaders decided that the city needed to open up the city s data to the public. Previously, data about councillors, services, traffi c and transit, and other important datasets had been stored where the public could not easily retrieve and datasets available to the public. Robert Giggey, IT account manager for the City of Ottawa, stated: Now that the feds are doing it, it gives more incentive for the provinces to get on board. S ources: Jennifer Kavur, Thinking Like the Web, ComputerWorld Canada, December 4, 2009; Allison Hanes, Toronto Opens Up, The National Post, November 2, 2009; How Canada Became an Open Data and Data Journalism Powerhouse, co. uk/ news/ datablog/ 2010/ nov/ 09/ canada-open-data, accessed April 2, 2011; Toronto. ca/ open, accessed April 2, 2011; Jennifer Kavur, Federal Government Launches Pilot Open Data Portal, ComputerWorld Canada, April FPO analyze them. Citizens were unable to access data they wanted, and the city needed to provide better service and support. I n addition to using appropriate technology, the city had to ensure that privacy rights were protected and that requested datasets could be considered for the open data initiative.
5 178 Part II Information Technology Infrastructure Field Record File Database Entity Attribute Decide which datasets to make available Dataset standards Privacy Government officials Management IS personnel Development community Open datasets Mashup technology Management Organization Technology Business Challenges Information System Data catalogues Discussion and voting systems Database management systems 6.1 Organizing Data in a Traditional File Environment A n effective information system provides users with accurate, timely, and relevant information. Accurate information is free of errors. Information is timely when it is available to decision makers when it is needed. Information is relevant when it is useful and appropriate for the types of work and decisions that require it. Y ou might be surprised to learn that many businesses do not have timely, accurate, or relevant information because the data in their information systems have been poorly organized and maintained. That is why data management is so essential. To understand the problem, let s look at how information systems arrange data in computer files and traditional methods of file management. F ile Organization Terms and Concepts Systems that were not integrated Transparency for the public Enabling the public to access needed public information Business Solutions Enables the public to freely access nonprivate data and to manipulate the data Enables transparent government A computer system organizes data in a hierarchy that starts with bits and bytes and progresses to fields, records, files, and databases (see Figure 6-1). A bit represents the smallest unit of data a computer can handle. A group of bits, called a byte, represents a single character, which can be a letter, a number, or another symbol. A grouping of characters i nto a word, a group of words, or a complete number (such as a person s name or age) is called a field. A group of related fields, such as the student s name, the course taken, the date, and the grade, makes up a record ; a group of records of the same type is called a file. F or example, the records in Figure 6-1 could constitute a student course file. A group of related files makes up a database. The student course file illustrated in Figure 6-1 could be grouped with files on students personal histories and financial backgrounds to create a student database. A record describes an entity. An entity is a person, place, thing, or event about which we store and maintain information. Each characteristic or quality describing a particular entity is called an attribute. For example, Student_ID, Course, Date, and Grade are attributes of the entity COURSE. The specific values that these attributes can have are found in the fields of the record describing the entity COURSE.
6 Chapter 6 Databases and Information Management 179 F IGURE 6-1 The data hierarchy. P roblems with the Traditional File Environment I n most organizations, systems tended to grow independently without a company-wide plan. Accounting, finance, manufacturing, human resources, and sales and marketing all developed their own systems and data files. Figure 6-2 illustrates the traditional approach to information processing. E ach application, of course, required its own files and its own computer programs to operate. For example, the human resources functional area might have a personnel master file, a payroll file, a medical insurance file, a pension file, a mailing list file, and so forth until tens, perhaps hundreds, of files and programs existed. In the company as a whole, this process led to multiple m aster files created, maintained, and operated by separate divisions or departments. As this process goes on for five or ten years, the organization is saddled with hundreds of programs and applications that are very difficult to maintain and manage. The resulting problems are data redundancy and inconsistency, program data dependence, inflexibility, poor data security, and an inability to share data among applications. D ata Redundancy and Inconsistency Data redundancy is the presence of duplicate data in multiple data files so that the same data are stored in more than one place or location. Data redundancy occurs when different groups in an organization independently collect the same piece of data and store it independently of each other. Data redundancy wastes storage resources and also leads to data inconsistency, i n which the same attribute may have different values. For example, in instances of the entity COURSE illustrated in Figure 6-1, the Date field might be updated in some systems but not in others. The same attribute, Student_ID, might also have different field names in different systems in the organization. Some systems might use Student_ID and others might use ID, for example. A dditional confusion might result from using different coding systems to represent values for an attribute. For instance, the sales, inventory, and manufacturing systems of A computer system organizes data in a hierarchy that starts with the bit, which represents either a 0 or a 1. Bits can be grouped to form a byte to represent one character, number, or symbol. Bytes can be grouped to form a fi eld, and related fi elds can be grouped to form a record. Related records can be collected to form a fi le, and related fi les can be organized into a database. Data redundancy Data inconsistency
7 180 Part II Information Technology Infrastructure F IGURE 6-2 Traditional file processing. T he use of a traditional approach to fi le processing encourages each functional area in a corporation to develop specialized applications. Each application requires a unique data fi le that is likely to be a subset of the master fi le or simply a fi le that is managed separately. These subsets of the master fi le lead to data redundancy and inconsistency, processing infl exibility, and wasted storage resources. a clothing retailer might use different codes to represent clothing size. One system might represent clothing size as extra large while another might use the code XL for the same purpose. The resulting confusion would make it difficult for companies to create customer relationship management, supply chain management, or enterprise systems that integrate data from different sources. P rogram Data Dependence Program data dependence refers to the coupling of data stored in files and the specific programs required to update and maintain those files so that changes in programs require changes to the data. Every traditional computer program has to describe the location and nature of the data with which it works. In a traditional file environment, any change in a software program could require a change in t he data accessed by that program. One program might be modified from a six-digit to a seven-digit postal code to incorporate the space between the first three and last three characters. If the original data file were changed from six-digit to seven-digit postal codes, other programs that required the six-digit postal code would no longer work properly. These changes would cost millions of dollars to implement properly. L ack of Flexibility A traditional file system can deliver routine scheduled reports after extensive programming efforts, but it cannot deliver ad hoc reports or respond to unanticipated information requirements in a timely fashion. The information required by ad hoc requests is somewhere in the system but may be too expensive to retrieve. Several programmers might have to work for weeks to put together the required data items in a new file. P oor Security Because there is little control or management of data, access to and dissemination of information may be out of control. Management may have no way of knowing who is accessing or even making changes to the organization s data. Program data dependence L ack of Data Sharing and Availability Because pieces of information in different files and different parts of the organization cannot be related to one another, it is virtually impossible for information to be shared or accessed in a timely manner. Information cannot flow freely across different functional areas or different parts of the organization. If users find different values of the same piece of information in two different systems, they might not want to use these systems because they cannot trust the accuracy of their data.
8 6.2 The Database Approach to Data Management D atabase technology cuts through many of the problems of traditional file organization. A more rigorous definition of a database is a collection of data organized to serve many applications efficiently by centralizing the data and managing redundant data. Rather than storing data in separate files for each application, data are stored so as t o appear to users as being stored in only one location. A single database services multiple applications. For example, instead of a corporation storing employee data in separate information systems and separate files for personnel, payroll, and benefits, the corporation could create a single common human resources database. D atabase Management Systems A database management system (DBMS) is software that permits an organization to centralize data, manage them efficiently, and provide access to the stored data by application programs. The DBMS acts as an interface between application programs and the physical data files. When the application program calls for a data item, such as g ross pay, the DBMS finds this item in the database and presents it to the application program. Using traditional data files, the programmer would have to specify the size and format of each data element used in the program and then tell the computer where they were located. T he DBMS relieves the programmer or end user from the task of understanding where and how the data are actually stored by separating the logical and physical views of the data. The logical view presents data as they would be perceived by end users or business specialists while the physical view shows how data are actually organized and structured on physical storage media. T he database management software makes the physical database available for different logical views required by users. For example, for the human resources database illustrated in Figure 6-3, a benefits specialist might require a view consisting of the employee s name, social insurance number, and supplemental health insurance coverage. A payroll department member might need data such as the employee s name, social insurance number, gross pay, and net pay. The data for all these views are stored in a single database where they can be more easily managed by the organization. H ow a DBMS Solves the Problems of the Traditional File Environment A DBMS reduces data redundancy and inconsistency by minimizing isolated files in which the same data are repeated. The DBMS may not enable the organization to eliminate data redundancy F IGURE 6-3 Human resources database with multiple views. Chapter 6 Databases and Information Management 181 Database (rigorous definition) Database management system (DBMS) Logical view Physical view A single human resources database provides many different views of data, depending on the information requirements of the user. Illustrated here are two possible views, one of interest to a benefi ts specialist and one of interest to a member of the company s payroll department.
9 182 Part II Information Technology Infrastructure Relational DBMS entirely, but it can help control redundancy by integrating various files into one DBMS. Even if the organization maintains some redundant data, using a DBMS eliminates data inconsistency because the DBMS can help the organization ensure t hat every occurrence of redundant data has the same values. The DBMS uncouples programs and data, enabling data to stand on their own. Access and availability of information will be increased and program development and maintenance costs reduced because users and programmers can perform ad hoc queries of data in the database. The DBMS enables the organization to centrally manage data, their use, and security through the use of a data dictionary (see below). R elational DBMS Contemporary DBMS use different database models to keep track of entities, attributes, and relationships. The most popular type of DBMS today for PCs as well as for larger computers and mainframes is the relational DBMS. Relational databases represent data as two-dimensional tables (called relations). Tables are also referred to as files. Each table contains data on an entity and its attributes. Microsoft Access is a relational DBMS for desktop systems while DB2, Oracle Database, and Microsoft SQL Server are relational DBMS for large mainframes and midrange computers. MySQL is a popular open-source DBMS, and Oracle Database Lite is a DBMS for small handheld computing devices. L et us look at how a relational database organizes data about suppliers and parts (see Figure 6-4). The database has a separate table for the entity SUPPLIER and a table for the entity PART. Each table consists of a grid of columns and rows of data. Each individual F IGURE 6-4 Relational database tables. A relational database organizes data in the form of two-dimensional tables. Illustrated here are tables for the entities SUPPLIER and PART showing how they represent each entity and its attributes. Supplier_Number is a primary key for the SUPPLIER table and a foreign key for the PART table.
10 element of data for each entity is stored as a s eparate field, and each field represents an attribute for that entity. Fields in a relational database are also called columns. For the entity SUPPLIER, the supplier identification number, name, street, city, province, and postal code are stored as separate fields within the SUPPLIER table, and each field represents an attribute for the entity SUPPLIER. T he actual information about a single supplier that resides in a table is called a row. Rows are commonly referred to as records, or in very technical terms, as tuples. Data for the entity PART have their own separate t able. The field for Supplier_Number in the SUPPLIER table uniquely identifies each record so that the record can be retrieved, updated, or sorted, and it is called a key field. Every table in a relational database has one field designated as its primary key. This key field is the unique identifier for all the information in any row of the table, and this primary key cannot be duplicated. Supplier_Number is t he primary key for the SUPPLIER table, and Part_Number is the primary key for the PART table. Note that Supplier_Number appears in both the SUPPLIER and PART tables. In the SUPPLIER table, Supplier_ Number is the primary key. When the field Supplier_Number appears in the PART table, it is called a foreign key and is essentially a lookup field to look up data about the supplier of a specific part. O perations of a Relational DBMS Relational database tables can be combined easily to deliver data required by users, provided that any two tables share a common data element. Suppose we wanted to find in this database the names of suppliers who could provide us with part number 137 or part number 150. We would need information from two tables: the SUPPLIER table and the PART table. Note that these two files have a shared data element: Supplier_Number. I n a relational database, three basic operations, as shown in Figure 6-5, are used to develop useful sets of data: select, join, and project. The select operation creates a subset consisting of all records in the file that meet stated criteria. Select creates, in other words, a subset of rows that meet certain criteria. In our example, we want to select records ( rows) from the PART table where the Part_Number equals 137 or 150. The join operation combines relational tables to provide the user with more information than is available in individual tables. In our example, we want to join the now-shortened PART table (only parts 137 or 150 will be presented) and the SUPPLIER table into a single new table. T he project operation creates a subset consisting of columns in a table, permitting the user to create new tables that contain only the information required. In our example, we want to extract from the new table only the following columns: Part_Number, Part_Name, Supplier_Number, and Supplier_Name. F IGURE 6-5 The three basic operations of a relational DBMS. Chapter 6 Databases and Information Management 183 Records (in relational database) Tuple Key field Primary key Foreign key T he select, join, and project operations enable data from two different tables to be combined and only selected attributes to be displayed.
11 184 Part II Information Technology Infrastructure Object-oriented DBMS Object-relational DBMS Data definition O bject-oriented DBMS Many applications today require databases that can store and retrieve not only structured numbers and characters, but also drawings, images, photographs, voice, and full-motion video. DBMS designed for organizing structured data into rows and columns are not well suited to handling graphics-based or multimedia applications. Object-oriented databases are better suited for this purpose. A n object-oriented DBMS stores the data and procedures that act on those data as objects that can be automatically retrieved and shared. Object-oriented database management systems (OODBMS) are becoming popular because they can be used to manage the various multimedia components or Java applets used in Web applications, which typically integrate pieces of information from a variety of sources. A lthough object-oriented databases can store more complex types of information than relational DBMS, they are relatively slow compared with relational DBMS for processing large numbers of transactions. Hybrid object-relational DBMS systems are now available to provide capabilities of both object-oriented and relational DBMS. D atabases in the Cloud Suppose your company wants to use cloud computing services. Is there a way to manage data in the cloud? The answer is a qualified Yes. Cloud computing providers offer database management services, but these services typically have less functionality than their on-premises counterparts. At the moment, the primary customer base for cloud-based data management consists of Web-focused startups or small to medium-sized businesses looking for database capabilities at a lower price than a standard relational DBMS. A mazon Web Services has both a simple non-relational database called SimpleDB and a Relational Database Service, which is based on an online implementation of the MySQL open source DBMS. Amazon Relational Database Service (Amazon RDS) offers the full range of capabilities of MySQL. Pricing is based on usage. (Charges run from 11 cents per hour for a s mall database using 1.7 GB of server memory to $3.10 per hour for a large database using 68 GB of server memory.) There are also charges for the volume of data stored, the number of input output requests, the amount of data written to the database, and the amount of data read from the database. A mazon Web Services additionally offers Oracle customers the option to license Oracle Database 11g, Oracle Enterprise Manager, and Oracle Fusion Middleware to run on the Amazon EC2 (Elastic Cloud Compute) platform. M icrosoft SQL Azure Database is a cloud-based relational database service based on Microsoft s SQL Server DBMS. It provides a highly available, scalable database service hosted by Microsoft in the cloud. SQL Azure Database helps reduce costs by integrating with existing software tools and providing symmetry with on-premises and cloud databases. T icketdirect, which sells tickets to concerts, sporting events, theatre performances, and movies in Australia and New Zealand, adopted the SQL Azure Database cloud platform in order to improve management of peak system loads during major ticket sales. It migrated its data to the SQL Azure database. By moving to a cloud solution, TicketDirect is able to scale its computing resources in response to real-time demand while keeping costs low. O f course, there is a downside to using databases located in the cloud. When the cloud is down or unavailable, businesses cannot access their data. Recently, Amazon s cloud was down for a period that ranged from 11 hours to five days for their customers that used some of their Eastern-U.S.-based Elastic Cloud Computer ( EC2) services. What would your company do if its cloud-based databases were unavailable? What sort of backup data would you need? Where would it be stored, and how would it be accessed? These are just some of the questions to be answered before putting critical databases on the cloud. C apabilities of Database Management Systems A DBMS includes tools for organizing, managing, and accessing the data in the database. The most important are its data definition language, data dictionary, and data manipulation language. D BMS have a data definition capability to specify the structure of the content of the database. It would be used to create database tables and to define the characteristics of the
12 Chapter 6 Databases and Information Management 185 F IGURE 6-6 Microsoft Access data dictionary features. fields in each table. This information about the database would be documented in a data dictionary, an automated or manual file that stores definitions of data elements and their characteristics. M icrosoft Access has a rudimentary data dictionary capability that displays information about the name, description, size, type, format, and other properties of each field in a table (see Figure 6-6). Data dictionaries for large corporate databases may capture additional information, such as usage; ownership (who in the organization is responsible for maintaining the data); authorization; security; and the individuals, business functions, programs, and reports that use each data element. Q uerying and Reporting DBMS include tools for accessing and manipulating information in databases. Most DBMS have a specialized language called a data manipulation language that is used to add, change, delete, and retrieve the data in the database. T his language contains commands that permit end users and programming specialists to extract data from the database to satisfy information requests and develop applications. The most prominent data manipulation language today is Structured Query Language, or SQL. Figure 6-7 illustrates the SQL query that would produce the new table in Figure 6-5. You can find out more about how to perform SQL queries in our Learning Tracks for this chapter. U sers of DBMS for large and midrange computers, such as DB2, Oracle, or SQL Server, would use SQL to retrieve information they need from a database. Microsoft Access also uses SQL, but it provides its own set of user-friendly tools for querying databases (known as Query by Example or QBE) and for organizing data from databases into more polished reports. F IGURE 6-7 An SQL query. M icrosoft Access has a rudimentary data dictionary capability that displays information about the size, format, and other characteristics of each fi eld in a database. Displayed here is the information maintained in the SUPPLIER table. The small key icon to the left of Supplier_ Number indicates that it is a key fi eld. Data dictionary Data manipulation language Structured Query Language (SQL) I llustrated here are the SQL statements for a query to select suppliers for parts 137 or 150. They produce a list with the same results as Figure 6-5.
13 186 Part II Information Technology Infrastructure F IGURE 6-8 A Microsoft Access query. I llustrated here is how the query in Figure 6-7 would be constructed using Microsoft Access querybuilding tools. It shows the tables, fi elds, and selection criteria used for the query. I n Microsoft Access, you will find features that enable users to create queries by identifying the tables and fields they want and the results, and then selecting the rows from the database that meet particular criteria. These actions in turn are translated into SQL commands. Figure 6-8 illustrates how the same query as the SQL query to select parts and suppliers would be constructed using the Microsoft query-building tools. M icrosoft Access and other DBMS include capabilities for report generation, so that the data of interest can be displayed in a more structured and polished format than would be possible just by querying. Crystal Reports, a popular report generator for large corporate DBMS, can be used with Access. Access also has capabilities for developing desktop system applications. These include tools for creating data entry screens, reports, and developing the logic for processing transactions. D esigning Databases T o create a database, you must understand the relationships among the data, the type of data that will be maintained in the database, how the data will be used, and how the organization will need to change to manage data from a company-wide perspective. The database requires both a conceptual design and a physical design. The conceptual, or logical, design of a database is an abstract model of the database from a business perspective; the physical design shows how the database is actually arranged on direct-access storage devices. N ormalization and Entity-Relationship Diagrams The conceptual database design describes how the data elements in the database are to be grouped. The design process identifies relationships among data elements and the most efficient way of grouping data elements to meet business information requirements. The process also identifies redundant data elements and the groupings of data elements required for specific application programs. Groups of data are organized, refined, and streamlined until an overall logical view of the relationships among all the data in the database emerges. T o use a relational database model effectively, complex groupings of data must be streamlined to minimize redundant data elements and awkward many-to-many relationships. The
14 Chapter 6 Databases and Information Management 187 F IGURE 6-9 An unnormalized relation for ORDER. A n unnormalized relation contains repeating groups. For example, there can be many parts and suppliers for each order. There is only a one-to-one correspondence between Order_Number and Order_Date. process of creating small, stable, yet flexible and adaptive data structures from complex groups of data is called normalization. Figures 6-9 and 6-10 illustrate this process. I n the particular business modelled here, an order can have more than one part, but each part is provided by only one supplier. If we build a relation called ORDER with all the fields included here, we would have to repeat the name and address of the supplier for every part on the order, even though the order is for parts from a single supplier. This relationship contains repeating data groups, so called because there c an be many parts on a single order to a given supplier. A more efficient way to arrange the data is to break down ORDER into smaller relations, each of which describes a single entity. If we go step by step and normalize the relation ORDER, we emerge with the relations illustrated in Figure You can find out more about normalization, entity-relationship diagramming, and database design in the Learning Tracks for this chapter. R elational database systems try to enforce referential integrity rules to ensure that relationships between coupled tables remain consistent. When one table has a foreign key that points to another table, you may not add a record to the table with the foreign key unless there is a corresponding record in the linked table. In the database we examined earlier in this chapter, the foreign key Supplier_Number links the PART table to the S UPPLIER table. We may not add a new record to the PART table for a part with Supplier_Number 8266 unless there is a corresponding record in the SUPPLIER table for Supplier_Number We must also delete the corresponding record in the PART table if we delete the record in the SUPPLIER table for Supplier_Number In other words, we should not have parts from nonexistent suppliers! D atabase designers document their data model with an entity-relationship diagram, illustrated in Figure This diagram illustrates the relationships among the entities SUPPLIER, PART, LINE_ITEM, and ORDER. The boxes represent entities. The lines connecting the boxes represent relationships. A line connecting two entities that ends in F IGURE 6-10 Normalized tables created from ORDER. Normalization Repeating data groups Referential integrity Entity-relationship diagram A fter normalization, the original relation ORDER has been broken down into four smaller relations. The relation ORDER is left with only two attributes and the relation LINE_ITEM has a combined, or concatenated, key consisting of Order_Number and Part_Number.
15 188 Part II Information Technology Infrastructure F IGURE 6-11 An entity-relationship diagram. T his diagram shows the relationships among the entities SUPPLIER, PART, LINE_ITEM, and ORDER that might be used to model the database in Figure two short marks designates a one-to-one relationship. A line connecting two entities that ends w ith a crow s foot topped by a short mark indicates a one-to-many relationship. Figure 6-11 shows that one ORDER can contain many LINE_ITEMs. (A PART can be ordered many times and appear many times as a line item in a single order.) Each PART can have only one SUPPLIER, but many PARTs can be provided by the same SUPPLIER. I t cannot be emphasized enough: if the business does not get its data model right, the system will not be able to serve the business well. The company s systems will not be as effective as they could be because they will have to work with data that may be inaccurate, incomplete, or difficult to retrieve. Understanding the organization s data and how they should be represented in a database is perhaps the most important lesson you can learn from this course. F or example, Famous Footwear, a shoe store chain with more than 1100 locations in the 50 states and 300 stores in Canada under the Naturalizer, F.X. La Salle, Franco Sarto, and Brown Shoe Closet names, could not achieve its goal of having the right style of shoe in the right store for sale at the right price because its database was not properly designed for rapidly adjusting store inventory. The company had an Oracle relational d atabase running on an IBM AS/ 400 midrange computer, but the database was designed primarily for producing standard reports for management rather than for reacting to marketplace changes. Management could not obtain precise data on specific items in inventory in each of its stores. The company had to work around this problem by building a new database in which the sales and inventory data could be better organized for analysis and inventory management. 6.3 Using Databases to Improve Business Performance and Decision Making B usinesses use their databases to keep track of basic transactions, such as paying suppliers, processing orders, keeping track of customers, and paying employees. But they also need databases to provide information that will help the company run the business more efficiently and help managers and employees make better decisions. If a company wants to know which product is the most popular or who its most profitable customer is, the answer lies in the data. See Chapter 11 for more on how businesses can manage their knowledge bases. F or example, Canada Post saved millions of dollars last year alone through its use of the software, according to Brian Shea, the organization s general manager, business analytics and revenue management. While using analytics to hone its pricing, Canada Post also extracted value in other areas, such as marketing automation and health and safety, said Shea. This allowed the team to predict who was likely to have an accident in the workplace, and how long injured workers would be off the job. I n a large company, with large databases or large systems for separate functions, such as manufacturing, sales, and accounting, special capabilities and tools are required for analyzing vast quantities of data and for accessing data from multiple systems. These capabilities include data warehousing, data mining, and tools for accessing internal databases through the Web.
16 D ata Warehouses S uppose you want concise, reliable information about current operations, trends, and changes across the company. If you worked in a large company, obtaining this might be difficult, because data are often maintained in separate systems, such as sales, manufacturing, or accounting. Some of the data you need might be found in the sales system and other pieces in the manufacturing system. Many of these systems are older legacy systems that use outdated data management technologies or file systems in which information is difficult to access. Y ou might spend an inordinate amount of time locating and gathering the data you need, or be forced to make your decision on the basis of incomplete knowledge. If you want information about trends, you might also have trouble finding data about past events because most firms only make their current data immediately available. Data warehousing addresses these problems. W hat Is a Data Warehouse? A data warehouse is a database that stores current and historical data of potential interest to decision makers throughout the company. The data originate in many core operational transaction systems, such as systems for sales, customer accounts, and manufacturing, and may include data from Web site transactions. The data warehouse consolidates and standardizes information from different operational databases so that the information can be used across the enterprise for management analysis and decision making. F igure 6-12 illustrates how a data warehouse works. The data warehouse makes the data available for anyone to access as needed, but it cannot be altered. A data warehouse system also provides a range of ad hoc and standardized query tools, analytical tools, and graphical reporting facilities. Many firms use intranet portals to make the data warehouse information widely available throughout the firm. P etro-canada established its data warehouse just a few years ago. Store associates, who manage the stores independently and own their store s inventory, are most interested in their cash flow, which means they must closely manage inventory levels; understand the impact of promotions and price changes; and manage operating expenses, receivables, and payables. Today, they are also able to compare performance to prior months, quarters, and years, analyze trends, and make course corrections. The data warehouse also simplified access to information for multi-unit operators. These associates can now compare performance across all stores for which they are responsible. F IGURE 6-12 Components of a data warehouse. Chapter 6 Databases and Information Management 189 Data warehouse T he data warehouse extracts current and historical data from multiple operational systems inside the organization. These data are combined with data from external sources and reorganized into a central database designed for management reporting and analysis. The information directory provides users with information about the data available in the warehouse.
17 190 Part II Information Technology Infrastructure Data mart Online analytical processing (OLAP) H SBC Bank Canada is the largest foreign-owned bank and the seventh-largest bank in Canada. When HSBC Bank Canada implemented its data warehouse, it had to clean and consolidate its data. The bank then developed applications to access the data in the warehouse, primarily for customer relationship management and cross-selling to current customers. Reports that used t o take weeks to prepare are now finished in minutes. Analysis can be done across an entire household, not just at the individual customer level. The bank also gave its branch marketing personnel access to appropriate portions of the data warehouse, enabling the branch personnel to more effectively support their customers. D ata Marts Although companies often build a central data warehouse that serves the entire organization, they might decide to create smaller, decentralized warehouses. Each of these data marts is a subset of the data warehouse in which a summarized or highly focused portion of the organization s data is put in a separate database for a s pecific population of users. For example, a company might develop marketing and sales data marts to deal with customer information. A data mart, focused as it is on a single subject area or line of business, can usually be constructed more rapidly and at lower cost than a central data warehouse. T ools for Business Intelligence: Multidimensional Data Analysis and Data Mining O nce data have been captured and organized in data warehouses and data marts, they are available for further analysis using tools for business intelligence, which we introduced briefly in Chapter 2. Business intelligence tools enable users to analyze data to see new patterns, relationships, and insights that are useful for guiding decision making. P rincipal tools for business intelligence include software for database querying and reporting, tools for multidimensional data analysis (online analytical processing), and tools for data mining. This section will introduce you to these tools, with more detail about business intelligence analytics and applications in the Chapter 12 discussion of decision making. O nline Analytical Processing (OLAP) Suppose your company sells four different products nuts, bolts, washers, and screws in the East, West, and Prairies regions. If you wanted to ask a fairly straightforward question, such as how many washers were sold during the past quarter, you could easily find the answer by querying your sales database. But what if you wanted to know how many washers sold in each of your sales regions and compare actual results with projected sales? T o obtain the answer, you would use online analytical processing (OLAP). OLAP supports multidimensional data analysis, enabling users to view the same data in different ways using multiple dimensions. Each aspect of information product, pricing, cost, region, or time period represents a different dimension. So a product manager could use a multidimensional data analysis tool to learn how many washers were s old in the East in June, how that compares with the previous month and the previous June, and how it compares with the sales forecast. OLAP enables users to obtain online answers to ad hoc questions such as these fairly rapidly, even when the data are stored in very large databases, such as sales figures for multiple years. F igure 6-13 shows a multidimensional model that might be created to represent products, regions, actual sales, and projected sales. A matrix of actual sales can be stacked on top of a matrix of projected sales to form a cube with six faces. If you rotate the cube 90 degrees one way, the face showing will be product versus actual and projected sales. If you rotate the cube 90 degrees again, you will see region versus actual and projected sales. If you rotate 180 degrees from the original view, you will see projected sales and product versus region. Cubes can be nested within cubes to build complex views of data. A company would use either a specialized multidimensional database or a tool that creates multidimensional views of data in relational databases.
18 Chapter 6 Databases and Information Management 191 F IGURE 6-13 Multidimensional data model. PRODUCT Projected Actual Nuts Bolts Washers Screws East West REGION Prairies D ata Mining Traditional database queries answer such questions as, How many units of product number 403 were shipped in February 2010? OLAP, or multidimensional analysis, supports much more complex requests for information, such as Compare sales of product 403 relative to plan by quarter and sales region for the past two years. With OLAP and query-oriented data analysis, users need to have a good idea about the information for which they are looking. D ata mining is more discovery-driven. Data mining provides insights into corporate data that cannot be obtained with OLAP by finding hidden patterns and relationships in large databases and inferring rules from them to predict future behaviour. The patterns and rules are used to guide decision making and forecast the effect of those decisions. The types of information obtainable from data mining include associations, sequences, classifications, clusters, and forecasts. Associations are occurrences linked to a single event. For instance, a study of supermarket purchasing patterns might reveal that when corn chips are purchased, a cola drink is purchased 65 percent of the time, but when there is a promotion, cola is purchased 85 percent of the time. This information helps managers make better decisions because they have learned the profitability of a promotion. In sequences, events are linked over time. We might find, for example, that if a house is purchased, a new refrigerator will be purchased within two weeks 65 percent of the time, and an oven will be bought within one month of the home purchase 45 percent of the time. Classification recognizes patterns that describe the group to which an item belongs by examining existing items that have been classified and by inferring a set of rules. For example, businesses such as credit card or telephone companies worry about the loss of steady customers. Classification helps discover the characteristics of customers who are likely to leave and can provide a model to help managers predict who those customers are so that the managers can devise special campaigns to retain such customers. Clustering works in a manner similar to classification when no groups have yet been defined. A data mining tool can discover different groupings within data, such as finding affinity groups for bank cards or partitioning a database into groups of customers based on demographics and types of personal investments. Although these applications involve predictions, forecasting uses predictions in a different way. It uses a series of existing values to forecast what other values will be. For example, forecasting might find patterns in data to help managers estimate the future value of continuous variables, such as sales figures. T he view that is showing is product versus region. If you rotate the cube 90 degrees, the face will show product versus actual and projected sales. If you rotate the cube 90 degrees again, you will see region versus actual and projected sales. Other views are possible. Data mining
19 192 Part II Information Technology Infrastructure Predictive analytics Text mining Web mining T ext mining is the discovery of patterns and relationships from large sets of unstructured data the kind of data we generate in s, phone conversations, blog postings, online customer surveys, and tweets. The mobile digital platform has amplified the explosion in digital information, with hundreds of millions of people calling, texting, searching, apping (using applications), buying goods, and writing billions of s on the go. C onsumers today are more than just consumers: they have more ways to collaborate, share information, and influence the T hese systems perform high-level analyses of patterns or trends, but they can also drill down to provide more detail when needed. There are data mining applications for all the functional areas of business and for government and scientific work. One popular use for data mining is to provide detailed analyses of patterns in customer data for one-to-one marketing campaigns or for identifying profitable customers. F or example, Virgin Mobile Australia uses a data warehouse and data mining to increase customer loyalty and roll out new services. The data warehouse consolidates data from its enterprise system, customer relationship management system, and customer billing systems in a massive database. Data mining has enabled management to determine the demographic profile of new customers and relate it to the handsets they purchased as well as the performance of each store and point-of-sale campaigns, consumer reactions to new products and services, customer attrition rates, and the revenue generated by each customer. P redictive analytics use data mining techniques, historical data, and assumptions about future conditions to predict outcomes of events, such as the probability that a customer will respond to an offer or purchase a specific product. For example, McMaster University uses predictive analytics from data about energy costs in its buildings to identify underperforming buildings and the causes of energy inefficiencies. T ext Mining and Web Mining Business intelligence tools deal primarily with data that have been structured in databases and files. However, unstructured data, mostly in the form of text files, is believed to account for more than 80 percent of an organization s useful information. , memos, call centre transcripts, survey responses, legal cases, patent descriptions, and service reports are all valuable for finding patterns and trends t hat will help employees make better business decisions. Text mining tools are now available to help businesses analyze these data. These tools are able to extract key elements from large unstructured data sets, discover patterns and relationships, and summarize the information. Businesses might turn to text mining to analyze transcripts of calls to customer service centres to identify major service and repair issues. T ext mining is a relatively new technology, but what is really new are the myriad ways unstructured data are being generated by consumers and the business uses for these data. The Window on Technology explores some of these business applications of text mining. T he Web is another rich source of valuable information, some of which can now be mined for patterns, trends, and insights into customer behaviour. T he discovery and analysis of useful patterns and information from the World Wide Web is called Web mining. Businesses might turn to Web mining to help them understand customer behaviour, evaluate the effectiveness of a particular Web site, or quantify the success of a marketing campaign. For instance, marketers use Google Trends and Google Insights for Search services, which track the popularity of various words and phrases used in Google search queries, to learn what people are interested in and what they are interested in buying. W INDOW ON TECHNOLOGY W HAT CAN BUSINESSES LEARN FROM TEXT MINING? opinions of their friends and peers, and the data they create in doing so have significant value to businesses. Unlike structured data, which are generated from events such as completing a purchase transaction, unstructured data have no distinct form. Nevertheless, managers believe such data may offer unique insights into customer behaviour and attitudes that were much more difficult to determine years ago. R esearchers have used text mining to extract information from Bank of Canada communication statements and