To Lecture Notes
ISP 121 -- 4/14/08
Reference in Course Documents:
Access Tutorial
Review Questions
- Why is using Filter usually better than using Find to locate
data in an Access table?
Ans: When using find, the format of the field value must be exact,
for example 90.0 instead of 90. If the format is not exact, the
value might not be found.
- Give a reason reason why you might prefer the Text datatype over
the Number datatype for a column.
Ans: Values of a field containing Text values can be any string of
characters. For example "34544-1002" might be entered as a zip code.
This value would not be possible for a Number datatype.
- Give a reason why you might prefer the Number datatype over
the Text datatype for a column.
Ans: One cannot do arithmetic on Text values. Also, numbers will not
sort in numerical order if they are Text values.
- In the StateTemperatures Example that you used in Activity 2,
how would you create a filter to show all of the rows where the
average temperature in January was greater than the average temperature
in April?
Ans: Enter January for the field and >[Data].[April] for the Criterion.
Database Queries
- Most people that use access find queries preferable to filters:
- Queries allow you to display a subset of the columns.
- Queries allow you to display summaries of the data, such as
averages, sums, standard deviation, maximum and minimum.
- Queries can be saved with the database.
- Read section L in the
Access Tutorial
for directions on creating queries.
- Example: In the StateTemperatures table, create a query
that shows the State, Year, January and April columns. Only show the
rows where the January temperature is greater than the April temperature.
- Repeat the preceding example, but use the February and April columns.
Database Normalization
- Go over Section J in the
Access Tutorial.
- A field cannot contain repeated records, it must contain a single
value.
- A table cannot contain any data anolamies. A data anolamy
occurs when a column depends completely on another column that
is not the primary key.
- A foreign key is a column that references a primary key
in a different table.
- To eliminate repeated records or data anolamies, use data
normalization. Data normalization means splitting a table into
two tables, linked with a foreign key.
Homework 1
- Discuss Homework HW1.
- Normalize the following tables:
- Persons
LastName
FirstName
Gender
PhoneNumbers (repeats 1 to n times)
- AirlineReservations
FlightNumber
Origin
Destination
DayOfWeek
Departure
Arrival
Passengers (Repeats 0 to n times)
- Answers to Normalization examples.