Download presentation
Presentation is loading. Please wait.
1
ISP 121 Week 1 Introduction to Databases
2
ISP 121, Winter 20072 Why a database and not a spreadsheet? You have too many separate files or too much data in a single file You need to look at the data in many different ways You need to share the data You want to secure access to the data and control data values
3
ISP 121, Winter 20073 Basic Terms Table – an object you define and use to store data. Each table contains information about a particular subject, such as customers, patients, or orders Field – tables contain fields (columns) such as first name, last name, street address Record – tables contain records (rows): a logical collection of fields Query – an object that provides a custom view of data from one or more tables
4
ISP 121, Winter 20074 Table Examples Home address / phone book CD collection Old car club Class roster
5
ISP 121, Winter 20075 Field Attributes (Data Types) You want to create fields for Name, Address, Telephone, … Text – the most common! Number – do NOT use unless you plan to do arithmetic with this field Date/Time Currency AutoNumber – similar to Number but Access automatically inserts the numbers for you Yes/No (and others)
6
ISP 121, Winter 20076 Keys and indexes Index field – Records can be accessed in sorted order by this field; there can be several index fields Primary key field – An index field whose values are unique; there can be at most one primary key field
7
ISP 121, Winter 20077 Let’s Practice Let’s run the program Access and create a simple table and then enter some data for the example Home Address Phone Book Did you correctly assign the type for each field? Did you select the field as an index? Did you create a primary key?
8
ISP 121, Winter 20078 Finding a Record A very simple way to look for a record But you can only search in one table, and you can only look for one field Open the table, then click on the Edit pull down menu and select Find (or CTRL-F) Enter values as necessary Wildcard character: * Find is no where near as powerful as performing a query (later)
9
ISP 121, Winter 20079 Filtering Records If you want to see all the rows in a table that match any part of a value, you can use the Filter command A couple different forms of Filter. Let’s look at Filter by Selection Open the table you want to filter. Highlight the field you want to filter on. Click on the filter by selection button (or go to Records / Filter / Filter by Selection)
10
ISP 121, Winter 200710 Importing Data into a “Flat” Access Database Many times you want to take an existing data set and “import” it into an Access database The existing data set can be plain text (.txt), a spreadsheet (.xls), or other forms of existing databases Let’s consider the example of importing a spreadsheet into an Access database
11
ISP 121, Winter 200711 Importing Spreadsheet Data Open the Access database that will receive the spreadsheet data Select Get External Data from File menu, then select Import Select the appropriate file you want to import
12
ISP 121, Winter 200712 Importing Spreadsheet Data If the spreadsheet you are importing has more than one worksheet, select the appropriate worksheet Does the first row contain column headings? Importing into a new table or appending to an existing table?
13
ISP 121, Winter 200713 Importing Spreadsheet Data Now you can tell the wizard which fields should be indexed in the new table Choose your own primary key or let Access add a primary key? Give the table a name and click on Finish You may have import errors – check the file xx$_ImportErrors
14
ISP 121, Winter 200714 Importing Spreadsheet Data Let’s try an example – we will import the data in spreadsheet Presidents.xls
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.