WEEK 11 Database Design. Agenda Hybrid Review Create Tables Add, Edit Data Create Relationships in...

Post on 26-Dec-2015

216 views 0 download

Transcript of WEEK 11 Database Design. Agenda Hybrid Review Create Tables Add, Edit Data Create Relationships in...

WEEK 11Database Design

AgendaHybrid ReviewCreate TablesAdd, Edit DataCreate Relationships in MS

Access 2010Queries

CREATE TABLES

Create TablesFor the tables for the sample in

the Wk10_TableInstanceChart.xlsx

Table Design ViewExercise:

◦Create table for gender

Datasheet ViewExercise:

◦Add data to the gender table

Table Design ViewExercise:

◦Create Ribbon > Table Design in the Tables grouping

◦Identify your own PK◦Moving the order of the rows

Create Table with LookupsExercise:

◦Add data to the city entity using a look up wizard as the data type for the province

Add Data to an EntityBased on another entity

◦Exercise: Create the students table (studentID,

fname, lname and gender fields only)

Edit an EntityExercise:

◦Complete the Students table◦Go back and look at your default

value (note it was not added to previous records entered)

Edit Data in Datasheet ViewExercise:

◦Go back and add the age group and city for each of the students previously entered

Datasheet view◦Record count◦Add a new record◦Search for a record◦Sort the records

CREATE RELATIONSHIPS

Create RelationshipsDatabase Tools ribbon >

relationships grouping

Exercise:◦How to Edit a relationship◦How to Create a relationship

Want More InformationVisit the following site. http://www.functionx.com/access/index.htm

QUERIES

Northwind Database

Single Table QueriesSelect fields to displaySort 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.

WORKING WITH TEXT

Matching Text

OR Statement

IN Statement

NOT Statement

NOT IN Statement

Using WildcardsWildcard is a special character

that can stand for either a single character or a string of text

LIKE “Text*” Statement

LIKE “*Text” Statement

LIKE “[letter-letter]*” Statement

WORKING WITH NUMBERS

Working with NumbersFor example, where X represents

a number: <X finds values less than X. >X finds vales greater than X >=X finds values greater than or

equal to X <>X finds vales not equal to X

WORKING WITH DATES

Working with DatesEnsure the criteria cell is type

Date/TimeEach date must be enclosed by

hash marks (#).For example:

◦<#1/1/98# ◦finds dates earlier than 1 January

1998

Working with DatesFor example:

◦=#27-Sep-50# ◦finds dates equal to 27 September

1950

Working with DatesFor example:

◦Between #5/7/98# And #10/7/98#

◦finds dates no earlier than 5 July 1998 and no later than 10 July 1998

FINDING EMPTY FIELDS

Finding Empty FieldsUse the expression Is Null. Conversely, Is Not Null.

The expression Null simply means "nothing".

Hybrid / HomeworkRead

Calculating in Access QueriesRead Calculating Totals in AccessRead Working out Someone’s AgeWatch Multi-Table Queries Part 1

& 2

Database Assignment Part 2

Quiz Time