Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building The Database Chapter 2

Similar presentations


Presentation on theme: "Building The Database Chapter 2"— Presentation transcript:

1 Building The Database Chapter 2
Use the quote as a jumping off point for discussion, if desired.

2 Learn different techniques for:
Chapter Introduction Learn different techniques for: Creating tables Entering data Verifying data Relating tables Documenting database objects Backing up database Repairing database Securing data

3 Tools Covered in This Chapter
Database Documenter Database security Datasheet view Design view Import Spreadsheet Wizard Input Mask Wizard Lookup Wizard Relationships window Subdatasheet

4 Level 1 Objectives: Creating the Database Tables
Review the database design Create the database tables using the database design Work in Design view

5 Creating the Database Tables: Reviewing the Database Design
Make sure that the database stores data in the correct format and outputs the correct queries, forms, and reports Analyze the client’s needs and make sure the design is easy to understand Limit the scope of a new system

6

7 Creating the Database Using the Database Design
Start Access click New tab in the navigation bar on the File tab Database window Main control panel for database Navigation pane Located on the left side of the window Lists all objects (tables, reports, etc.) in the database

8 Creating a Table by Entering Data in Datasheet View
Shows table’s records in rows and table’s fields in columns Table window Indicates table’s name Just start entering data Access adds ID field to datasheet

9 Datasheet View

10 Creating a Table by Entering Data in Datasheet View (cont’d.)
Click save button Save as dialog box Enter table name Change to design view Click view button in Views group on the Home tab

11 Working in Design View Design view Table design grid
Define table’s fields and field properties Rearrange order of fields as necessary Table design grid Top part of design view Includes Field Name, Data Type, and Description columns Each row Field in table

12 Working in Table Design View (cont’d.)
Field properties pane Bottom part of design view Displays field properties for selected field Rules when naming fields and database objects Up to 64 characters and any combination of: Letters Numbers Spaces Special characters except ., !, `, [, and ]

13 Working in Design View (cont’d.)
Rules when naming fields and database objects (cont’d.) Cannot begin with space Some organizations establish standards for naming objects and fields Field size property Limit number of characters to store in Short Text field Set the type of numeric data in Number field Create a reasonable margin of error

14 Adding Descriptions to Fields in Table Design View
Description property Document contents Identify field as primary or foreign key Provide users with instructions about entering values into field Primary Key button Access adds a key symbol to indicate the table’s primary key

15 Creating a Table in Design View
Click Table Design button on Create tab Enter field names, data types, and properties

16 Evaluating and Testing the Table Design
By moving to next record Access saves record in table To cancel record Press Esc key After designing table Evaluate for potential problems

17 Displaying Descriptive Field Names Using the Caption Property
Changes way field name is displayed Specifies how field name will appear in different database objects Default caption property Field name for all data types

18 Formatting Field Values Using an Input Mask
Predefined format Applied to field Values are displayed using format specified Ensures that all of necessary data entered Literal characters Not stored in database User does not need to type them Use the Input Mask Wizard

19 Input Mask Characters and Descriptions

20 Validating Fields to Ensure Accurate and Consistent Data
Validation rule Compares data entered by user against one or more valid values Validation Rule property Specifies valid values that users can enter Validation Text property Opens a dialog box that explains the valid values

21 Validating Fields to Ensure Accurate and Consistent Data (cont’d.)

22 Automating Data Entry by Using a Default Field Value
Default Value property Enters default value into any type of field Except for AutoNumber field

23 Automating Data Entry by Using a Lookup Field
Lets user select field value From: List of existing field values stored in database List of values specified when lookup field created Change field’s data type to Lookup

24 Level 1 Summary Create tables by: Customizing tables Entering data
Using design view Customizing tables Captions Validation rules Using Lookup

25 Level 2 Objectives: Populating and Relating the Database Tables
Create additional tables for the database Import data into a database Work with primary and foreign keys Create one-to-many and many-to-many relationships between tables Use a subdatasheet to view related records

26 Populating the Database Tables
Populating database Load tables with data Enter data in Datasheet view Import data Copy and Paste Import from Excel workbook

27 Importing and Copying Records from One Table to Another
Import existing data from another Access table Table structure must be identical Open tables in Datasheet view Select all of records Click Copy button Open target database table Click Paste button

28 Importing Data from an Excel Workbook
Can import data and create table at same time Review contents of workbook to understand how it is arranged If column heading names comply with rules for naming fields in Access: Access uses them as field names data imported If column headings are absent/do not comply: Access assigns generic field names

29 Importing Data from an Excel Workbook (cont’d.)
Access can import most data from worksheet But not graphics Formulas converted to numbers Hyperlinks imported as text data Usually, the entire worksheet is imported Can import named ranges of data

30

31 Setting a Primary Key Field

32 Working with Primary and Foreign Keys
Primary key and foreign key counterparts Must have same data type, field size, and field values Primary key value Must exist before entering corresponding record if referential integrity is set Cannot be null Required property Nonprimary key field Ensures that users enter value into field

33 Working with Primary and Foreign Keys (cont’d.)
Works to make data retrieval faster Access creates index for primary key field Index List maintained by database Associates field values in indexed field with records that contain field values

34 Increase speed at which access searches Open table in design view
Creating an Index Increase speed at which access searches Open table in design view Select field to index Click indexed property list arrow Create index for any field Except fields of type Calculated Attachment OLE object

35

36 Creating an Index (cont’d.)
View indexes created in table Click indexes button on Show/Hide group on Design tab Create indexes for as many fields as necessary to optimize searches in database Records indexed when table saved Updated automatically as records added, deleted, or changed As database grows Indexes might slow down database

37 Creating an Index (cont’d.)
Increases size of database Slows down database Must update index as users add, change, and delete records Add indexes as needed When improved query performance is necessary Delete indexes to: Increase speed Reduce file size

38 Creating One-to-Many Relationships Between Tables
Open relationships window Click relationships button on Database Tools tab Relationship has certain properties Type One-to-many One-to-one Many-to-many Attributes Specify how to manage changes when records updated or deleted

39

40 Edit Relationships Dialog Box

41 Creating a Many-To-Many Relationship Between Tables
In Design view A junction table to create the many-to-many relationship The primary key is a combination of fields Referred to as a composite primary key Create the one-to-many relationship between individual tables involved Create the many-to-many relationship

42 Using a Subdatasheet to View Related Records
After importing data into database Open each table in Datasheet view Check data for problems Expand indicator (box with the plus sign) appears for relationships Click to view subdatasheet with the related records

43 Create relationships using Relationships Window
Level 2 Summary Import data from Other Access tables Excel Index Used to aid searches Create relationships using Relationships Window

44 Quick Quiz What is a null value?
A null value is one that is unknown or unavailable or missing. Which property should be used to ensure that users enter a value into a field? The required property True or False? Only two tables are required in a many-to-many relationship. False True or False? A junction table will always have a composite key. True

45 Level 3 Objectives: Maintaining and Securing a Database
Learn about the role of the database administrator Compact repair and back up a database Document the database design using the Database Documenter Secure a database from unauthorized use

46 The Database Administrator Role
Database administration (DBA) Responsible for maintaining database Sets security and other features of database Default option for opening database Available to other users at same time Open access database in four ways Open mode, Open Read-Only mode, Open Exclusive mode, Open Exclusive Read-Only mode

47 Compacting and Repairing a Database
Data and objects reorganized Unused spaces reassigned and deleted Result Decreased file size Improved efficiency Can be done manually or every time database closed Backing up the database before compacting and repairing is good procedure

48 Creates copy of database
Backing Up a Database Creates copy of database Use to restore in event of loss Schedule database backups based on manageable amount of data loss Store copy in fireproof location offsite Created on external media such as: CD, DVD, USB flash drive, external hard drive

49 Backing Up a Database (cont’d.)
Back up database Click File tab, Share tab, Save Database As button Under Advanced, click Back Up Database Opens the Save As Dialog box for location to save backup Use default backup database name (add date) Might take few minutes to several hours Backup copy can be opened like any other Access database

50 Documenting the Database Design
Database Documenter Produces report of every object or just selected objects in database Click Database Tools tab, and then click the Database Documenter button Tabs at top of documenter dialog box Select objects by type

51 Documenter Dialog Box

52 Securing a Database From Unauthorized Use
Plan for and to prevent data loss Protect database from unintentional or malicious damage DBA must open database with exclusive access prior to setting protection features Tools Setting database password Encrypting a database Hiding database objects

53 Using a Password to Protect a Database
Collection of characters that user types to gain access to file Database administrator sets database password Users cannot open database file in Access unless they provide correct password

54 Encrypting a Database to Prevent Unauthorized Use
Access 2013 combines two tools for database security Encryption and database passwords When you encrypt a database with a password, the data is made unreadable by other tools Encrypt with Password option

55 Hiding Database Objects From Users
Casual users may damage database by: Unintentionally altering object’s design Deleting object entirely Hide objects from being displayed in Navigation Pane User will not be able to accidentally or intentionally damage database Revealing hidden object not difficult Hide using Properties dialog box

56 Level 3 Summary Compact database Backup database Document database
Secure database Password Encryption Hiding objects

57 Create tables using one of three methods
Chapter Summary Create tables using one of three methods Import data from other Access tables or Excel Create relationships using Relationships Window Secure database Password Encryption Hiding Objects


Download ppt "Building The Database Chapter 2"

Similar presentations


Ads by Google