Top Banner
WEEK 11 Database Design
28

WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Jan 01, 2016

Download

Documents

Sheila Campbell
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

WEEK 11

Database Design

Page 2: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

TABLE INSTANCE CHARTS

Page 3: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Create Tables

Page 4: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

TYPES OF DATA

Page 5: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Common Data Types in Access

• Autonumber• SHORT Text• LONG Text• Number• Currency• Date/Time• Yes/No

Page 6: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Autonumber

• Use for unique sequential numbering• Commonly used for PK (Primary Key)• Increments by 1• Automatically inserted when a record is added.

Page 7: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

SHORT Text

• Used for text or combinations of text and numbers, such as addresses, or for numbers that do not require calculations, such as phone numbers, part numbers, or postal codes.

• Stores up to 255 characters.

Page 8: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

LONG Text

• Use for lengthy text and numbers, such as notes or descriptions.

• Should be used “sparingly”, because it takes up too much room in database

• Stores up to 65,536 characters (if not more)

Page 9: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Number

• Use for data to be included in mathematical calculations, except calculations involving money (use “Currency” type). • When you are creating a RELATIONSHIP with an

“AUTOnumber” field with the “PARENT” table

Page 10: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Yes/No

• Use for data that can be only 1 of 2 possible values, such as • Yes/No, • True/False, • On/Off.

• Null values are NOT allowed

Page 11: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Rule

• One chart completed for each table

• Click here to open: “TableInstanceChart.xlsx”

Page 12: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Review Relationship Essentials• Need a primary key• EVERY TABLE NEEDS A PRIMARY KEY• Should be 1st field

• Need a foreign key• a Foreign Key is a column in a table used to reference a

Primary Key in another table.• A table does NOT necessarily have to have a Foreign Key• Whenever you see: “MANY”—this will be the Foreign

Key

• Primary key and foreign keys are essential when you create relationships that join together multiple tables in a database

Page 13: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

CREATE TABLES IN MS ACCESS

Page 14: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

COMPACTING & REPAIRING A DATABASE

• DATABASE TOOLS > COMPACT & REPAIR button• •As you add, edit, & delete objects, a

database changes in size• •To minimize the size of a database & improve

performance should be done on a regular basis• •Rearranges how a fragmented database is

stored on disk

Page 15: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Want More Information

• If you would like more information on how to use MS Access, click here

Page 16: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

QUERIES

Page 17: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

• Is a QUESTION to the database-asking for a “set of records” from 1 or more Tables/QueriesMS Access responds by displaying the requested datais a stored question, rather than a stored responseresults automatically update,IF table is edited, it allows you to view & operate on “selected subsets” of your data

QUERIES: DEFINITION

Page 19: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Single Table Queries

• Select fields to display• Sort by?• Simple Conditions• When you enter text into the criteria cell your

text should be enclosed in quotes ("") to distinguish it from other expressions and operators that you may need to add.

Page 20: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

WORKING WITH TEXT

Page 21: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Matching Text

Page 22: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

OR Statement

Page 23: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

IN Statement

Page 24: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

NOT Statement

Page 25: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

NOT IN Statement

Page 26: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

LIKE “Text*” Statement

Page 27: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

LIKE “*Text” Statement

Page 28: WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.

Hybrid / Homework

View “14 Week Schedule” > Week 11 > 3rd Column