Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mgt 240 Lecture MS Excel and Access: Introduction to Databases September 23, 2004.

Similar presentations


Presentation on theme: "Mgt 240 Lecture MS Excel and Access: Introduction to Databases September 23, 2004."— Presentation transcript:

1 Mgt 240 Lecture MS Excel and Access: Introduction to Databases September 23, 2004

2 Miscellaneous Homework 3 grades posted Friday or Saturday Homework 3 grades posted Friday or Saturday Homework 4 due next Friday, 10/1/04, by 5pm Homework 4 due next Friday, 10/1/04, by 5pm Posted grade spreadsheets and scrolling to see comments Posted grade spreadsheets and scrolling to see comments Grading questions – review question in homework before asking what you did wrong! Grading questions – review question in homework before asking what you did wrong! Please use a different name for your turned in homework than the original homework name – that way you’re more likely to turn in the right file Please use a different name for your turned in homework than the original homework name – that way you’re more likely to turn in the right file

3 Today’s Objectives Introduction to Databases Introduction to Databases Excel database capabilities Excel database capabilities Relational databases Relational databases Access Access

4 Database Definition An integrated collection of data that is organized to meet the informational needs of multiple users in an organization An integrated collection of data that is organized to meet the informational needs of multiple users in an organization Database examples Database examples

5 The Traditional Approach To Data Management

6 The Database Approach to Data Management

7 The Hierarchy of Data

8 Field, Record, Table Field Field - a single characteristic or attribute of a person, place, object, event or idea (column) Record Record - a collection of field values (row) Table Table - a collection of records

9 Keys and Attributes

10 Excel Databases

11 Using Excel to Create Databases Databases are called “Lists” in Excel Databases are called “Lists” in Excel Excel provides features that allow you to maintain lists of information such as customer lists, telephone lists, inventory lists, and so on. Excel provides features that allow you to maintain lists of information such as customer lists, telephone lists, inventory lists, and so on. An Excel list is a collection of rows and columns that contain similar data. An Excel list is a collection of rows and columns that contain similar data. In a worksheet, each column represents a field of data and each row represents a record of data. In a worksheet, each column represents a field of data and each row represents a record of data. The first row of the list always contains the name of the fields and is called a field header row. The first row of the list always contains the name of the fields and is called a field header row.

12 An example of an Excel list Gourmet.xls

13 Freeze rows and columns When you scroll through large amounts of data in a worksheet, you can move data off the screen. When you scroll through large amounts of data in a worksheet, you can move data off the screen. If you prefer to have portions of data remain on the screen at all times, such as the column and/or row headings, you can freeze a portion of the list so that it remains while the rest of the data scrolls. If you prefer to have portions of data remain on the screen at all times, such as the column and/or row headings, you can freeze a portion of the list so that it remains while the rest of the data scrolls. To freeze rows and columns: To freeze rows and columns: Click in a cell to select it Click in a cell to select it Click Window on the menu bar, and then click Freeze Panes to freeze the rows above the selected cell, and the columns to the left of the selected cell Click Window on the menu bar, and then click Freeze Panes to freeze the rows above the selected cell, and the columns to the left of the selected cell Excel will display dark vertical and horizontal lines to indicate the rows and columns that are frozen Excel will display dark vertical and horizontal lines to indicate the rows and columns that are frozen

14 A frozen datasheet Gourmet.xls Gourmet.xls Gourmet.xls

15 Find and replace values in a worksheet The Find command allows you to search through the data in a worksheet for a particular character string. The Find command allows you to search through the data in a worksheet for a particular character string. Optionally, you can choose to replace the character string with another string. Optionally, you can choose to replace the character string with another string. This procedure is called Find and Replace. This procedure is called Find and Replace. For example, you might want to find every occurrence of ACCT and replace it with Accounting For example, you might want to find every occurrence of ACCT and replace it with Accounting

16 The Find and Replace dialog box Gourmet.xls

17 Sort data in a list Excel makes it easy to sort a list in ascending or descending order based on any field(s) in the list. Excel makes it easy to sort a list in ascending or descending order based on any field(s) in the list. The field(s) selected on which to sort are called the sort fields or the sort keys. The field(s) selected on which to sort are called the sort fields or the sort keys. You may choose to sort the data on a single field or on a collection of fields. You may choose to sort the data on a single field or on a collection of fields.

18 Sort using a single sort key Gourmet.xls

19 Sort using multiple keys Gourmet.xls

20 Use a data form to enter, search for, edit, and delete records Sometimes it is easier to view the data in a list through a data form. Sometimes it is easier to view the data in a list through a data form. A data form is a dialog box that you can use to arrange data to view one record at a time. A data form is a dialog box that you can use to arrange data to view one record at a time. You can use the data form to display records, to search for records, to modify records, and to delete records from the Excel list. You can use the data form to display records, to search for records, to modify records, and to delete records from the Excel list.

21 An Excel data form Gourmet.xls

22 Filter data in a list using AutoFilters Sometimes you will want to see a portion of the records instead of all of them. Sometimes you will want to see a portion of the records instead of all of them. The process of displaying only those records that meet some criteria is called Filtering. The process of displaying only those records that meet some criteria is called Filtering. When data in the list is filtered, records that do not meet your criteria are hidden. When data in the list is filtered, records that do not meet your criteria are hidden. These records are not removed from the list and, therefore, can be redisplayed by removing the filter These records are not removed from the list and, therefore, can be redisplayed by removing the filter Simple filters can be specified by clicking the list arrow on any field name cell. Simple filters can be specified by clicking the list arrow on any field name cell. More complex filters must be created using the Custom AutoFilters option. More complex filters must be created using the Custom AutoFilters option.

23 AutoFilter options Gourmet.xls

24 Apply conditional formatting to a range There are times when you will want data to have a different appearance if it meets some criteria. There are times when you will want data to have a different appearance if it meets some criteria. For example, you might want data to appear in red, if the data is more than six months old For example, you might want data to appear in red, if the data is more than six months old Or, you might want a value to be black if it is positive and red if it is negative Or, you might want a value to be black if it is positive and red if it is negative This kind of formatting is called conditional formatting. This kind of formatting is called conditional formatting. You specify the condition under which you want the formatting to take place and what the formatting should be. You specify the condition under which you want the formatting to take place and what the formatting should be.

25 The Conditional Formatting dialog box Gourmet.xls

26 Insert subtotals into a list The data in a list can be summarized by adding subtotals to the list. The data in a list can be summarized by adding subtotals to the list. You can include summary information such as a count, a sum, an average, a minimum value, and or a maximum value. You can include summary information such as a count, a sum, an average, a minimum value, and or a maximum value. When the Subtotals command is applied to the list, a subtotal row is automatically added to the list. When the Subtotals command is applied to the list, a subtotal row is automatically added to the list. You can specify that you want the subtotal(s) to apply to the worksheet and/or groups within the worksheet. You can specify that you want the subtotal(s) to apply to the worksheet and/or groups within the worksheet.

27 The Subtotal dialog box Gourmet.xls

28 An Excel datasheet with totals added

29 Use the subtotals outline view Previously you learned about creating subtotal lines within a worksheet. Previously you learned about creating subtotal lines within a worksheet. Sometimes, it might be more beneficial to view the summary information only. Sometimes, it might be more beneficial to view the summary information only. You can do this by displaying the data in Subtotals Outline View. You can do this by displaying the data in Subtotals Outline View. You may choose from Level 1, Level 2, and Level 3 outline view. You may choose from Level 1, Level 2, and Level 3 outline view.

30 Totals displayed in Outline view Gourmet.xls

31 When to Use Excel for a Database Use Excel when you: Use Excel when you: Require a flat or non-relational view of your data (you do not need a relational database with multiple tables). Require a flat or non-relational view of your data (you do not need a relational database with multiple tables). This is especially true if that data is mostly numeric—for example, if you want to maintain a financial budget for a given year. This is especially true if that data is mostly numeric—for example, if you want to maintain a financial budget for a given year. Want to run primarily calculations and statistical comparisons on your data—for example, if you want to show a cost/benefit analysis in your company's budget. Want to run primarily calculations and statistical comparisons on your data—for example, if you want to show a cost/benefit analysis in your company's budget. Know your dataset is manageable in size (no more than 15,000 rows). Know your dataset is manageable in size (no more than 15,000 rows).

32 Access Databases

33 Data Redundancy A problem that occurs when a database is set up inefficiently. Leads to data entry errors. This example illustrates a “flat file” (like an Excel list) with redundant data. This table would be better divided into two tables containing “like” data -- Customer Information and Order Information. This process is called Data Normalization. Gourmet.xls

34 Normalizing Gourmet.xls Reduce redundancy in data Reduce redundancy in data Logically organize data into separate, distinct entities Logically organize data into separate, distinct entities Separate objects, people, events Separate objects, people, events Specify relationships between entities Specify relationships between entities Gourmet.xls Gourmet.xls Gourmet.xls How many separate entities can you identify in this file? How many separate entities can you identify in this file?

35 Fields in Entities in Gourmet.xls Customer Customer CompanyName CompanyName Country Country

36 Relationships between Entities in Gourmet.xls Customer Company Name Country Product Product Name Category UnitPrice SalesRep Order OrderDate Quantity Discount Freight Shipper

37 Primary Keys in Entities in Gourmet.xls Customer Company Name * Country Product Product Name * Category UnitPrice SalesRep * Sales Rep Order OrderDate Quantity Discount Freight Shipper Shipper *

38 Foreign Keys in Entities in Gourmet.xls Customer Company Name * Sales Rep ** Country Product Product Name * Category UnitPrice SalesRep * Sales Rep Order Product Name ** Company Name ** OrderDate * Quantity Discount Freight Shipper ** Shipper Shipper * Combined Primary Key

39 Primary & Foreign Keys Primary Key Field: A field whose value uniquely identifies each record in the table Foreign Key Field: A primary key field from one table placed in a second table to form a relationship between the tables

40 Relational database and keys A relational database is a collection of tables that are related to one another based on a common field. A relational database is a collection of tables that are related to one another based on a common field. A field, or a collection of fields, is designated as the primary key. A field, or a collection of fields, is designated as the primary key. The primary key uniquely identifies a record in the table. The primary key uniquely identifies a record in the table. When the primary key of one table is represented in a second table to form a relationship, it is called a foreign key. When the primary key of one table is represented in a second table to form a relationship, it is called a foreign key.

41 Relational Database Model

42 Creating a Relational Database in Access Create tables in design view Create tables in design view Specify fields Specify fields Make sure to include foreign keys Make sure to include foreign keys Specify primary key Specify primary key Gourmet.mdb Gourmet.mdb Gourmet.mdb

43 What is an Access query? If you want to see just a portion of the data in a table or tables you can create a query. If you want to see just a portion of the data in a table or tables you can create a query. A query is a question you ask about the data stored in a database table or tables. A query is a question you ask about the data stored in a database table or tables. Access responds by displaying the data according to your question. Access responds by displaying the data according to your question. For example, if you ask to see all the customers from New York, the response would be to display only the records whose state field matches with NY For example, if you ask to see all the customers from New York, the response would be to display only the records whose state field matches with NY Gourmet.mdb Gourmet.mdb Gourmet.mdb

44 Linking Database Tables to Answer a Query

45 When to Use Access for a Database Require a relational database (multiple tables) to store your data. Require a relational database (multiple tables) to store your data. May need to add more tables in the future to an originally flat or non-relational data set. May need to add more tables in the future to an originally flat or non-relational data set. Have a very large amount of data (thousands of entries). Have a very large amount of data (thousands of entries). Have data that is mostly of the long text string type (not numbers or defined as numbers). Have data that is mostly of the long text string type (not numbers or defined as numbers). Rely on multiple external databases to derive and analyze the data you need. Rely on multiple external databases to derive and analyze the data you need. Need to maintain constant connectivity to a large external database such as one built with Microsoft SQL Server. Need to maintain constant connectivity to a large external database such as one built with Microsoft SQL Server. Want to run complex queries. Want to run complex queries. Have many people working in the database and want robust options to expose that data for updating. Have many people working in the database and want robust options to expose that data for updating.

46 More Access Resources from Microsoft Using Access or Excel to manage your data Using Access or Excel to manage your data Using Access or Excel to manage your data Using Access or Excel to manage your data Sample Access databases that you can download and adapt Sample Access databases that you can download and adapt Sample Access databases that you can download and adapt Sample Access databases that you can download and adapt About Access databases About Access databases About Access databases About Access databases About designing a database About designing a database About designing a database About designing a database Description of the database normalization basics Description of the database normalization basics Description of the database normalization basics Description of the database normalization basics Roadmap to Access 2003 training Roadmap to Access 2003 training Roadmap to Access 2003 training Roadmap to Access 2003 training

47 Assigned Reading Work through Tutorial 5 (pp. 195-225) in Excel 2003 text Work through Tutorial 5 (pp. 195-225) in Excel 2003 text Following are the tasks you should be able to perform using Excel’s list features: Following are the tasks you should be able to perform using Excel’s list features: Freeze rows and columns Freeze rows and columns Use find and replace Use find and replace Create a list range Create a list range Sort data Sort data Maintain a list Maintain a list Use a data forms Use a data forms Filter a list Filter a list Use conditional formatting Use conditional formatting Use the total row to calculate totals in a list Use the total row to calculate totals in a list Insert subtotals into a list Insert subtotals into a list Use the subtotals outline view Use the subtotals outline view


Download ppt "Mgt 240 Lecture MS Excel and Access: Introduction to Databases September 23, 2004."

Similar presentations


Ads by Google