6411 COURSE Computer Applications I Unit B Software Applications for Business COMPETENCY 5.00 B2 25% Understand databases used in business. OBJECTIVE 5.01 B2 20% Understand database tables used in business. ESSENTIAL QUESTIONS How is database information used, organized, and managed in business? For what purposes? Teacher Note: Microsoft Access 2003 was used to create the databases in this objective. All graphics in the guide are based on this version. Make adjustments to notes and directions as necessary in accordance with the software version used in your classroom. Database Uses in Business I. Database Use and Purpose – A database is a tool used to organize, store, retrieve, and communicate groups of related information. A. B. Examples of databases and database uses in business and society: 1. a phone book 2. online library card catalog 3. payroll data including employee names, social security numbers, pay rates, exemptions, etc. 4. eBay and other online businesses use databases to maintain inventory and keep track of customers, products, vendors, pay pal accounts Tables are the building blocks of all databases. They are used to group and organize the information within a database. 1. A table is an arrangement of columns and rows. It is the fundamental building block of all databases. a. Example 1: a database for an airline may contain several tables i. ii. 6411 – Computer Applications I Table 1 – Airplane Inventory (a) Airplane identification numbers (b) Dates of service and repair calls (c) Seating capacity Table 2 – Flight Staff (a) Pilot names Summer 2008 Unit B – 5.01 – page 1 (b) (c) b. Example 2: an online store’s database might contain several tables i. ii. iii. iv. Table 1 contains products Table 2 contains prices Table 3 contains manufacturer information Table 4 contains purchase orders 2. An entry is a single piece of data in a database table. Examples of cell entries in a music store database may include the price of a CD, artist’s name, or the number the category of music in which the CD is classified. 3. A field, is a grouping or category of similar information contained in a table 4. II. Contact information License number a. Fields are unique identifiers for categories of information b. In the Airplane inventory example, Plane ID, Service date, and Seats Available are examples of possible field names A record is a complete description of all of the fields related to one item in a table. a. A record is another level of organization in database tables b. In the Airplane inventory example, one record would consist of the Plane ID, Service date, and Seats Available for one plane Data Types, Field Properties, Data Entry, and Printing A. B. Before a database can be built, the user must first define its purpose and determine how the data will be organized into fields. 1. Fields should be formatted in accordance with the data they contain so that the database can be searched, used in calculations, and sorted as needed for communicating. 2. A field name should be short and descriptive Text-based data types and field properties – used for data that will be sorted in alphabetical order or listed randomly, but will not be used in mathematical calculations. For example, in a music store database, the user may wish to sort the database in alphabetical order by artist, CD title, song title, or genre. 1. Yes/No – a data type in toggle format that allows a user to select a yes or no value in a database cell 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 2 C. a. For example, the music store manager may include a field in the database that requires a yes or no response for in stock items b. The default setting is No 2. Caption – a field property used for column naming that allows a more user-friendly and properly formatted field name than that stored in the database design 3. Lookup Wizard – a data type used to define preset values for database entries. a. For example, the music store database might include a lookup wizard which provides a drop down list for the genres of music. b. This feature increases productivity and accuracy by reducing the amount of data entry required. 4. Memo – a data type used for lengthy entries that allows combinations of text and numbers 5. Input Mask – a template-like field property that regulates how data is entered in a cell. For example, if the phone number input mask is used, the user will be prompted to input data in a specific format, such as (919) 555-5555. Number-based data types and field properties – used for data that may be calculated, sorted, or filtered. For example, a music store database may be queried for any quantity on hand that is less than ten so that the store manager can reorder the CDs that the store is running out of. 1. 2. 3. Decimal places – field property used to format numbers for one or more decimal points. a. For example, in a music store database, the store manager may wish to filter the database for all CDs that cost 17.99. b. Without the decimal format, the prices of the CDs would be rounded off. Currency – data type used to format numbers as decimal values with a dollar sign. a. For example, in a music store database, the store manager may wish for the database to print a receipt to each customer which includes the total price of the CD plus tax formatted in currency b. The default format for currency is two decimal places Date – data type used to arrange and sort data chronologically a. For example, the music store manager may wish to view the sales for March only in the database 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 3 b. 4. 5. 6. D. III. Often used with the input mask field property Time – data type used to arrange and sort data chronologically a. For example, the music store manager may want to compare the sales figures for after 5:00 pm against the figures before 12:00 pm. b. Often used with input mask field property Auto Number – used to automatically assign a number to each record and to assist in preventing duplication of data. a. For example, the music store manager used the auto number feature when setting up the database and is notified when a duplicate record is added b. Often used with/as a primary key Primary Key – used to format each record in a database as a unique entity a. For example, the music store manager formatted the auto number field as the primary key b. Primary keys allow database tables to communicate Editing and Printing – Procedures to add and delete records and fields, edit field names, rearrange fields in a database and print. Database Management – The effectiveness of a database can be measured by the user’s ability to retrieve useful information. An effective database is one that contains timely information and thus requires continuous maintenance. Consider the telephone directory and the amount of information that must be gathered, edited, and processed to provide customers with accurate information. Many tools are available to assist in the retrieval, processing, and manipulation of database information. A. Filters allow for the retrieval of information that meets specific criteria. B. Sorts allow for information to be arranged in a specific order such as alphabetical, chronological, ascending, or descending. C. Database Relationships – a link between two or more tables in a database The relationship is developed when common fields in the tables are linked, such as the Customer ID field in a Customer Address table and the Customer ID field in a Purchases table. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 4 1. The relationship enhances the power of the database by allowing retrieval of data from both sources and eliminating the need for data duplication among tables. Three types of relationships: a. One-to-One – when only one record is linked to a record in another table. b. One-to-Many – when a record in one table is linked to more than one record in another table. c. Many-to-Many – when multiple records from both (or more) tables are linked. A Many-to-many relationship is actually two one-to-many tables that are connected by a junction table. 2. Primary key – a field in a database table that is of the same data type and size as a related field in a linked table 3. Foreign key – when tables are linked by the primary key, the related field in the second table is known as the foreign key 4. Join line – a graphical representation of the link between two or more tables 5. Referential integrity protects related data that is stored in multiple tables. Referential integrity would prevent a customer in a customers table from being deleted if the customer’s ID also appears in the order table 6. IV. Junction table – a table used to join primary key fields from multiple tables Raw Data Import - A useful and practical method for obtaining information from other sources and creating database tables. Eliminates the need for repetitive data entry and assists in the protection of the data’s integrity. A. Must be formatted as text B. Must be separated at field and record breaks with a separator, such as a comma (delimitated) 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 5 Activities Relevancy Resources 1. Using a digital projector view and discuss the Database Fundamentals PowerPoint as students take notes using the Database Fundamentals graphic organizer Using the music store example in the unpacked content (Section I, Part B), describe and provide examples of table components to students Relate to previous knowledge by allowing students to brainstorm and suggest additional examples of databases Builds understanding of: o the purpose and uses of databases used in business o database concepts and components and how tables are organized Database Fundamental s PowerPoint Database Fundamental s graphic organizer (p 16) 2. Using a digital projector, lead a class discussion about how the information is organized in the online travel database at www.expedia.com Ask students how the information is grouped and assist them in reaching the conclusion that the flight time, airline, and departure city are all examples of field names in the site’s database Distribute Guided Practice: Search an Online Database to students Demonstrate the search procedures for Flights 1 and 2 as students follow along at their computers Instruct students to complete the searches for Flights 3-5 independently Monitor/provide assistance as needed Once the students have completed all five searches, lead a class discussion using the questions at the end of the activity Review the descriptions of field, record, entry, and database as related to the data used in the search Builds understanding of: o how data is organized in a database o characteristics of fields, records, and tables Guided Practice: Search an Online Database activity and key (p 17-20) Expedia.com Continued on next page 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 6 Activities Relevancy Resources 3. Using a digital projector, view and discuss the Data Types and Field Properties PowerPoint as students take notes using the Data Types and Field Properties graphic organizer Explain the difference between data types and field properties and text-based and number-based Provide examples of the uses of data types and field properties as each item is presented in the presentation Builds understanding of the defining features of how data is organized, formatted, and categorized in a database Data Types and Field Properties PowerPoint Data Types and Field Properties graphic organizer (p 21) 4. Distribute Review of Database Tables to students and instruct them to complete the activity independently with notes Monitor and provide assistance as needed Upon completion of the activity, review the answers as a class Reinforces conceptual knowledge of database tables Review of Database Tables activity and key (p 22-25) 5. Distribute Guided Practice: Create a Database: Computers to students Using a digital projector, demonstrate how to plan the structure of a database, enter data, add captions, and insert and delete records as students take notes and follow along at their computers Monitor/provide assistance as needed Builds understanding of databases by applying procedures to plan the structure, enter data, add captions, and add and delete records Guided Practice: Create a Database: Computers activity and key (p 26-29) 5.01/Dbase Activities/ Computers Continued on next page 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 7 6. Activities Relevancy Resources Distribute Independent Practice: Create a Database: Scavenger Hunt to students Review the instructions for the activity with the class and determine the protocol for saving the database and the table Discuss the characteristics of appropriate field names: o descriptive o concise o unique Instruct students how they should gather and record the survey information o One option is to use a word document to record the data o Instruct students as to whether they are to survey the entire class or a specific number of students, or perhaps the survey should be gender specific Allow a sufficient amount of time to collect the data before instructing students to return to their computers for data entry Monitor/provide assistance as needed Upon completion of the activity, view samples of student work using a digital projector and discuss the similarities and differences of their choices for field names and properties Ask students how Yes/No and Lookup formats could be used in the database Builds understanding of planning the structure of a database and field properties through independent practice Independent Practice: Create a Database: Scavenger Hunt activity and key (p 30-31) 5.01/Dbase Activities/ Scavenger Continued on next page 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 8 Activities Relevancy Resources 7. Distribute Guided Practice: Database Management: Anti-Virus to students Use a digital projector to demonstrate the activity. Allow time for students to take notes and follow along at their computers Once the database has been created, demonstrate how to delete the Compatibility field and allow students to follow along at their computers Discuss the effect of deleting the entire field. Can the deleted action be undone? Explain how to print and allow students to print as well OR require them to take notes and print the next activity Builds understanding of databases by applying procedures to: o Plan a database structure o Edit data types and field properties o Enter data o Use AutoNumber o Add captions o Add a field o Delete a field o Print a table Guided Practice: Database Management: Anti-Virus activity and key (p 32-34) 5.01 Dbase Activities/ AntiVirus 8. Distribute Independent Practice: Create a Database: Survey and instruct students to complete the activity as directed Provide directions for saving the database and the table Instruct students to print a copy of the database This activity requires students to add a field (Marital Status) to the database and later delete it. They are instructed in the activity to print the database with the added field and then ask the teacher for instructions about which field to delete. Make sure all students have completed the activity before instructing them to delete the Marital Status field Review the procedures for adding a field and determining appropriate data formats Builds understanding of databases by applying procedures to: o Plan a database structure o Determine data types and field properties o Enter data o Add a field o Delete a field o Print a table Independent Practice: Create a Database: Survey activity and key (p 35-37) 5.01 Dbase Activities/ Survey Continued on next page 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 9 Activities Relevancy Resources Distribute Guided Practice: Create a Database: MusicFun to students. Using a digital projector, demonstrate the activity as students take notes and follow along at their computers This purpose of this activity is to teach students about database management Facilitate discussion with examples of when and why these formats and edits are performed in business situations Ask the following questions: o Why might a field be added to a company database? o Why might fields be rearranged? o What types of entries will be added? o Why is the date with input mask used? What’s the benefit of using it? o Why is AutoNumber used? o Why is a Lookup value used? o Why is a Yes/No field used? Builds understanding of databases by applying procedures to: o Add fields o Rearrange fields o Add entries o Format data types and properties Guided Practice: Create a Database: MusicFun activity and key (p 38-43) 5.01 Dbase Activities/ MusicFun 10. Distribute Independent Practice: Create a Database: B&B to students and instruct them to complete the activity independently Monitor/provide assistance as needed Upon completion of the activity, facilitate class discussion by asking students for their opinions regarding the uses of databases Ask them if they view database management as a viable career option Ask if they know anyone who manages a database and discuss the job responsibilities, high school and community college courses available, salary, and etc. Builds understanding of how to manage a database by editing fields, data, data types and field properties Independent Practice: Create a Database: B&B activity and key (p 44-49) 5.01 Dbase Activities/B&B 9. Continued on next page 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 10 Activities Relevancy Resources 11. Discuss with students the need for output options when using a database o Sometimes, specific data is requested that only includes certain fields o Information is often requested in a particular order, such as flights arranged from cheapest to most expensive or latest departure times to earliest departure times o Use examples to explain the difference between ascending and descending Distribute Determining Sort Order to students and instruct them to work in pairs to complete the activity Upon completion of the activity, review answers with the class Builds understanding through examples of the difference between ascending and descending order and why data is sorted Determining Sort Order activity and key (p 50-53) 12. Discuss with students how operators are used in a database to define the organization and retrieval of data o Use Expedia as an example and discuss how operators are used to define dates, such as not less than 02/02/09 and not greater than 02/07/09 o An example of the equal operator may specify that airline equals Delta Distribute Understanding Operators to students and instruct them to complete the activity in pairs Review the activity with the class upon completion Builds understanding of database operators through examples of how they are used to organize data Understanding Operators activity and key (p 54-57) Continued on next page 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 11 Activities Relevancy Resources 13. Distribute Guided Practice: Filtering and Builds Sorting a Database to students understanding of filter and sort Using a digital projector, demonstrate the operations and filter and sort actions required to complete operators each task. Describe the procedures for each through guided method as students take notes. Allow practice students to follow along at their computers to complete the activity Discuss why filter and sort operations are performed on a database. What are the benefits? Show the results of each filter or sort to the class to confirm that their results are similar. If their results are different, determine why through class discussion and problem solving 5.01/Dbase Activities/ Survey 5.01/Dbase Activities/ Computers Guided Practice: Filtering and Sorting a Database activity and key (p 58-62) 14. Distribute Independent Practice: Filtering and Sorting a Database to students Instruct students that they will need to retrieve the Bed and Breakfast database to complete the activity Instruct them to record their results in table format in a word processing document, including a short narrative in the document that explains how they retrieved the information for each search Monitor/provide assistance as needed 5.01/Dbase Activities/B&B Independent Practice: Filtering and Sorting a Database activity and key (p 63-67) Builds understanding of filter and sort operations and operators through independent practice 15. Using a digital projector view the Database Introduces and Relationships PowerPoint and discuss with builds students the How, What, and Why of understanding database relationships. Students should of the defining take notes using the Types of Relationships features and graphic organizer characteristics of database Use examples from Expedia.com, relationships TicketMaster, or other popular database sites that are familiar to students to explain possible database relationships used by each site Database Relationships PowerPoint Relationships graphic organizer (p 68-70) Continued on next page 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 12 Activities Relevancy Resources 16. Distribute Guided Practice: Database Relationships to students. Using a digital projector, demonstrate the activity and allow time for students to take notes and follow along at their computers Explain one-to-one table relationships and referential integrity (see unpacked content, Section III, Part C) At the completion of the activity, instruct students to answer the three questions at the end independently. Review student answers to confirm their understanding Develops understanding of the defining features of oneto-one relationships through examples and guided practice Guided Practice: Database Relationships activity and key (p 71-74) 5.01/Dbase Activities/B&B 17. Distribute Independent Practice: Database Relationships to students and instruct them to complete the activity independently Monitor/provide assistance as needed Facilitate class discussion to review student answers to the questions found at the end of the activity Reinforces understanding of the defining features of oneto-one relationships through independent practice Independent Practice: Database Relationships activity and key (p 75-77) 5.01/Dbase Activities/B&B 18. Distribute Guided Practice: One-to-Many Relationships Demonstrate the activity with a digital projector and allow students to take notes and follow along at their computers Note: To save time, distribute the two tables electronically to students Discuss the differences and similarities of one-to-one and one-to-many relationships Develops understanding of one-to-many relationships through examples, comparison to one-to-one relationships, and guided practice Guided Practice: Oneto-Many Relationships activity and key (p 78-84) 5.01/ Dbase Activities/ PetRegistry 19. Distribute Independent Practice: One-toMany Relationships to students and instruct them to complete the activity independently as you monitor and provide assistance as needed Optional: Require students to use print screen or specialized software to capture the Authors table with all relationships expanded Reinforces understanding of one-to-many relationships through independent practice Independent Practice: Oneto-Many Relationships activity and key (p 85-87) 5.01/Dbase Activities/ Publishers 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 13 Activities Relevancy Resources 20. Distribute Guided Practice: Many-to-Many Relationships to students Using a digital projector, demonstrate the activity and allow time for students to take notes and follow along on their computers Discuss the differences and similarities of one-to-one, one-to-many, and many-to-many relationships Discuss examples of how many-to-many relationships are used in business Builds understanding of the purpose and uses of many-to-many database relationships through guided practice Guided Practice: Many-to-Many Relationships (p 88-92) 5.01/Dbase Activities/ BeachRentals 21. Preparation: Students are required to create a custom input mask for the duration field in the flights table. Demonstrate this process and instruct students to take notes before beginning the activity. Distribute Independent Practice: Many-toMany Relationships to students and instruct them to complete the activity independently as you monitor and provide assistance as needed Students may refer to their notes from the previous lesson Reinforces understanding of the purpose and uses of many-to-many relationships Independent Practice: Many-to-Many Relationships (p 93-96) 5.01/Dbase Activities/ Flights 22. Distribute Guided Practice: Importing Data to students Introduce the activity and explain that data used in database tables can be imported from other sources. Discuss common sources used for import and the benefits of importing data Using a digital projector, demonstrate the activity and allow time for students to take notes and follow along at their computers Restate the procedures followed to complete the import Develops understanding through example and guided practice of how data is imported into a database and the required properties of the data Guided Practice: Importing Data activity (p 97) 5.01 Dbase Activities/Raw Data for FBLA Continued on next page 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 14 Activities Relevancy Resources 23. Distribute Independent Practice: Importing Reinforces Data to students understanding through Go over the directions and points to independent remember practice how Instruct students what filenames to use when data is imported saving the word processing document and into a database, database the required Instruct students to complete the activity properties of the independently including the written response data, and the question at the end, which asks students to procedures develop a procedure for importing data Monitor/provide assistance as needed. Upon completion of the activity, ask for student volunteers to share the procedures they developed with the class Independent Practice: Importing Data activity and key (p 98-99) 5.01/Dbase Activities/ Raw Data for University 24. Distribute Database Concept Review to students and instruct them to complete the activity independently as a review of the concepts learned in this objective Database Concept Review activity and key (p 100-103) Reviews database concepts learned in this objective 25. This concludes the instruction for Objective 5.01. Objective 5.02 will build on the students’ knowledge of tables by incorporating the use of database queries, forms, and reports. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 15 Database Fundamentals graphic organizer Student Name Student Activity Period Date DATABASE FUNDAMENTALS Main Topic: Definition: Organization of a Database Examples: Four Major Database Objects: 1. 2. 3. 4. Tables Record – Definition and Example Field – Definition and Example Entry – Definition and Example 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 16 Guided Practice: Search an Online Database Student Name Teacher-Demonstration Period Date GUIDED PRACTICE: SEARCH AN ONLINE DATABASE Directions: You will search an online database of airlines. Go to www.expedia.com and search for 5 round-trip flights to 5 different destinations. Answer the questions at the end of the activity when you have completed the search. 1. Flight One Flight # Airline Departure City Arrival City Departure Time Arrival Time Length of Flight Date Leaving # of Stopovers Cost of Trip 2. Flight Two Flight # Airline Departure City Arrival City Departure Time Arrival Time Length of Flight Date Leaving # of Stopovers Cost of Trip 3. Flight Three Flight # Airline Departure City Arrival City Departure Time Arrival Time Length of Flight Date Leaving # of Stopovers Cost of Trip 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 17 Guided Practice: Search an Online Database Student Name Teacher-Demonstration Period Date 4. Flight Four Flight # Airline Departure City Arrival City Departure Time Arrival Time Length of Flight Date Leaving # of Stopovers Cost of Trip 5. Flight Five Flight # Airline Departure City Arrival City Departure Time Arrival Time Length of Flight Date Leaving # of Stopovers Cost of Trip Questions: 1. What are the field names? 2. What is the name of the database? 3. How many entries were recorded in your search? 4. How many records were searched? 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 18 Guided Practice: Search an Online Database Teacher Key GUIDED PRACTICE: SEARCH AN ONLINE DATABASE Directions: You will search an online database of airlines. Go to www.expedia.com and search for 5 round-trip flights to 5 different destinations. Answer the questions at the end of the activity when you have completed your search. Note: These answers will vary with the date and destination selections. If this site is not available, select a similar site or create a database which contains relevant data from which the students can gather the information. 1. 2. 3. Flight One Flight # 919/749 Airline Delta Departure City Raleigh Arrival City Las Vegas Departure Time 6:00 a.m. Arrival Time 9:50 a.m. Length of Flight 6 hr 60 m Date Leaving January 1, 2008 # of Stopovers 1 Cost of Trip $305 Flight # 4472/1226 Airline US Airways Departure City Asheville Arrival City Nassau, Bahamas Departure Time 9:45 a.m. Arrival Time 1:54 p.m. Length of Flight 4 hr 9 m Date Leaving November 1, 2007 # of Stopovers 1 Cost of Trip $587 Flight # 1122/4250 Airline US Airways Departure City New Bern Arrival City Miami, FL Departure Time 5:35 a.m. Arrival Time 9:37 a.m. Length of Flight 4 hr 2 m Date Leaving December 3, 2007 # of Stopovers 1 Cost of Trip $521 Flight Two Flight Three 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 19 Guided Practice: Search an Online Database 4. 5. Teacher Key Flight Four Flight # 1701/2075 Airline Northwest Departure City Charlotte Arrival City Missoula, MT Departure Time 5:47 p.m. Arrival Time 11:49 p.m. Length of Flight 8 hr 2 m Date Leaving October 1, 2007 # of Stopovers 1 Cost of Trip $461 Flight # 2420/1495 Airline Continental Departure City Greensboro Arrival City Los Angeles Departure Time 6:35 a.m. Arrival Time 10:52 a.m. Length of Flight 7 hr 17 m Date Leaving September 12, 2007 # of Stopovers 1 Cost of Trip $331 Flight Five Questions: 1. What are the field names? 2. What is the name of the database? 3. Expedia How many entries were recorded in your search? 4. Flight #, Airline, Departure City, Arrival City, Departure Time, Arrival Time, Length of Flight, Date Leaving, # of Stopovers, and Cost of Trip 50 How many records can be produced as a result of your search? 5 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 20 Data Types and Field Properties graphic organizer Student Name Student Activity Period Date DATA ATE TYPES AND FIELD PROPERTIES Text-based – used for data that will Number-based –used – data type for data used that formay be sorted in alphabetical order or listed randomly, but will not be used in mathematical calculations data that may be calculated, sorted, or be calculated, sorted, or filtered filtered Yes/No (data type) Example: Decimal places (field property) Example: Currency (data type) Example: Caption (field property) Example: Date (data type) Example: LookUp Wizard (data type) Example: Time (data type) Example: Auto Number (data type) Example: Input Mask (field property) Example: Primary key (data type) Example: 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 21 Review of Database Tables Student Activity Student Name Period Date REVIEW OF DATABASE TABLES B A C Part I Directions: Match the letters above with their definition below. 1. Field ______ 2. Record ______ 3. Entry ______ Part II Directions: Answer the questions below using the above diagram. 1. Number of entries _________ 3. Number of fields _________ 2. Number of records _________ Part III Directions: Identify the correct data type for each item using the list below • Text • Number • Date/Time • Currency • Memo • Lookup Wizard 1. 123-45-6789 (social security number) __________________ 2. John __________________ 3. $257.98 __________________ 4. 12587 (employee ID number) __________________ 5. Paid/Not Paid __________________ 6. This item needs to be reordered. It is one of our best selling items. __________________ 7. Series of choices (low, medium, high) __________________ 8. December 15, 2006 __________________ 9. (555) 555-5555 (phone number) __________________ 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 22 • Yes/No Review of Database Tables Student Activity Student Name Period Date 10. Pets Allowed/Pets Not Allowed __________________ 11. Age of students __________________ 12. Cost of trip __________________ 13. Date of Purchase __________________ Part IV Directions: Place the parts of a database in order from the smallest unit to the largest unit. (1 being the smallest, 5 being the largest) • • Field Character 1. 2. • Entry • Record 3. 4. 5. Part V: Match the definition to the correct term. 1. Field A. Is also a true/false field. Will contain a checkbox for yes no. Default is No. 2. Entry B. Monetary values 3. Record C. Creates fields that automatically enter a unique number when a record is added 4. Text D. Includes words and/or numbers not used in calculations 5. Number E. This format is applied to a field that will be sorted chronologically 6. Input Mask F. Data and formulas keyed in a field 7. Yes/No G. An efficient means of storing and retrieving data and printing reports from the stored data 8. Currency H. One item of information in a record. Represented by a column 9. Lookup Field I. A group of related fields of information 10. Memo J. A format often applied to dates and times 11. Database K. Like text, but max of 64,000 characters AutoNumber L. Allows you to create a finite set of choices for that field’s entry values 12. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 23 Review of Database Tables Teacher Key REVIEW OF DATABASE TABLES B A C Part I Directions: Match the letters above with their definition below. 1. Field __B____ 2. Record __A____ 3. Entry __C____ Part II Directions: Answer the questions below using the above diagram. 4. Number of entries ____20___ 5. Number of records ____4___ 6. Number of fields ____5___ Part III Directions: Identify the correct data type for each item using the list below: • Text • Number • Date/Time • Currency • Memo • Lookup Wizard 8. 123-45-6789 ............................................................................................................ Text 9. John ........................................................................................................................ Text 10. $257.98 ........................................................................................................... Currency 11. 12587 ...................................................................................................................... Text 12. Paid/Not Paid ..................................................................................................... Yes/No 13. This item needs to be reordered. It is one of our best selling items. ..................... Memo 14. Series of choices (low, medium, high) .................................................... Lookup Wizard 15. December 15, 2006 ....................................................................................... Date/Time 16. (555) 555-5555 ........................................................................................................ Text 17. Pets Allowed/Pets Not Allowed ........................................................................... Yes/No 18. Age of students.................................................................................................. Number 19. Cost of trip ....................................................................................................... Currency 20. Date of Purchase ........................................................................................... Date/Time 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 24 • Yes/No Review of Database Tables Teacher Key Part IV Directions: Place the parts of a database in order from the smallest unit to the largest unit. (1 being the smallest, 5 being the largest) • Field • Character • Entry • Record 1. 2. 3. 4. Character Entry Field Record Part V: Match the definition to the correct term. H 1. Field A. Is also a true/false field. Will contain a checkbox for yes no. Default is No. F 2. Entry B. Monetary values I 3. Record C. Creates fields that automatically enter a unique number when a record is added D 4. Text D. Includes words and/or numbers not used in calculations E 5. Number E. This format is applied to a field that will be sorted chronologically J 6. Input Mask F. Data and formulas keyed in a field A 7. Yes/No G. An efficient means of storing and retrieving data and printing reports from the stored data B 8. Currency H. One item of information in a record. Represented by a column L 9. Lookup Field I. A group of related fields of information K 10. Memo J. A format often applied to dates and times G 11. Database K. Like text, but max of 64,000 characters 12. AutoNumber L. Allows you to create a finite set of choices for that field’s entry values C 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 25 Guided Practice: Create a Database: Computers Student Name: Teacher Demonstration Period: Date: GUIDED PRACTICE: CREATE A DATABASE: COMPUTERS Directions: In this activity, you will follow along with your teacher to create a database and complete the following tasks: • Plan the structure • Add records • Enter data • Delete records 1. The first step is to plan the structure. You will be creating a computer inventory database. For each item, you have the name of the manufacturer, the serial number, the room location, and the ID number of the student to which it is assigned. Based on this information and the data below, how many fields are needed in the database? Notes: 2. What are appropriate field names? Compaq 12345 214 5 Dell 54321 110 6 Dell 98765 310 9 Packard Bell 45678 214 3 Compaq 34567 110 4 Compaq 95425 111 8 Gateway 55557 109 8 Dell 90864 222 12 Dell 123674 214 15 Gateway 87093 119 27 Hewlett Packard 83765 111 22 3. In addition to assigning field names, the caption field property allows the user to enter more user-friendly column headings that will be visible when the database is viewed or printed. Use the caption field property for each field name to assign user-friendly column headings 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 26 Guided Practice: Create a Database: Computers Student Name: Teacher Demonstration Period: Date: 4. The next step is to determine the format and size of each field Notes: 5. Name the database according to teacher directions and enter the data Notes: 6. Edit the database to add the following records: Hewlett Packard 88334 109 25 Compaq 22990 211 26 Dell 34419 110 27 22334455 214 28 Gateway Notes: 7. Edit the database to delete the following 2 records: Compaq with Serial Number 34567 Dell with Serial Number 123674 Notes: 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 27 Guided Practice: Create a Database: Computers Teacher Key GUIDED PRACTICE: CREATE A DATABASE: COMPUTERS 1. Determine the field names. Field Names Caption Manufacturer Same SeNo Serial Number RNo Room Number StNo Student Number 2. Determine the field properties: Field Names Field Type Field Size Manufacturer Text 20 SerialNumber Text 9 RoomNumber Text 4 Number 4 StudentNumber 3. Name the database and enter the data. Manufacturer Serial Number Room Number Student Number Compaq 12345 214 5 Dell 54321 110 6 Dell 98765 310 9 Packard Bell 45678 214 3 Compaq 34567 110 4 Compaq 95425 111 8 Gateway 55557 109 8 Dell 90864 222 12 Dell 123674 214 15 Gateway 87093 119 27 Hewlett Packard 83765 111 22 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 28 Guided Practice: Create a Database: Computers Teacher Key 4. Edit the database by adding the following records: Manufacturer Serial Number Room Number Student Number Hewlett Packard 88334 109 25 Compaq 22990 211 26 Dell 34419 110 27 22334455 214 28 Gateway 5. Edit the database by deleting the following 2 records: Compaq with Serial Number 34567 Dell with Serial Number 123674 Computers Database With records deleted With records added 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 29 Independent Practice: Create a Database: Scavenger Hunt Student Name Student Activity Period Date INDEPENDENT PRACTICE: CREATE A DATABASE: SCAVENGER HUNT Directions: In this activity, you will work independently to create a database based on information you gather from your classmates. You will need to determine field names and captions, data types, and field properties by reading the questions below. Once you have determined the fields, you will survey your classmates as assigned by your teacher. You will then create a database to record your results. Survey Questions: 1. What is your first and last name? 2. Do you have blue eyes? 3. What is your favorite sport? 4. Do you have your driver’s license? 5. Are you a Senior, Junior, Sophomore or Freshman? 6. What is your favorite music group or band? 7. What is your favorite food? 8. What is your favorite color? 9. Are you left-handed or right-handed? 10. How old are you? 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 30 Independent Practice: Create a Database: Scavenger Hunt Teacher Key INDEPENDENT PRACTICE: CREATE A DATABASE: SCAVENGER HUNT Student answers will vary 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 31 Guided Practice: Database Management: Anti-Virus Student Name Teacher Demonstration Period Date GUIDED PRACTICE: DATABASE MANAGEMENT: ANTI-VIRUS Directions: In this activity, you will follow along with your teacher to complete the following tasks as you create a database of antivirus software: • Plan a database structure • Add captions • Determine data types and field properties • Add a field • Enter data • Delete a field • Use AutoNumber • Print a table Step 1: Determine the structure of the database and field properties. Item 3 has been completed for you as an example. Data Field Decimal Field Name Caption Scale Type Property Places 1. NA 2. Memo 3. NA NA NA NA NA NA Decimal 2 2 5. NA NA 6. NA NA 4. Rating Number Step 2: Name the database and enter the data Popular AntiVirus Software Titles Price Rating .Mac 2.5 Retail $76.99 4.78 PC-Cillin 2003 $26.99 4.2 Norton AntiVirus 2002 Professional Upgrade $39.54 4.17 Bullguard AntiVirus Firewall $39.99 4 Norton Personal Firewall 2005 $42.50 4 Stomp Spy Ware X-terminator $22.79 3.83 eTrust EZ AntiVirus 2005 $24.99 3.8 Zone Alarm Internet Security Suite $59.99 3.6 PC-Cillin Internet Security 2005 $39.99 3.55 Webroot Spy Sweeper Internet Essentials Suite $54.99 3.67 McAfee AntiVirus Suite $39.99 4.25 Ad-Aware $59.99 4 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 32 Guided Practice: Database Management: Anti-Virus Student Name Teacher Demonstration Period Date Step 3: Add a field and its data to the database. Notes Compatibility Size 1. MAC 64 MB 2. W93 264 MB 3. MAC 264 MB 4. MAC 264 MB 5. XP 1G 6. XP 1G 7. W95 264 MB 8. W98 264 MB 9. W95 64 MB 10. XP 1G 11. XP 1G 12. XP 264 MB Step 4: Delete a field. Notes: 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 33 Guided Practice: Database Management: AntiVirus Teacher Key GUIDED PRACTICE: DATABASE MANAGEMENT: ANTIVIRUS Field Name Data Type Caption Field Property Scale Decimal Places Number NA NA NA Software Title 50 NA NA 1. No AutoNumber 2. Title Memo 3. Price Currency Same NA NA Auto 4. Rating Number Same Decimal 2 2 5. Compatibility Text Same 50 NA NA 6. Size Text Same 50 NA NA 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 34 Independent Practice: Create a Database: Survey Student Name Student Activity Period Date INDEPENDENT PRACTICE: CREATE A DATABASE: SURVEY Directions: In this activity, you will work independently to create a database of survey information as you complete the following tasks: • Plan a database structure • Use AutoNumber • Determine data types and field • Add a field properties • Delete a field • Enter data • Print a table Step 1: Plan the database structure. Use the table below to plan the field names and structure of the database based on the information in Step 2. Field Name Caption Data Type Field Size Step 2: Enter the data Number Age Income Gender Number of Children 1 34 $25,000.00 M 2 2 45 $100,000.00 M 3 3 88 $50,000.00 M 1 4 25 $26,000.00 F 1 5 21 $39,000.00 M 0 6 58 $57,000.00 F 3 7 45 $37,000.00 M 3 8 46 $90,000.00 M 0 9 40 $58,000.00 F 2 10 36 $60,000.00 M 2 11 36 $72,000.00 F 2 12 66 $22,000.00 M 2 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 35 Independent Practice: Create a Database: Survey Student Name Period Student Activity Date Step 3: Add a field. Add the field Marital Status and enter the data in order as listed. Marital Status 1. S 2. S 3. S 4. M 5. M 6. S 7. M 8. M 9. S 10. S 11. M 12. S Follow teacher directions for printing, completing the final step of this activity (deletion of a field), and submitting your work. Ask your teacher which field to delete. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 36 Independent Practice: Create a Database: Survey Teacher Key INDEPENDENT PRACTICE: CREATE A DATABASE: SURVEY Field Names Caption Field Type Field Size No Number AutoNumber NA Age Same Number Long Integer Income Same Currency 14 Gender Same Text 2 Number of Children Number Long Integer Marital Status Text NA NoChdrn Status Note: Students were instructed to delete the Marital Status field 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 37 Guided Practice: Create a Database: MusicFun Student Name Teacher Demonstration Period Date GUIDED PRACTICE: CREATE A DATABASE: MUSICFUN Directions: In this activity, you will follow along with your teacher to create a database and complete the following tasks: • Apply field formats: • Add fields Date with Input Mask AutoNumber (review) • Rearrange fields Lookup • Add entries Yes/No 1. Create the database structure as indicated in the table below. Field Caption Artist Artist Type Size Format Description Name of the artist or group Text 25 NA 100 NA NA Format as Short Date (Use Input Mask) Original release date CD Album Title Text Release Release Date Date/Time Notes: 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 38 Guided Practice: Create a Database: MusicFun Student Name 2. Period Date Enter the records in the table below. When keying the date, enter a zero before any single digit numbers, such as 04/03/2008. Artist 3. Teacher Demonstration CD Title Release Date U2 How to Dismantle an Atomic Bomb 11/23/2004 Green Day American Idiot 9/21/2004 Ray Charles Genius Loves Company 8/31/2004 John Legend Get Lifted 12/28/2004 Alicia Keys Maximum Alicia Keys 12/14/2004 Brooks and Dunn Red Dirt Road Prince Purple Rain Doobie Brothers Minute by Minute 2/22/2002 Maroon 5 Songs About Jane 6/25/2002 Kelly Clarkson Breakaway Rolling Stones It’s Only Rock and Roll Rolling Stones Made in the Shade 4/5/1975 Rolling Stones Beggar’s Banquet 8/27/1968 U2 War 5/15/1983 U2 Achtung, Baby 7/15/2003 10/25/1990 11/30/2005 7/26/1974 11/19/1991 Add a new field named MusicianID. Use Auto-Number and set this field as a primary key. Notes: 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 39 Guided Practice: Create a Database: MusicFun Student Name 4. Period Teacher Demonstration Date Add another new field named Genre. a. Format the field as a Lookup and use the Lookup Wizard (or similar command relative to software) to create a drop-down list of genre options. b. Enter the following values for the drop-down list: Classical Country Pop R&B Reggae Rock Notes: 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 40 Guided Practice: Create a Database: MusicFun Student Name Teacher Demonstration Period Date 5. Use the drop-down box just completed to select the correct genre for each of the artists. Artist Genre Artist Genre 1. Alicia Keys Pop 6. Kelly Clarkson Pop 2. Brooks and Dunn Country 7. Maroon 5 Rock 3. Doobie Brothers Rock 8. Prince R&B 4. Green Day Rock 9. Ray Charles R&B 5. John Legend R&B 10. Rolling Stones Rock 11. U2 Rock 6. Rearrange the fields: a. Move MusicianID to the first field in the table. b. Make Genre the 2nd field Notes: 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 41 Guided Practice: Create a Database: MusicFun Student Name Teacher Demonstration Period Date 7. Add the following entries. Genre CD Title Artist Release Date Classical Phantom of the Opera Andrew Lloyd Weber 11/23/2004 R&B The Essential Stevie Ray Vaughan and Double Trouble Stevie Ray Vaughan 10/01/2002 Reggae Legend (The Definitive Remasters) Bob Marley 5/21/2002 Country Who Am I? Jessica Andrews 2/27/2001 R&B Best of Bonnie Raitt (US) Bonnie Raitt 9/30/2003 Classical Requiem Wolfgang Amadeus Mozart NA Classical Crimson Tide Soundtrack Hans Zimmer 5/16/1995 Country Here for the Party Gretchen Wilson 5/11/2004 Country Greatest Hits Shania Twain 11/9/2004 R&B Confessions Usher 10/5/2004 Pop Under the Table and Dreaming Dave Matthews Band 8/24/2004 8. Create a yes/no field. Add a new field to the database named Under25. The caption should be Under 25? a. Format the field as yes/no Artist b. Click the box for each artist that is under the age of 25. Under 25? Alicia Keys Y Kelly Clarkson Y Usher Y Notes: 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 42 Guided Practice: Create a Database: MusicFun Teacher Key GUIDED PRACTICE: CREATE A DATABASE: MUSICFUN 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 43 Independent Practice: Create a Database: B&B Student Name Student Activity Period Date INDEPENDENT PRACTICE: CREATE A DATABASE: B&B Directions: In this activity, you will work independently to create a database and complete the following tasks: • Format data types and field • Add fields properties: Date with Input Mask • Rearrange fields AutoNumber (review) • Add entries LookUp Yes/No Part I 1. Open a new database and save it as B&B (or as instructed by your teacher). You will create a database for the Bed and Breakfast Association. Name the database table HistoricInns. 2. Plan the database structure. Determine the appropriate field names, types, and sizes according to the information in number 3 (on the next page) and write your answers in the spaces provided in the table below. The first one has been completed for you. Name Field 1 Inn Caption Data Type/ Field Property Memo Format/Comments Field size = 50 Field 2 Field 3 Field 4 Field 5 Field 6 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 44 Independent Practice: Create a Database: B&B Student Name 3. Student Activity Period Date Enter the data using the table below. Historic Inn No. Children Located Rooms under 10 in the Available allowed city Small Town or Mountain Community Full Breakfast WhiteGate Inn and Cottage (1889) 6 Yes Yes Mountain Yes Inn on Montford (1900) 5 No Yes Mountain Yes Secret Garden (1904) 3 No No Town Yes Abbington Green 8 Yes Yes Mountain Yes Albermarle Inn 11 No Yes Mountain Yes A Bed of Roses 5 No Yes Mountain Yes Biltmore Village Inn 6 No Yes Mountain Yes Blake House Inn 6 Yes Yes Mountain Yes Carolina Bed & Breakfast 7 Yes Yes Mountain Yes Cedar Crest Victorian Inn 12 No Yes Mountain Yes Chestnut Street Inn 8 Yes Yes Mountain Yes Colby House 5 Yes Yes Mountain Yes Dry Ridge Inn 8 Yes Yes Mountain Yes The Hawk & Ivy 4 Yes No Town Yes Inn on Main Street 7 No No Town Yes The Lion and The Rose 5 Yes Yes Mountain Yes North Lodge on Oakland 6 Yes Yes Mountain Yes Owl's Nest Inn at Engadine 7 No No Town Yes 4. Add a new field so guests will know if pets are allowed. Inns allowing pets include the following: Abbington Green Biltmore Village Inn Blake House Inn 6411 – Computer Applications I Carolina Bed & Breakfast Owl’s Nest Inn at Engadine Summer 2008 Unit B – 5.01 – page 45 Independent Practice: Create a Database: B&B Student Name Period Student Activity Date Part II: Answer the following questions: 1. What is the default value of a Yes/No field? 2. How many records are in the database? 3. How many fields are in the database? 4. What advice would you give someone about assigning field names? 5. How could this database be used on the Internet? 6. How would Internet users benefit from this list if posted on the Internet? 7. How would the owners of the B & Bs benefit from this list if posted on the Internet? 8. What other fields might be useful? 9. What are two ways to toggle the yes/no field when entering data? 10. Save and submit according to teacher instructions. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 46 Independent Practice: Create a Database: B&B Teacher Key INDEPENDENT PRACTICE: CREATE A DATABASE: B&B Plan the database structure. Determine the appropriate field names, types, and sizes according to the information below and write your answers in the spaces provided. The first one has been completed for you. Name Caption Properties Format/Comments Field 1 Inn Historic Inn Text Field size = 50 Field 2 Rooms No. Rooms Number 0 decimal places Field 3 Children Allow Children? Yes/No Enter Under 10 in the Description Column Field 4 City NA Yes/No NA Field 5 Setting Mountain or Town? Lookup Enter 2 options: Town and Mountain Field 6 Breakfast Breakfast? Yes/No NA Field 7 Pets Pets? NA Yes/No Answer the following questions: 1. What is the default value of a Yes/No field? ................................................... No 2. How many records are in the database? ......................................................... 18 3. How many fields are in the database? ............................................................... 7 4. What advice would you give someone about assigning field names? 5. How could this database be used on the Internet? 6. Internet users can quickly and easily compare the locations, availability, and amenities of the inns. How would the owners of the B & Bs benefit from this list if posted on the Internet? 8. This database would be a great resource for travelers when planning a business trip or vacation. How would Internet users benefit from this list if posted on the Internet? 7. Field names should be short and directly related to the corresponding data. Owners would benefit from the potential sales associated with people searching for availability of inns. What other fields might be useful? Cost, smoking or non-smoking, bathrooms, pet fee, etc. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 47 Independent Practice: Create a Database: B&B 9. Teacher Key What are two ways to toggle the yes/no field when entering data? Click the box to toggle a check mark for a Yes or a blank for No Tab to the yes/no field and hit the space bar to toggle. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 48 Independent Practice: Create a Database: B&B Teacher Key INDEPENDENT PRACTICE: CREATE A DATABASE: B&B 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 49 Determining Sort Order Student Activity Student Name Period Date DETERMINING SORT ORDER Directions for Part I: Place an A in the Order column for each scenario that is an example of ascending order or a D if the scenario is of descending order Order Scenario 1. The class should line up from the shortest student to the tallest for the vault contest. 2. The library books were shelved in alphabetical order by author’s first name. 3. The most expensive items were listed first. 4. The family reunion photograph shows the babies in the front row and the great-grandparents in the last row. 5. The cities with the most snow days were listed first. 6. The first grade teacher’s mailboxes were assigned before the fifth grade teacher’s. 7. Bus 13 left the parking lot first, Bus 37 was second and Bus 73 left last. 8. The oldest student was allowed to go first in the lunch line, while the youngest was last to get his tray. 9. The mountains were listed on the board. The ones with the highest elevation were listed first while the ones with the lowest elevation were listed last. 10. The cities with the least snow days were listed first. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 50 Determining Sort Order Student Name Student Activity Period Date Directions for Part II: Study each list below and determine the sort order. Write A for ascending and D for descending. Order Scenario 1). 3). 5). 7). 9). a). a full tank of gas Order Scenario 2). a). a can of coke b). ¼ tank of gas b). a 16 oz. bottle of coke c). running on empty c). a 2 liter bottle of coke a). a penny 4). a). Seniors b). a nickel b). Juniors c). a dime c). Freshmen a). 1923 6). a). 04/15/2006 b). 1945 b). 07/04/2006 c). 1990 c). 09/25/2006 a). David 8). a). Rock b). Christine b). Pop c). Becky c). Classical a). 150 10). a). Abbington Green b). 110 b). Dry Ridge Inn c). 90 c). Secret Garden 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 51 Determining Sort Order Teacher Key DETERMINING SORT ORDER Directions for Part I: Label each situation or “scenario” as either ascending or descending in the spaces provided. A 1. The class should line up from the shortest student to the tallest for the vault contest. A 2. The library books were shelved in alphabetical order by author’s first name. D 3. The most expensive items were listed first. A 4. The family reunion photograph shows the babies in the front row and the great-grandparents in the last row. D 5. The cities with the most snow days were listed first. D 6. The fifth grade teacher’s mailboxes were assigned before the first grades. A 7. Bus 13 left the parking lot first, bus 37 was second and bus 73 left last. D 8. The oldest student was allowed to go first in the lunch line, while the youngest was last to get his tray. D 9. The mountains were listed on the board. The ones with the highest elevation were listed first while the ones with the lowest elevation were listed last. A 10. The planets with the fewest moons were listed first. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 52 Determining Sort Order Teacher Key Directions for Part II: Study each list below and determine the sort order. Write A for Ascending and D for Descending Order D A A D D Scenario 1). a). a full tank of gas Order A Scenario 2). a). a can of coke b). ¼ tank of gas b). a 16 oz. bottle of coke c). running on empty c). a 2 liter bottle of coke 3). a). a penny D 4). a). Seniors b). a nickel b). Juniors c). a dime c). Freshmen 5). a). 1923 A 6). a). 04/15/2006 b). 1945 b). 07/04/2006 c). 1990 c). 09/25/2006 7). a). David D 8). a). Rock b). Christine b). Pop c). Becky c). Classical 9). a). 150 A 10). a). Abbington Green b). 110 b). Dry Ridge Inn c). 90 c). Secret Garden 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 53 Understanding Operators Student Activity Student Name Period Date UNDERSTANDING OPERATORS Understanding mathematical operators is necessary when conducting database searches and sorts and applying filters and queries. When instructed to locate information in a database with phrases such as shorter than, taller than, older than etc, you will need to translate the phrase into words that the database understands. In this activity, you will demonstrate your skill at determining what operator to use by matching the mathematical symbol with the words or phrases below. Directions for Part I: Match the symbols with their meanings 1. Less Than A. <> 2. Greater Than B. <= 3. Equal To C. >= 4. Less Than or Equal To D. = 5. Greater Than or Equal To E. < 6. Not Equal To F. > 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 54 Understanding Operators Student Name Student Activity Period Date Directions for Part II: Write the correct statement that would find each of the criteria. Example: Criteria: At most 36 Answer: <=36 Criteria Statement 1. No more than 5 2. After 1950 3. Before 1920 4. Older than 18 5. Lower than 100 6. Taller than 6 feet 7. Students except Juniors 8. 100 or more 9. 100 or less 10. More than 2000 11. Under 32 12. Over 75 13. Smaller than 3 14. Shorter than 23 15. Not lower than 30 16. Younger than 50 17. At most 63 18. Population growth of 1.9% 19. Since 1941 20. All students except freshmen 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 55 Understanding Operators Teacher Key UNDERSTANDING OPERATORS Understanding mathematical operators is necessary when conducting database searches and sorts and applying filters and queries. When instructed to locate information in a database with phrases such as shorter than, taller than, older than etc, you will need to translate the phrase into words that the database understands. In this activity, you will demonstrate your skill at determining what operator to use by matching the mathematical symbol with the words or phrases below. Directions for Part I: Match the symbols with their meanings. E 1. Less Than A. <> F 2. Greater Than B. <= D 3. Equal To C. >= B 4. Less Than or Equal To D. = C 5. Greater Than or Equal To E. < A 6. Not Equal To F. > 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 56 Understanding Operators Teacher Key Directions for Part II: Write the correct statement that would find each of the criteria. Example: Criteria: At most 36 Criteria Answer: <=36 Statement 1. No more than 5 2. After 1950 >1950 3. Before 1920 <1920 4. Older than 18 >18 5. Lower than 100 <100 6. Taller than 6 feet 7. Students except Juniors 8. 100 or more >=100 9. 100 or less <=100 10. More than 2000 >2000 11. Under 32 <32 12. Over 75 >75 13. Smaller than 3 <3 14. Shorter than 23 <23 15. Not lower than 30 >=30 16. Younger than 50 <50 17. At most 63 <=63 18. Population growth of 1.9% =1.9 19. Since 1941 20. All students except freshmen 6411 – Computer Applications I <=5 >6 <>Juniors >1941 <>Freshmen Summer 2008 Unit B – 5.01 – page 57 Guided Practice: Filtering and Sorting a Database Student Name Teacher Demonstration Period Date GUIDED PRACTICE: FILTERING AND SORTING A DATABASE You will follow along with your teacher on this activity to apply sort and filter operations to databases you have already created. You will discuss and explain the procedures as you proceed through the activity in order to confirm an understanding of database logic. Part I: Retrieve the Survey database from Independent Practice: Create a Database: Survey and perform the following tasks: 1. Filter by selection for all males. How is this accomplished? 2. Filter/Advanced Filter Sort for all females with income over $25,000 o What fields will be used in the filter? o What operator is used for each? 3. Filter for all participants with no children o What filter was used? 4. Filter/Advanced Filter Sort for all males under the age of 50 o What filter was used? 5. Filter/Advanced Filter Sort for all females with income over $30,000 with children o What filter was used? 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 58 Guided Practice: Filtering and Sorting a Database Student Name 6. Teacher Demonstration Period Date In your own words, describe how filter and sort operations are used to manage information in a database. Think about the questions below when writing your answer using the back of this handout or on a separate sheet of paper. o What purpose does a filter or sort operation serve o What effect do filter and sort operations have on the user who is trying to retrieve information? o When might a filter or sort operation be most beneficial? o When might a filter or sort operation be least beneficial? Part II: Retrieve the Computers database from Guided Practice: Create a Database: Computers. Imagine that the database contains 1,000 records and that it is an inefficient use of time to search by simply scrolling through the entries. Use filter and sort to answer the following questions: 1. In which room will you find the computer with the Serial Number 87093? o What filter was used? 2. What is the Serial Number of the computer used by Student #9? o What two methods can be used to find this information? 3. Sort the Student # field in ascending order. List the room number, manufacturer and serial number of the next to last entry. 4. Format the Student Number field as text and perform the sort in Number 3 again. What happens and why? 5. Search for all computers in Rooms 109 or 111. List the serial number(s). 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 59 Guided Practice: Filtering and Sorting a Database Teacher Key GUIDED PRACTICE: FILTERING AND SORTING A DATABASE Part I 1. Place the cursor in any cell of the Gender field that has an “M” and select the Filter by Selection option. 2. Gender and Income Equals and Greater Than 3. Filter by selection by selecting a cell in the Number of Children column with a zero. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 60 Guided Practice: Filtering and Sorting a Database Teacher Key Part I continued 4. Gender=M and Age>50 5. Gender=F, Income > 30000, Children > 0 Part II 1. Criterion: Field= Serial Number, Criteria =87093 2. Filter by selection is also appropriate. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 61 Guided Practice: Filtering and Sorting a Database Teacher Key Part II continued 3. Room: 119 Manufacturer: Gateway Serial Number: 87093 4. The sort doesn’t work properly because the database is not able to recognize the order of the text. 5. 95425, 55557, 83765, 88334 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 62 Independent Practice: Filtering and Sorting a Database Student Name Period Student Activity Date INDEPENDENT PRACTICE: FILTERING AND SORTING A DATABASE You will complete this activity independently to apply what you have learned about sorting and filtering a database. For each item, you must copy the results of the affected field(s) into a word document. You should end up with 9 tables in one word document. Label each table appropriately and provide an explanation of how the sort/filter was performed for each. Part I: Open the B&B database and complete the following sort tasks in the HistoricInns table. 1. Simple sort: Sort by the B&B Name in ascending order. Copy/paste the sorted B&B field to a word processing document. 2. Simple sort: Sort by the Number of Rooms field in descending order. Copy/paste the Inn field and Rooms field to a word processing document. 3. Complex sort: Move two appropriate fields adjacent to each other to accomplish the sort. Primary field: Rooms in ascending order; Secondary Field: Inn in ascending order. If using Access, the left-most field will be sorted first, so for this sort, you must drag the Rooms field in front of the Inn field. Copy/paste the two fields to a word document. Note: Be careful not to click a yes/no box by accident and change its value Part II: Using the same database, complete the following filter by selection tasks 4. Historic Inns which do not allow pets 5. Historic Inns which allow pets 6. Historic Inns which allow children under the age of 10 7. Historic Inns located in town (continued on the next page) 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 63 Independent Practice: Filtering and Sorting a Database Student Name Student Activity Period Date Part III: Using the same database, complete the following advanced selections 8. Apply an advanced filter that selects records according to the following conditions: Historic Inns that have more than 4 rooms available Descending order Allow both children and pets. Write a criterion statement using operators 9. Apply an advanced filter that selects records according to the following conditions: Historic Inns that have less than 6 rooms available Ascending order Located in a small town/country place Allows children. Write a criterion statement using operators 10. Save and submit your work according to teacher directions. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 64 Independent Practice: Filtering and Sorting a Database Teacher Key INDEPENDENT PRACTICE: FILTERING AND SORTING A DATABASE (1) Sort by Inn Name in Ascending Order Inn A Bed of Roses Abbington Green Albermarle Inn Biltmore Village Inn Blake House Inn Carolina Bed & Breakfast Cedar Crest Victorian Inn Chestnut Street Inn Colby House Dry Ridge Inn Inn on Main Street Inn on Montford (1900) North Lodge on Oakland Owl's Nest Inn at Engadine Secret Garden (1904) The Hawk & Ivy The Lion and The Rose White Gate Inn and Cottage (1889) (2) Sort by No. of Rooms Inn Cedar Crest Victorian Inn Albermarle Inn Abbington Green Dry Ridge Inn Chestnut Street Inn Carolina Bed & Breakfast Owl's Nest Inn at Engadine Inn on Main Street White Gate Inn and Cottage (1889) Biltmore Village Inn North Lodge on Oakland 6411 – Computer Applications I (2) Sort by No. of Rooms Inn Blake House Inn Colby House A Bed of Roses The Lion and The Rose Inn on Montford (1900) The Hawk & Ivy Secret Garden (1904) Rooms 12 11 8 8 8 7 7 7 6 Rooms 6 5 5 5 5 4 3 (3) Sort first by rooms and then by Inn in ascending order Rooms Inn 3 Secret Garden (1904) 4 The Hawk & Ivy 5 A Bed of Roses 5 Colby House 5 Inn on Montford (1900) 5 The Lion and The Rose 6 Biltmore Village Inn 6 Blake House Inn 6 North Lodge on Oakland 6 White Gate Inn and Cottage (1889) 7 Carolina Bed & Breakfast 7 Inn on Main Street 7 Owl's Nest Inn at Engadine 8 Abbington Green 8 Chestnut Street Inn 8 Dry Ridge Inn 11 Albermarle Inn 12 Cedar Crest Victorian Inn 6 6 Summer 2008 Unit B – 5.01 – page 65 Independent Practice: Filtering and Sorting a Database Teacher Key 4) B&Bs with NO pets Pets Name No A Bed of Roses No Albermarle Inn No Cedar Crest Victorian Inn No Chestnut Street Inn No Colby House No Dry Ridge Inn No Inn on Main Street No Inn on Montford (1900) No North Lodge on Oakland No Secret Garden (1904) No The Hawk & Ivy No The Lion and The Rose No White Gate Inn and Cottage (1889) (5) B&Bs with pets Pets Name Yes Abbington Green Yes Biltmore Village Inn Yes Blake House Inn Yes Carolina Bed & Breakfast Yes Owl's Nest Inn at Engadine (6) B&Bs allowing children Name Children Abbington Green Yes Blake House Inn Yes Carolina Bed & Breakfast Yes Chestnut Street Inn Yes Colby House Yes Dry Ridge Inn Yes North Lodge on Oakland Yes The Hawk & Ivy Yes The Lion and The Rose Yes White Gate Inn and Cottage (1889) Yes 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 66 Independent Practice: Filtering and Sorting a Database Teacher Key (7) B&Bs in small town/country setting Name Setting Inn on Main Street Town Owl's Nest Inn at Engadine Town Secret Garden (1904) Town The Hawk & Ivy Town (8) B&Bs >4 rooms, pets, children Pets Name Setting Yes Abbington Green Mountain Yes Carolina Bed & Breakfast Mountain Yes Blake House Inn Mountain Children Rooms Yes 8 Yes 7 Yes 6 (9) B&Bs <6 rooms ascending, small town, allows children Pets Name Setting Children Rooms No The Hawk & Ivy Yes Yes 4 6411 – Computer Applications I Summer 2008 City Yes Yes Yes City No Breakfast Yes Yes Yes Breakfasts Yes Unit B – 5.01 – page 67 Types of Relationships graphic organizer Student Name Student Activity Period Date TYPES OF RELATIONSHIPS What is a database relationship and what are the benefits? What is a primary key and why is it used? What is a foreign key and why is it used? What is referential integrity and why is it used? 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 68 Types of Relationships graphic organizer Student Name Student Activity Period Date Types of Relationships Defining Characteristics Examples One-to-One One-to-Many Continued on next page 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 69 Types of Relationships graphic organizer Student Name Student Activity Period Defining Characteristics Date Examples Many-to-Many What is junction table and why is it used? 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 70 Guided Practice: Database Relationships Student Name Teacher Demonstration Period Date GUIDED PRACTICE: DATABASE RELATIONSHIPS In this activity, you will follow along with your teacher to establish a one-to-one relationship between two database tables. 1. Open the B&B Database. 2. Create a new table named Locations and enter the data below. The Inn field should be set as the primary key. Inn Street City State Zip Phone White Gate Inn and 173 E Chestnut St Asheville NC Cottage (1889) 28801 800-485-3045 Inn on Montford (1900) 296 Montford Ave Asheville NC 28801 800-254-9569 Secret Garden (1904) 56 N Main St Weaverville NC 28787 800-797-8211 46 & 48 Cumberland Abbington Green Asheville NC 28801 800-251-2454 Cir Albemarle Inn 86 Edgemont Rd Asheville NC 28801 800-621-7435 A Bed of Roses 135 Cumberland Ave Asheville NC 28801 888-290-2770 Biltmore Village Inn 119 Dodge St Asheville NC 28803 866-274-8779 Blake House Inn 150 Royal Pines Dr Asheville NC 28704 888-353-5227 Carolina Bed & 177 Cumberland Ave Asheville NC Breakfast 28801 888-254-3608 Cedar Crest Victorian 674 Biltmore Ave Asheville NC Inn 28803 828-525-1389 Chestnut Street Inn 176 E Chestnut St Asheville NC 28801 800-894-2955 Colby House Asheville NC Dry Ridge Inn 26 Brown St Weaverville NC 28787 800-839-3899 The Hawk & Ivy 133 N Fork Rd Barnardsville NC 28709 888-395-7254 Inn on Main Street 88 S. Main St Weaverville NC 28787 877-873-6074 The Lion and The Rose 276 Montford Ave Asheville NC 28801 800-546-6988 North Lodge on 84 Oakland Ave Asheville NC Oakland 28801 800-282-3602 Owl's Nest Inn at 2630 Smokey Candler NC Engadine Mountain Park Hwy 28715 800-665-8868 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 71 Guided Practice: Database Relationships Student Name 3. Teacher Demonstration Period Date Open the B&B table and set the Inn field as the primary key there as well. Notes: 4. Create a relationship between the two tables. Notes: 5. Set the link property to enforce referential integrity. What is referential integrity and what purpose does it serve? Notes: 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 72 Guided Practice: Database Relationships Student Name Teacher Demonstration Period Date Answer the following questions: 6. Describe and provide an example of a database relationship between two tables. 7. Describe and provide an example of referential integrity. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 73 Guided Practice: Database Relationships Teacher Key GUIDED PRACTICE: DATABASE RELATIONSHIPS Answer the following questions: 1. Describe and provide an example of a one-to-one database relationship between two tables. A one-to-one relationship between two tables means that one record in a linked table can only be connected to one record in another table. For example, a company may assign one car to each employee and key the information in two tables. One table is used to keep track of the name, address, and driver’s license number of the employee. The other table is used to keep information on the car such as the license plate number, mileage, make, and model. When an employee is assigned to another car, only the common field of the two tables needs to be updated. 2. Describe and provide an example of referential integrity. Referential integrity protects records from being deleted when they have related fields or records in a linked database. In the example above, referential integrity would prevent two cars from being assigned to the same driver or two cars from being assigned the same ID number. It would also prevent a driver from being deleted from a table if the driver is assigned to a car. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 74 Independent Practice: Database Relationships Name: Student Activity Period: Date: INDEPENDENT PRACTICE: DATABASE RELATIONSHIPS In this activity, you will work independently to create a one-to-one relationship between two database tables. 1. IDNo Create a new database using the information in the table below. Name the database StudentActivities and the table Student (or according to teacher directions). This table represents individual student records. Format the Class field as a LookUp Field (drop-down box) with the following choices: Freshmen, Sophomore, Junior, and Senior. Set the IDNo field as a primary key field and format it as number. FirstName LastName Middle Class Mentor Parent 123654 Alice Anderson A. Freshmen Adams 147852 Bill Baker B. Freshmen Bowman Bonita Baker 159753 Chris Clark C. Sophomore Cook Charles Clark 456987 Debra Davis D. Junior Deaver Don Davis 789321 Eddie Epperson E. Senior Ellison Earl Epperson 963258 Frank Fox F. Sophomore Feldon Fred Fox 595936 Greg Getty G. Senior Goode Glenn Getty 159438 Hillary Hanson H. Senior Hague Harold Hanson 224493 John Johnson J. Junior Jackson Jayson Johnson 2. Arthur Anderson Once all data has been entered, save and close the table. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 75 Independent Practice: Database Relationships Name: 3. Student Activity Period: Date: Create another table using the data below and name it Participation. Format IDNo as number and set it as the primary key. IDNo Activity 123654 Foreign Language 147852 Chess 456987 FBLA 789321 Skills USA 963258 FBLA 224493 SGA 4. Once all data has been entered, save and close the table. 5. Establish a relationship between the two tables using the ID field as the link. 6. Open the Student table and select the + button at the left on each student name to expand the relationships. 7. Answer the following questions: a. Why is this one-to-one relationship an effective method of displaying and keeping records of student information? b. How many students are involved in a club? c. How many students are involved in a sport? d. Which is the primary key? e. Which is the foreign key? f. What would make this data a one-to-many relationship? 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 76 Independent Practice: Database Relationships Teacher Key INDEPENDENT PRACTICE: DATABASE RELATIONSHIPS IDNo is the primary key for the Students table and the foreign key for the Participation table. If one student was allowed or linked to participation in more than one activity, the relationship status would change to one-to-many. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 77 Guided Practice: One-to-Many Relationships Student Name Teacher Demonstration Period Date GUIDED PRACTICE: ONE-TO-MANY RELATIONSHIPS Directions: In this activity, you will follow along with your teacher to create a one-tomany relationship between two database tables. 1. Create the database table below. Name the database Pet Registry and the table PetOwners. Set the OwnerID field as the primary key. PetOwners OwnerID Name Street City State Zip (919) 237-5454 Alvarez, Carlos 532 Compton Dr Raleigh NC 27609 (919) 444-3200 Archdale, Andy 234 Anderson Rd Raleigh NC 27608 (919) 541-8500 Blaine, Thomas 885 Tomato Ln Garner NC 27563 (919) 533-8566 Boxer, Rene 545 Irongate Rd Wake Forest NC 27555 (919) 555-3611 Carter, Jack 858 Miner Ln Clayton NC 27999 (919) 574-8567 Cheek, Libby 3843 John Riker Rd Burlington NC 28388 (919) 303-5208 Fuller, Cindy 23 Marks Dr Raleigh NC 27699 (919) 793-8574 Greggs, Tammy 2319 Southeast Rd Garner NC 28586 (919) 851-0787 Hall, Phyllis 2885 Winthrop Rd Raleigh NC 27569 (919) 854-8574 Hinson, Ted 5670 Ascot Way Wendell NC 27601 (919) 340-5350 Jones, Alice 434 Hope Church Rd Raleigh NC 27609 (919) 851-5688 Kline, Don 69 Candler Rd Burlington NC 27699 (919) 534-3421 Landis, Tony 658 Lumbar Dr Wendell NC 27800 (919) 857-8568 Lowery, Dana 674 Pebblecreek Ln Raleigh NC 28699 (919) 447-0007 Manness, Helen 342 Northcliff Rd Raleigh NC 27609 (919) 327-5618 Mannix, Joan 543 Anderson Dr Raleigh NC 27609 (919) 555-5235 Martin, Tad 8454 Low Country Rd Garner NC 27999 (919) 369-8545 Matthews, Ben 17 Blount St Raleigh NC 27555 Raleigh NC 29807 (919) 584-8578 McIntosh, Angela 8989 St Albans Rd 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 78 Guided Practice: One-to-Many Relationships Student Name Teacher Demonstration Period Date PetOwners OwnerID Name Street City State Zip (919) 555-8645 Myers, Amy 894 Tar Heel Ln Chapel Hill NC 27890 (919) 567-8950 Nelson, James 838 Duke St Durham NC 28485 (919) 584-8546 Oriole, Madge 4534 Logan Rd Wendell NC 28553 (919) 568-8574 Pulasky, Cam 333 New Castle Rd Durham NC 28384 (919) 743-5655 Reynolds, Bonnie 2311 Nifong Way Garner NC 28563 (919) 856-7896 Sprinkly, Dwight 907 Wolfpack Rd Raleigh NC 28977 (919) 584-5558 Tims, Delores 8999 Capital Blvd Raleigh NC 28388 (919) 333-9089 Tomlinson, Lucy 79 Glenwood Ave Raleigh NC 27601 (919) 752-2345 Wilson, James 4521 Robinhood Ln Raleigh NC 28694 (919) 855-0507 Yow, Donna 9678 Peace St Raleigh NC 27699 2. Create another table in the PetRegistry database using the information below. Name the table PetRoster. Set the PetID field as the primary key. PetRoster OwnerID PetID Pedigree Weight Age AdoptionDate S/N Shots (919) 534-3421 5101 Sheepdog 100 2 yr 10/9/2009 Yes Yes (919) 534-3421 5102 Cocker Spaniel 34 2 yr 12/9/2009 Yes Yes (919) 752-2345 5103 Shepherd 5 6 mo 10/8/2009 No No (919) 856-7896 5104 Poodle 14 2 yr 9/1/2009 Yes Yes (919) 555-5235 5105 Coon Hound 50 1 yr 11/8/2009 Yes Yes (919) 555-3611 5106 Yorkie 7 3 yr 12/12/2009 Yes Yes (919) 327-5618 5107 Weimaraner 70 2 yr 2/6/2009 Yes Yes (919) 327-5618 5108 Weimaraner 72 2 yr 2/6/2009 Yes Yes (919) 567-8950 5109 Corgi 25 1 yr 1/3/2009 Yes Yes (919) 369-8545 5110 Vizsla 45 1 yr 3/3/2009 Yes Yes (919) 547-8500 5111 Tosa Inu 170 2 yr 4/4/2009 Yes Yes 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 79 Guided Practice: One-to-Many Relationships Student Name Teacher Demonstration Period Date PetRoster OwnerID PetID Pedigree Weight Age AdoptionDate S/N Shots (919) 333-9089 5112 Tibetan mastiff 140 3 yr 4/5/2009 Yes Yes (919) 857-8568 5113 Scottish Terrier 21 4 yr 3/5/2009 Yes Yes (919) 574-8567 5114 Schnauzer 45 3 yr 5/2/2009 Yes Yes (919) 743-5655 5115 Rottweiler 130 2 yr 6/6/2009 Yes Yes (919) 555-8645 5116 Rat Terrier 12 1 yr 7/5/2009 Yes Yes (919) 555-8645 5117 Papillon 10 3 yr 6/6/2009 Yes Yes (919) 584-5558 5118 Otterhound 115 2 yr 7/6/2009 Yes Yes (919) 854-8574 5119 Newfoundland 150 3 yr 10/8/2009 Yes Yes (919) 237-5454 5120 Mastif 190 4 yr 11/10/2009 Yes Yes (919) 584-8546 5121 Lhasa Apso 13 2 yr 12/12/2009 Yes Yes (919) 584-8546 5122 Lowchen 18 3 yr 12/12/2009 Yes Yes (919) 854-8574 5123 Komondor 70 2 yr 12/12/2009 Yes Yes (919) 534-3421 5124 Kuvasz 114 3 yr 11/11/2009 Yes Yes (919) 447-0007 5125 Great Pyrenees 90 2 yr 12/25/2009 Yes Yes (919) 568-8574 5126 Keeshond 19 4 yr 4/2/2009 Yes Yes (919) 752-2345 5127 Jack Russell 17 3 yr 4/3/2009 Yes Yes (919) 793-8574 5128 Ibizan Hound 50 4 yr 8/3/2009 Yes Yes (919) 369-8545 5129 Irish Terrier 27 3 yr 9/8/2009 Yes Yes (919) 541-8500 5130 Havanese 10 2 yr 10/9/2009 Yes Yes (919) 333-9089 5131 Golden Retriever 75 4 yr 10/6/2009 Yes Yes (919) 854-8574 5132 Finnish Spitz 25 3 yr 11/9/2009 Yes Yes (919) 857-8568 5133 English Bulldog 54 2 yr 12/12/2009 Yes Yes (919) 851-5688 5134 Dachshund 11 3 yr 11/9/2009 Yes Yes (919) 444-3200 5135 Dalmation 40 2 yr 12/12/2009 Yes Yes (919) 340-5350 5136 Doberman Pinscher 90 3 yr 8/8/2009 Yes Yes 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 80 Guided Practice: One-to-Many Relationships Student Name Teacher Demonstration Period Date PetRoster OwnerID PetID Pedigree Weight Age AdoptionDate S/N Shots (919) 533-8566 5137 Cairn Terrier 13 2 yr 2/3/2009 Yes Yes (919) 303-5208 5138 Basset Hound 45 3 yr 3/29/2009 Yes Yes (919) 584-8578 5139 Akita 120 2 yr 3/31/2009 Yes Yes (919) 855-0507 5140 Affenpinscher 9 1 yr 4/25/2009 Yes Yes (919) 851-0787 5141 Great Dane 100 5 yr 5/28/2009 Yes Yes 3. Once the data is entered, set a one-to-many relationship between the PetOwners table and the PetRoster table. It is one-to-many because the pet owners may have more than one pet and all pet adoptions are kept on file in the PetRoster table. Follow the procedures for creating a relationship by joining the OwnerID field in the PetOwners table with the same field of the PetRoster table. Notes: 4. The county restricts the number of pets per household to three. Using the PetOwners table, determine how many additional pets can be adopted by the following pet owners by expanding the relationship column beside each owner’s name. a. Tony Landis, (919) 534-3421 b. Dana Lowery, (919) 857-8568 c. Ted Hinson, (919) 854-8574 d. Phyllis Hall, (919) 851-0787 5. In your own words, explain the difference between one-to-one and one-to-many. 6. How do you know which is the “one” and which is the “many” in this relationship? 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 81 Guided Practice: One-to-Many Relationships Teacher Key GUIDED PRACTICE: ONE-TO-MANY RELATIONSHIPS 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 82 Guided Practice: One-to-Many Relationships 6411 – Computer Applications I Summer 2008 Teacher Key Unit B – 5.01 – page 83 Guided Practice: One-to-Many Relationships Teacher Key 2. The county restricts on the number of pets per household to three. Using the PetOwners table, determine how many pets can be adopted by the following pet owners by expanding the relationship column beside each owner’s name. a. Tony Landis, (919) 534-3421 ..................................................................... 0 b. Dana Lowery, (919) 857-8568 ................................................................... 1 c. Ted Hinson, (919) 854-8574 ...................................................................... 0 d. Phyllis Hall, (919) 851-0787 ....................................................................... 2 3. In your own words, explain the difference between one-to-one and one-to-many. a. One-to-one is an established relationship that permits only one record matches between two tables. b. One-to-many is an established relationship that permits one record in one table to match many records in another table 4. In this relationship, each dog can only have one owner, but each owner can have more than one dog. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 84 Independent Practice: One-to-Many Relationships Student Name Student Activity Period Date INDEPENDENT PRACTICE: ONE-TO-MANY RELATIONSHIPS Directions: In this activity, you will work independently to create a one-to-many relationship between two database tables. 1. Open a new database and create the table below. Unless instructed otherwise, save the database as Publishers. Do not set a primary key. Publications Author Book Title Hosseini, Khaled A Thousand Splendid Suns Hopkins, Ellen Crank Meyer, Stepheni Eclipse Evanovich, Janet Four to Score Rowling, J K Harry Potter and the Chamber of Secrets Rowling, J K Harry Potter and the Deathly Hallows Rowling, J K Harry Potter and the Goblet of Fire Rowling, J K Harry Potter and the Half-Blood Prince Rowling, J K Harry Potter and the Order of the Phoenix Rowling, J K Harry Potter and the Prisoner of Azkaban Rowling, J K Harry Potter and the Sorcerer's Stone Rowling, J K Harry Potter: Paperback Box Set Evanovich, Janet Lean Mean Thirteen Meyer, Stepheni New Moon Evanovich, Janet Plum Lovin' Dungy, Tony Quiet Strength Hillerman, Tony Skeleton Man Hautman, Pete Sweetblook Hillerman, Tony The Dark Wind 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 85 Independent Practice: One-to-Many Relationships Student Name Student Activity Period Date Publications Author Book Title Hosseini, Khaled The Kite Runner Hillerman, Tony The Shape Shifter Hillerman, Tony The Wailing Wind Evanovich, Janet Three to Get Deadly Evanovich, Janet Twelve Sharp Meyer, Stephenie Twilight 2. Save the table as Publications unless otherwise instructed by your teacher 3. Create another table using the information below. Unless instructed otherwise, save the table as Authors. Set Author as the primary key. Authors Author Publisher Evanovich, Janet Penguin Putnam Inc Hautman, Pete Fulcrum Books Hillerman, Tony Random House Hopkins, Ellen Penguin Putnam Inc Hosseini, Khaled Harper Books Meyer, Stepheni Reader's Choice Rowling, J K Markee Brothers 4. Once both tables have been created, saved, and closed, establish a one-to-many relationship between the Authors table and the Publications table 5. Open the Authors table and expand the relationship for each author 6. Save and submit your work according to teacher directions 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 86 Independent Practice: One-to-Many Relationships Teacher Key INDEPENDENT PRACTICE: ONE-TO-MANY RELATIONSHIPS 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 87 Guided Practice: Many-to-Many Relationships Student Name: Period: Teacher Demonstration Date: GUIDED PRACTICE: MANY-TO-MANY RELATIONSHIPS Directions: For this activity, you will follow along with your teacher to complete a many-to-many relationship. In a many-to-many relationship, two tables with a oneto-many relationship are linked by a junction table. The Beach Rentals database contains three tables. The Properties table contains the names of the properties, property addresses, and owner information. The Customers table lists the names and contact information of renters. The Rentals table is the junction table. Notes: Which are the primary keys? Which are the foreign keys? If referential integrity is enforced, what affect will it have on the data? 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 88 Guided Practice: Many-to-Many Relationships Student Name: Period: Teacher Demonstration Date: Create three database tables from the information below in one database. Customers Table. Set the CustomerID field as the primary key. Use an input mask for the Phone field. Properties Table. Set the PropertyID field as the primary key. Use an input mask for the OwnerPhone field. Notes: 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 89 Guided Practice: Many-to-Many Relationships Student Name: Period: Teacher Demonstration Date: Rentals Table. This is the junction table. Use the Lookup property for the CustomerName and PropertyName fields using data from the Customers and Properties tables. Use AutoNumber for the ID field and set it as the primary key. Notes: 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 90 Guided Practice: Many-to-Many Relationships Student Name: Period: Teacher Demonstration Date: View/establish the relationships and enforce referential integrity Notes: Questions for discussion: How can this type of relational database be used in business? Why is it important to understand database relationships? Why is it important to enforce referential integrity in this database? 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 91 Guided Practice: Many-to-Many Relationships Teacher Key GUIDED PRACTICE: MANY-TO-MANY RELATIONSHIPS CustomerID is the primary key in the Customers table and it corresponds with the foreign key, CustomerName, in the Rentals table. PropertyID is the primary key in the Properties table and it corresponds to the foreign key, PropertyName in the Rentals table. With referential integrity enforced, if an attempt is made to delete a customer from the Customers table and the customer has a matching record in the Rentals table, an error message will appear. If this were a true company that managed beach rentals, think about how upset the customer would be if their rental name was deleted and they were unable to enjoy their vacation. Class discussion questions should generate dialogue about how industries and businesses use relational databases and why knowledge of this concept is important for understanding how powerful and vital a database can be to a business. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 92 Independent Practice: Many-to-Many Relationships Student Name: Period: Student Activity Date: INDEPENDENT PRACTICE: MANY-TO-MANY RELATIONSHIPS Directions: For this activity, you will work independently to create a many-tomany relationship. 1. Create a new database named Flights 2. Create a new table named Pilots using the information in the table on the right 3. Set the PilotID field as the primary key 4. Format the PilotID field as Number 5. Use PilotName as the field name for the next column and enter the caption Pilot Name 6. Create another table named Flights and format it as follows: Field Name Data Type Caption Notes Flight# Number Same Make this the primary key Airline LookUp Same Create a lookup field with theses choices: • • • • DepartureCity Text Departs from DepartureTime Input Mask; medium time Depart Time ArrivalCity Text Arrives at ArrivalTime Input Mask; medium time Arrive Time FlightTime Input Mask; _hr _m (custom format) Duration Cost Currency Same 6411 – Computer Applications I US Airways Northwest Continental Delta Summer 2008 Your teacher will guide you through this step Unit B – 5.01 – page 93 Independent Practice: Many-to-Many Relationships Student Name: 7. Period: Student Activity Date: Enter the data below into the Flights table and then save and close the table Flights 8. Create a Reservations table using CustomerName, IDNo, and Flight# as field names 9. Enter Customer Name as the caption the CustomerName field 10. Format IDNo as number and the primary key 11. Insert a comment indicating that IDNo is the customer’s ID 12. Format the Flight# field as number 13. Enter the data on the right 14. Save and close the table Reservations Junction 6411 – Computer Applications I 15. Create a fourth table and name it Junction 16. The table will have three fields: IDNo, Flight#, and PilotID 17. Format all fields as number 18. Enter the data (on the left) 19. Save and close the table Summer 2008 Unit B – 5.01 – page 94 Independent Practice: Many-to-Many Relationships Student Name: Period: Student Activity Date: 20. Create a relationship between all tables by linking the primary keys of the Reservations, Pilots, and Flights tables to their matching fields in the Junction table. 21. Open the Flights table and answer the following questions: 22. 23. 24. a. How many pilots does Flight 919 have? b. How many customers does Flight 919 have? c. How many customers does Flight 1701 have? d. How many pilots does Flight 1701 have? Open the Pilots table and answer the following questions: a. Which pilot has the most passengers? b. Which pilot has the least? How is the cross referenced information provided by the relationships helpful to the following people: a. Customers b. Pilots c. Airline stewards d. Reservations specialists Save and submit your work according to teacher dirctions 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 95 Independent Practice: Many-to-Many Relationships Teacher Key INDEPENDENT PRACTICE: MANY-TO-MANY RELATIONSHIPS 1. 2. 3. Open the Flights table and answer the following questions: a. How many pilots does Flight 919 have? ...................................................1 b. How many customers does Flight 919 have? ...........................................2 c. How many customers does Flight 1701 have? .........................................7 d. How many pilots does Flight 1701 have? .................................................2 Open the Pilots table and answer the following questions: a. Which pilot has the most passengers? .................................... Dan Motley b. Which pilot has the least? ..................................................... Annie Penny How is the cross referenced information provided by the relationships helpful to the following people: a. Customers Customers can find out flight information, such as flight number and pilot information. If concerned about safety, they may choose to check out the pilot on the Internet. b. Pilots Pilots can quickly see how full their flight is c. Airline stewards Airline stewards can check the flight roster d. Reservations specialists Reservations specialists can view flight data to find out how many spaces are left and answer customer inquiries about flight arrival and departure times 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 96 Guided Practice: Importing Data Student Name: Teacher Demonstration Period: Date: GUIDED PRACTICE: IMPORTING DATA Data used in a database table can be imported from other sources. In this exercise, you will follow along with your teacher to import a word processing file into a database. The procedures for importing data require that the data be arranged in rows and columns. When importing a data processing document, the file format must be saved as text. Directions: 1. Using word processing software, key the information below (raw data) in the exact format with the commas, spacing, and line returns. Raw Data: Event No.,Event,Level,Transcript,Objective Test 1,Accounting I,HS,Y,Y 2,Accounting II,HS,Y,Y 4,Banking and Financial Systems,HS,N,Y 5,Business Calculations,HS,N,Y 6,Business Communication,HS,N,Y 10,Business Law,HS,Y,Y 11,Business Math,HS,Y,Y 14,Business Procedures,HS,Y,Y 2. Save the data in text format. 3. Open the database software and name the database FBLA unless otherwise instructed. 4. Follow procedures for importing the data into a database table. Notes: 5. Store the data in a new table. Name the table Competitive Events unless instructed otherwise. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 97 Independent Practice: Importing Data Student Name: Student Activity Period: Date: INDEPENDENT PRACTICE: IMPORTING DATA Directions: In this exercise, you will work independently to import a word processing file into a database. Key the data below using word processing software and save it in text format using a file name assigned by your teacher. Import the data into a database table and submit your work according to teacher directions. Complete the written response section at the end of this activity. Points to Remember: Remember, you must have an open database before you can import a file. Once the data has been imported, format the field properties so that the Enrollment field has comma separators and zero decimal places and the Tuition fields are formatted as currency. Name the database according to teacher directions. Answer the questions at the end of this activity and submit your work. Raw Data: Name,Ownership,Type,Enrollment,InState,OutofState Appalachian State,Public,4 yr,14653,$4000,$13600 East Carolina,Public,4 yr,22767,$4487,$15000 Fayetteville,Public,4 yr,5441,$3860,$13596 A & T,Public,4 yr,10383,$4200,$13000 UNC Chapel Hill,Public,4 yr,26878,$5513,$19311 UNC Greensboro,Public,4 yr,15329,$49440,$16500 UNC Wilmington,Public,4 yr,11574,$4694,$14405 Winston-Salem State,Public,4 yr,4805,$3905,$12545 Written Response: Write a step by step procedure for importing data from a word processing file into a database table. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 98 Independent Practice: Importing Data Teacher Key INDEPENDENT PRACTICE: IMPORTING DATA Procedure for Importing Data into a Database Table: (May vary with software) 1. Format the raw source data in columns and rows separated by spaces or commas. 2. Save the raw source data in plain text format. 3. Open and save a new database. 4. Use the menu or wizard options to import the source data. 5. Select the appropriate options regarding type of delimiters and headings. 6. Name the table. 7. Complete the import. 8. Format the data if required. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 99 Database Concept Review Student Activity Student Name: Period: Date: DATABASE CONCEPT REVIEW Directions: Answer the questions below. 1. In your own words provide the definition of a database. 2. List 3 examples of a database. 3. What is a database relationship? 4. Number the following database elements in order from largest to smallest. a. _____ Field c. _____ Record b. _____ Database d. _____ Entry 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 100 Database Concept Review Student Name: 5. Student Activity Period: Date: Match the field types with the correct definition. Text a. Allows you to create a finite set of choices for that field’s entry values. Number b. Is a true/false field Lookup Wizard c. Date and time entries in various formats. Date/Time d. This includes not only words, but also numbers not used in calculations. Currency e. This field may not include anything other than numbers. AutoNumber f. Like text, but max of 64,000 characters. Yes/No g. Creates fields that automatically enter a unique number when a record is added. h. Currency values expressed in various formats. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 101 Database Concept Review Teacher Key DATABASE CONCEPT REVIEW Directions: Answer the questions below. 1. In your own words provide the definition of a database. • Student answers will vary 2. List 3 examples of a database. • • • • • • • • • • • • • • • Telephone book| Computerized Library card catalog Student data (NCWISE) iTunes Personal address book CD-Rom Encyclopedias Job Search Fingerprint database Customer contact list Houses for sale and MLS listings online Hospital/patient data Business stock inventory Barcode scanners keep inventory in databases Internet search engines database Encyclopedias & Dictionaries 3. A database relationship is a link between common fields of two or more tables in a database. 4. Number the following database elements in order from largest to smallest. 1 Database 3 Field 2 Record 4 Entry 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 102 Database Concept Review Teacher Key 5. Match the field types with the correct definition. D Text a. Allows you to create a finite set of choices for that field’s entry values. E Number b. Is a true/false field A Lookup Wizard c. Date and time entries in various formats. C Date/Time d. This includes not only words, but also numbers no used in calculations. H Currency e. This field may not include anything other than numbers. G AutoNumber f. Like text, but max of 64,000 characters. B Yes/No g. Creates fields that automatically enter a unique number when a record is added. h. Currency values expressed in various formats. 6411 – Computer Applications I Summer 2008 Unit B – 5.01 – page 103