Business Computer Information Systems Student Book Unit 5
BUSINESS COMPUTER INFORMATION SYSTEMS UNIT FIVE Databases Unit 5 Introduction... 1 Unit 5 Goals and Objectives... 1 I. Database Basics... 3 Comparing Databases and Spreadsheets... 3 Understanding Database Terms... 6 Project: Creating a Database... 11 Working with Data and Records... 12 Self Test 1: Database Basics... 16 II. Database Features... 20 Using a Database to Search and Query... 20 Project: Working with Queries... 25 Project: Using a Database to Generate Mailings... 27 Importing & Exporting Data... 28 Project: Using a Database to Create a Business Report... 31 Self Test 2: Database Features... 33 III. Review Databases... 36 IV. Semester Review... 40 Unit 5 Test: Databases... Pull-Out Units 1-5 Semester Exam... Pull-Out i
LIFEPAC Business Computer Information Systems Production Manager: Alan Christopherson Editorial: Managing Editor: Alan Christopherson Copy Editor: Laura Messner Art, Layout, and Design: Layout and Design: Brian Ring, Melissa Fransen Illustration: Brian Ring, Melissa Fransen Cover Design: Ryan Egan Some images that appear in this unit are 2008 JupiterImages Corporation. Screen capture(s) created using OpenOffice.org 2.4.1 courtesy of Sun Microsystems Inc. Copyright 2000 2008 Sun Microsystems Inc. All trademarks and/or service marks referenced in this material are the property of their respective owners. Glynlyon, Inc. makes no claim of ownership to any trademarks and/or service marks other than its own and its affiliates, and makes no claim of affiliation to any companies whose trademarks may be listed in this material, other than its own. LIFEPAC Business Computer and Information Systems Unit 5: Databases 2010 Glynlyon, Inc. Foreword Business Computer Information Systems is a ten-unit high school elective that explores the use of technology applications in both business and personal situations. Occupations have transitioned from those that primarily produced things to those that manipulate and manage information. Whether it is at home, in a factory, at a school, for a business, or in an office, almost everyone today uses many forms of technology on a daily basis. This course will explore the software applications and information technologies that everyone is likely to use in business situations. In this course the students will learn computer terminology, hardware, software, operating systems and information systems that relate to the business environment. The units will concentrate on learning the standard applications of word processing, spreadsheets, database management and graphical presentation packages. In addition, skills in personal and interpersonal communications and in communication technologies will be studied. The course is intended to help students arrive at the following understandings: Effective communication skills and productive work habits can increase employees success. Technology solutions can help employees be more productive and effective. Keyboarding is a stated prerequisite for this course. While there are some keyboarding reviews in the course, there is no keyboarding instruction. Business Computer Information Systems covers topics from TEKS 120.23 and 120.64. Business Computer Information Systems contains the following units: Unit 1 Communication Skills Unit 2 Business Technology Unit 3 Word Processing Unit 4 Spreadsheets Unit 5 Databases Unit 6 Telecommunications Technology Unit 7 Desktop Publishing Technology Unit 8 Presentation Technology 804 N. 2nd Ave. E. Rock Rapids, IA 51246-1789 Unit 9 Computer Networks Unit 10 Computer Operating Systems ii
Unit 5: Databases Introduction This unit will focus on working with a database. You ll learn about what a database is and how it compares to a spreadsheet. After you learn about database basics, you ll turn your attention to its powerful features that can help you manage data and produce business reports. Your goals for the unit include the following: Understand the benefits of using a database. Apply database technology to work with data and records. Perform data management procedures using a database. Use database technology to produce and analyze business reports. The objectives for this unit include the following: Distinguish between a database and a spreadsheet. Describe the functions and purposes of fields, records, and files in databases. Manipulate data and records in a database. Use a database to generate mailings such as address labels and form letters. Conduct a search and a query. Create business reports from a database. 1
Note to Students: The lessons in this unit are intended to provide general information about using database programs to organize and work with information. You will learn the basics involved in creating databases and using them efficiently. You ll also see some ways in which a database can help to organize business and personal information. There are many different database applications on the market, and some programs have commands that are unique to their design. For this reason, the course developers have designed this unit to apply to database programs in general. Some of the demonstrations in this unit were created using Open Office Base. Your database software may use a different process than the one demonstrated. If this is the case, you will need to learn the process used by your software to complete the projects. 2
I. Database Basics Comparing Databases and Spreadsheets Grace worked in a library thirty years ago. When she was given the task of renumbering the library catalogue, she had to do it by hand. There were more than 30,000 cards in the library catalogue to represent the books in the library. The cards were numbered from 1 to 30,000 and her task was to renumber them 0 to 29,999 so that each batch of a hundred cards would start with the same digits. If only those cards had been in a database! With a database, this job, which took her several weeks to complete, could have been done in a matter of seconds. Objectives: List actions a database can perform. List the differences and similarities between a database and a spreadsheet. For a specific business task, select a spreadsheet or a database, based on which is more appropriate. Vocabulary: database - a software program for storing, managing, and retrieving information. query - to ask a question about data. table - rows and columns that are used for organizing data. Let s define exactly what a database is. A database is powerful software for storing, managing, and retrieving information. Databases do so through the use of tables. Just as with spreadsheets, databases organize data in columns and rows. Spreadsheets are used to manage and manipulate numbers, whereas databases are used to manage and manipulate information. However, databases are actually much more powerful than spreadsheets at manipulating data. Here are just a few of the actions that you can perform in a database that would be difficult to perform in a spreadsheet: Retrieve all data that match certain criteria. Update information in more than one place at the same time. Compare data. Create data entry forms so you can easily enter information. Merge data with text in a word processing document. Query the database. In other words, ask questions about the data. Produce flexible reports, both on screen and on paper, that make it easy to comprehend the information stored in the database. As you will see, databases do extremely well at managing and manipulating information. Let s look at how these actions work on a simple database. For this example, let s use a list of students in a school. The database would contain the same set of data or structured information for each student last name, first name, homeroom teacher, and contact information. The student database may be viewed in datasheet view like this. Perform complex calculations on different sets of data at the same time. Validate the data entered and check for inconsistencies. Sort and manipulate the data in the database. 3
What actions can you take with this simple database? You can retrieve all students that are in Mr. Reid s class and print the list. Or if Mr. Reid retires and a new teacher is hired, you could update the homeroom teacher for all students in that homeroom at the same time. You could also perform the action of sorting the data in a database. You could choose to sort alphabetically by last name. This means that after sorting, the students would appear in alphabetical order by last name. You could also sort by homeroom teacher. This means that the students in Mrs. Deforge s class would be grouped together as would the students in Mrs. Muntz s class. These are just a few of the actions you could perform on this database. Database or Spreadsheet: Which Should You Use? There are many times when you could use either a database or a spreadsheet to complete the same task. If the task involves numbers and calculations, think spreadsheet. Remember, spreadsheets typically contain financial information and numbers. A spreadsheet may be used to track stock, calculate a loan payment, find averages, and compute just about any math problem. If the task involves a large quantity of information, think database. Furthermore, when one hundred new students enter the school at the beginning of the school year, the staff may want to use a data entry form to make it easier to enter the students names and information. So far, you have learned that databases can be looked at in datasheet view and in data entry form view. The great thing about databases is that you can look at the data in different formats or views such as the design view or report view. The design view allows you to design a database. In other words, in design view you can decide where the data will appear on the screen. You can drag labels and fields to the desired locations. This is an example of the design view. Another way to help distinguish a database from a spreadsheet is in terms of what sort of information you can get out of it. A spreadsheet helps you answer questions such as Can I afford the monthly payments on that $290,000 house? or What s the average daily rainfall for the first six months of this year? or If we increase our sales of widgets by four percent while reducing the price by a dollar a piece, how will it affect profits? Spreadsheets are extremely useful for answering financial, numerical, and statistical questions such as these. You can ask quite different questions of a database. For example, What are the phone numbers and addresses of the five nearest post offices? or Do we have any books in our library that are about tarantulas? If so, on which shelves are they located? or Show me the personnel records and sales figures of our five bestperforming salespeople for the current quarter. Employees in the workplace, when given a task, need to decide whether to use a spreadsheet or a database to complete the task. Review the following scenarios and decide whether a spreadsheet or a database should be used to complete the task. Uses of a Database What else could a database be used for? Computer databases typically contain collections of data records or files, such as sales transactions, product catalogs and inventories, and customer profiles. Other examples of databases are club membership lists, library catalogues, business card files, and parts inventories. The list could continue on and on. You can use a database to do anything from tracking the results of market research to collecting information from the Mars Rover. Your Turn Please refer to the media CD to complete Spreadsheet or Database? 4
Lets Review! In this lesson, you reviewed what a database is and how it compares to a spreadsheet. Both spreadsheets and databases use tables to organize data. However, a spreadsheet is used for finances, numbers, and calculations. A database is used to store, manage, and retrieve information. True or False 1.1 True/False A spreadsheet is a software program for storing, managing, and retrieving information. Multiple Select 1.2 Select all actions that a database may perform. A. Update information in more than one place at the same time. B. Write a business letter. C. Create data entry forms. D. Find the average of four numbers. E. Validate the data entered and check for inconsistencies. F. Sort and manipulate the data in the database. G. Conduct a query. Multiple Choice 1.3 The following database is displayed in. A. data entry form view B. datasheet view C. design view D. query view 5
Multiple Choice 1.4 Sarah wants to calculate how much of a profit she would make on producing and selling a new product. Sarah should use a. A. database B. word processor C. spreadsheet D. data entry form 1.5 Carolyn would like to store and retrieve data about products in her catalogue. She should use a(n). A. database B. word processor C. spreadsheet D. invoice Understanding Database Terms Imagine that you are trying to follow a recipe to create a new dish. However, the directions contain these words: pecorino, turmeric, cardamom, and minced. If you find it difficult to understand the words that appear in the recipe, it will be hard to make the dish. The same is true for working with a database. There are just a few important words to understand before you start creating one. Objectives: Differentiate between fields, records, and files. Plan and build a simple database. Vocabulary: data entry - the process of getting information into a database. field - one of the categories in a database record, such as last name. They correspond to columns in a table. file - a group of records. key field - the primary field used to uniquely identify records. It may be used to sort records in alphabetical order. record - one set of data or complete entry in a database. They correspond to rows in a table. 6
Let s consider a database that you are already familiar with the phone book. The phone book contains several items of information (name, address, and phone number) about people who have phones in a particular area. Using database vocabulary, the phone book is a file that contains a record for each person. Each row corresponds to a single record. Each column represents a different field. In this example, Adams, G. 123 Harris Ave 289-4335 is the first record. And the fields are: name, address, and phone number. In this example, the records are sorted alphabetically by the name field, which is the key field. Now imagine that you are building a database table that contains contact information for your business, which has fifty employees. You d end up with a table that contains fifty rows with names and telephone numbers. You would probably set up columns named Employee ID Number, First Name, Last Name, and Telephone Number. These would be your fields. Then you d simply start adding rows under those columns that contain the data you re planning to store. These would be your records. Since the employee ID number is unique, this would be your key field. The group of records together makes up a file. In other words, a file is a single table with records and fields. The phone book database and the contact information database are both examples of the simplest form of a database with a single table. However, some types of databases are more complex and have multiple tables. A relational database, for example, is made up of two or more tables of information, which are connected in some way. The example below is a relational database used to track reviews of Internet sites. The first table contains information about the Web site. The second table contains company information. And the third table contains information about the person that reviewed the Web site. These three tables are in the same database and are connected. To define the relationship between tables, you would link them together by a common field. In the illustration below, you can see Table 1 and Table 2 have the field Company Name in common. Table 1 and Table 3 have the field Site Name in common. Planning a Database There s one important thing you need to do before you create a database plan. Whether it s a simple database or a database with multiple tables, you need to look at the information you want to store and the ways in which you want to retrieve that information before you start creating it. A poorly structured database will be a problem when you try to retrieve information, create reports, or sort. Follow these steps when designing your database: 1. Write down the fields you think you need on a piece of paper. 2. Test the fields with some records and actions you will be using in the actual database. 3. Revise the fields as needed. Let s try out these steps. Imagine you were going to create a contact list in a database. It seems pretty simple, and you decide the fields will be name, address, and phone number. This sounds right, doesn t it? Well, you write the records out on paper as follows. Allen Jones 123 Apple Street 554-2232 Maurice Sullivan 675 Fresno Ave 876-5667 Victor Anderson 114 McClintock Dr 887-3343 You then test one of the actions you will need to perform in the database sorting. You would like to sort alphabetically by last name. Does this work with the current fields? No, you would need to divide the name field into two fields: last name and first name. So you revise your fields. You go on to test other actions you would like to take such as printing addresses on envelopes and you find the fields now work, so you move on to creating your database. 7
Creating a Database Now that you have finished planning your database, you are ready to open the database software and create the fields. There are several different database software products available. These include Microsoft Access, FileMaker, Microsoft Works, OpenOffice Base, and My Data Base. Within some of the database software, you ll find built-in templates, sample databases, and wizards that will do much of the hard work for you. Database software products vary significantly from one another, and you may need to consult your user s guide. In general, when creating a database, you ll want to follow these steps: 1. Open the software. is meaningless, it provides a great way to reference an individual record. To set a primary key, before saving your table, follow these steps in design view: 1. Select the appropriate field. 2. Use the primary key command (right-click or select the icon on the tool bar). Adding Records Once you have created the database, you may view the database as a table. It will look like a blank table with just field names at the top. 2. Select a new blank database or database wizard. 3. Name the database. 4. Enter field names and select the type of field (text, number, date, currency, or yes/no). 5. Make one of the fields the primary key. 6. Click Done or save and close. 7. Open the table and add records. Watch the following demonstration. Please refer to the media CD to view Creating a Database. Setting a Primary Key When you create a new database, you ll be asked to identify a key field. The key field is sometimes referred to as a primary key. This primary key will uniquely identify records stored in the table. The selection of a primary key is an important decision you ll make when designing a new database. You must ensure that the selected key or field is unique. If it s possible that two records, now or in the future, will be the same, it s a poor choice for a primary key. For example, choosing the last name field as a primary key is a bad choice. If you currently do not have two entries with the same last name, you may in the future, and that field would no longer be unique. Sometimes, you will not have an obvious unique field to set as the key field. In this case, the database software can generate a unique identifier or number. For example, you might create a field called Record ID or ID Number and let the database assign a unique number. Although the number itself You will need to click in the first empty rectangle to enter the data. Press tab or use your mouse to move your cursor. Once you start entering data in the first row, a new row will appear underneath for your second record. Lets Review! Please refer to the media CD to complete Adding Records. In this lesson, you learned the basic vocabulary associated with databases. This vocabulary includes file, record, field, and key field. This lesson presented you with information for planning and creating a database. 8
Matching 1.6 1. record A. the primary field used to uniquely identify records 2. field B. a group of records 3. key field C. one of the items in a database record, such as last name 4. file D. one set of data or complete entry in a database Multiple Choice 1.7 In the database below, the arrow is pointing to a. A. file B. record C. field D. key field True or False 1.8 True/False Before you start creating a database, you should first use paper to plan, test, and revise. 9
Multiple Choice 1.9 Nicole wants to create a database to collect information about sales transactions. She would like to use the database to look up customer names and sales prices if they return a product. She would also like to retrieve their credit card number in order to reimburse them. In addition, she would like to sort the items in the database by product number. What fields should she have in her database? A. product number, product description, and sales price B. product description, sales price, and employee name C. last name, first name, telephone number, and address D. name, credit card number, product number, and sales price Paragraph 1.10 In five or more sentences, describe how you would create a new database using your software. Teacher Check: Initial Date 10
Project: Creating a Database Imagine that you work for a company that manufactures and sells sportswear. You need a good way to keep track of the products in your inventory. You also need to be able to tell customers what a particular item will cost. Objectives: Create a database to track information for retrieval later. Directions: Let s build a simple database. You will create a database with information about products in a catalog. Plan the database first. As you plan, keep in mind that later you will want to sort this data by product number and retrieve a list of products with a quantity of less than one hundred. You will also need to look up the price and product description. Create the database and populate the database with ten records about any type of products. Save your database. Submit electronically or printed out as instructed by your teacher. Teacher Check: Initial Date 11
Working with Data and Records Typically, many employees use the same database for their job but in different ways. One employee creates the structure of the database. Another employee enters data. One employee retrieves records in certain fields and a different employee retrieves records in other fields. And still another employee checks the accuracy of the data. During this lesson, you ll assume the role of different employees and work with data and records. Objectives: Locate data. Sort data. Update data. Delete records. Add records. Vocabulary: sort - to arrange in a certain order. Imagine that you work for a company that manufactures sporting goods. To manufacture items such as basketballs, soccer goals, and golf clubs, many large machines are used. These machines have parts that need to be replaced on a regular basis. You and your coworkers use a database to track the parts of the various machines. You need to locate part numbers to replace them in the machines. Some of your coworkers need to delete information about parts that are no longer used. Another coworker retrieves data to check to see if it is accurate. And your manager checks the database to make sure there are enough parts available. Let s take a look at how all of this is done. Part Number Description Number in Stock Cost Ordering Information 111098 Hot Chamber-5 7 1989 Widgets Catalogue 111099 Gear 303a 30 562 Email: partsdep@widgets.com 111088 Bracket-2 cm 5 98 call: 1-800-909-4532 111089 Gasket 78 1 456 Email: partsdep@widgets.com 111075 Lever 265 23 65 Widgets Catalogue 111076 Cam-10 cm 87 433 Widgets Catalogue 111078 Cold chamber 13 800 call: 1-800-909-4532 111095 Needle-Size 4 11 45 Email: partsdep@widgets.com 111092 Plate-99 9 57 Widgets Catalogue 111054 Hot-chamber -2 4 1987 call: 1-888-909-7531 111052 Gear-303a 30 562 Email: partsdep@widgets.com 111050 Bracket-5 cm 5 98 Call: 1-800-909-4532 111051 Gasket 20 2 46 Call: 1-888-909-7531 111057 Lever 205 23 61 Call: 1-888-909-7531 111058 Cam - 5cm 8 33 Widgets Catalogue 111049 motor 16 3 110 Call: 1-800-909-4532 111045 Needle-Size 2 4 43 Email: partsdep@widgets.com 111042 Plate -2 9 51 Widgets Catalogue 12
Your Turn First, set up the database so that you can practice locating data, sorting data, updating data and deleting records. Create a database with the information in the preceeding table. Designate the Part Number field as the primary key and save the database as parts. When you've created your database, refer to the CD. Your database should look like the one you see there. Please refer to the media CD to view the completed database. Locating Data You only entered eighteen parts for this example. However, an actual database used in a manufacturing company would most likely have more than a thousand parts. With a database of more than a thousand records, it could be difficult to find the one you are looking for. The find command can be very useful. Suppose you need to order a new lever. You know it is called Lever 265 but you do not know the part number or how to order it. You need to use the find command. There are probably several different ways to use the find command in your database software. In some software, you would follow these steps to locate data: 1. Use the Find command (either a menu option or Ctrl-F on your keyboard). 2. Enter the text and click on the Find or Search button. Watch the following demonstration. Please refer to the media CD to view Finding Records in a Database. Your Turn In your database, use the find command to locate Lever 265. Also take some time to find other data. Sorting Use the same parts database you created in this lesson. Your coworker would like to put the data into ascending order by part number. Ascending order means the data would appear from 0 to 9 or from A to Z. Descending order means the data would appear from 9 to 0 or from Z to A. To put the data in a certain order, you will need to sort. Follow these steps to sort. 1. Click at the top of the appropriate column on the field name. 2. Use the sort ascending or sort descending command or shortcut. The shortcut for ascending is usually an A over a Z with an arrow pointing down. And the shortcut is just the opposite for descending. Watch the following demonstration. Please refer to the media CD to view Sorting Records in a Database. Take some time to practice sorting different columns. Play the role of the manager who needs to check and see if he needs to order any parts. Sort the database in ascending order by number in stock. The top of the list will show the parts that are getting low. Now, use the same parts database to answer the following questions. You will need to sort and locate data to answer these questions. Please refer to the media CD to Sort and Locate Data. Updating Records Your coworker, Zach, has the task of checking to see if the numbers in the database are truly the numbers that exist in the stock room. He locates part number 111076 in the database and notices that it lists eighty-seven are in stock. He finds the actual ten centimeter cams on the shelf in the stock room and counts eighty-five. He returns to the database and finds the appropriate field. He clicks after the seven, presses backspace and types a five, changing eighty-seven to eighty-five. Changing text in a database is just like changing text in a word processor or spreadsheet. Did you know? It is possible to make changes such as font, text style, text color, line color, and background color. In addition, in some database software, you may change the way the grid lines look. 13
Your Turn Your Turn Update record 111076 in your database by changing 87 to 85. See the Editing Records & Fields demonstration if you need help. Deleting and Adding Records Your manager receives a call from the company that makes Gasket 78. They are recalling this gasket due to a defect. They ask your manager to send them back. Now he needs to delete this record from the database. He should select the appropriate record and use the delete command or shortcut. Your Turn Delete the record with Gasket 78 from your database. See the Editing Records & Fields demonstration if you need help. The same company calls a few days later and says they have a new gasket that will replace Gasket 78. They will be sending your manager one new gasket. It is Gasket 101a. Use 111100 as the new part number. Typically there is a blank record at the bottom of the table. You can simply enter the data in this row. If the blank row does not appear, you can insert a new record by using the insert new record command or shortcut. A row will appear at the bottom of the table. Add a field to your database and name it Machine. See the Editing Records & Fields demonstration if you need help. Watch the following demonstration to review how to: update records add or delete records insert or delete a field Lets Review! Please refer to the media CD to review Editing Records & Fields. In this lesson, you learned about working with the data in a database. You learned how to locate data, sort data, update data, delete records, and add records. The following problem set will ask you to apply the skills learned in this lesson. Your Turn Add a new record to your Parts database. The part is Gasket 101a with a part number of 111100. There is only 1 in stock and is the same price as the old Gasket 78. See the Editing Records & Fields demonstration if you need help. Inserting a Field and Deleting a Field Suppose you get an e-mail from your manager letting you know that you need to add a field to the database named Machine. Remember a column in your table corresponds to a field in the database. So in some software, if you need to insert a field, simply insert a column in datasheet view. In other software, you will need to open the database in design view to add a new field. Likewise, deleting a column is also similar. In some software you may simply delete a column in table view. In other software you will need to open the database in design view to delete a field. 14
Multiple Choice 1.11 If you were looking for a record in a very large database and you knew the ID number, which of the following would be the most direct way to locate the record? A. sort B. find C. locate D. filter 1.12 You would like to arrange the records alphabetically. You would. A. delete a record B. locate a record C. sort D. update 1.13 Ben keeps a database for employee contact information. One of his employee s address changed. Ben needs to. A. update the record by editing the address field B. delete the record and insert a new record C. delete the address field D. clear the address field True or False 1.14 True/False If you wanted the item that cost the least at the top of the table, you would sort in descending order. Paragraph 1.15 In 2 3 sentences, describe how you would find a certain record. Teacher Check: Initial Date 15
Self Test 1: Database Basics True or False 1.01 True/False A table is a set of rows and columns that is used for organizing data. Multiple Choice 1.02 Simon would like to make it easier for the employees doing data entry to enter information into the database. Simon should create a. A. record B. table C. database in design view D. data entry form True or False 1.03 True/False Data entry is the process of getting information into a database. Multiple Choice 1.04 Erica is working at a real estate office. She would like to organize the information about houses they have for sale. Erica should use a. A. spreadsheet B. word processor C. database D. Web page 16
Multiple Select 1.05 Select all actions that a database may perform. A. Create a bar graph. B. Sort and manipulate the data. C. Write a business letter. D. Create data entry forms. E. Find the average of four numbers. F. Validate the data entered and check for inconsistencies. G. Update information in more than one place at the same time. H. Conduct a search. Multiple Choice 1.06 Ancler Corporation wants to calculate how much their profits were in the first quarter of the year. They should use a. A. database B. spreadsheet C. word processor D. data entry form True or False 1.07 True/False If you wanted the item that cost the most at the top of the table, you would sort in descending order. 17