Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.
-
Upload
bryan-parrish -
Category
Documents
-
view
216 -
download
2
Transcript of Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.
![Page 1: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/1.jpg)
Relational Database Systems
Higher Information Systems
Advanced Implementation in Microsoft Access
![Page 2: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/2.jpg)
Developing a solution
Tables Queries User Views Navigation
![Page 3: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/3.jpg)
Referential Integrity For the database to work properly, it is
essential to guarantee that a foreign key always refers to a record which exists in the other table.
This is called referential integrity. For example, an entry in the Loan table
can only refer to an existing record in the Member table, because a loan can only be made by a member.
![Page 4: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/4.jpg)
Referential Integrity
Referential integrity is established by defining relationships between the tables
![Page 5: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/5.jpg)
Referential Integrity
![Page 6: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/6.jpg)
Referential Integrity
![Page 7: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/7.jpg)
Referential Integrity
Lookups are used to ensure referential integrity
![Page 8: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/8.jpg)
Referential Integrity
In the Loan table, the user can only enter a value for Member Number which already exists in the Member table
![Page 9: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/9.jpg)
Validation: Presence Check
![Page 10: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/10.jpg)
Validation: Range Check
![Page 11: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/11.jpg)
Validation: Restricted Choice Check
![Page 12: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/12.jpg)
Validation: Default Value
![Page 13: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/13.jpg)
Validation: Default Value
![Page 14: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/14.jpg)
Formatting: Dates/Times
![Page 15: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/15.jpg)
Formatting: Numeric
![Page 16: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/16.jpg)
Queries Searching Sorting Calculations
![Page 17: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/17.jpg)
Searching Searching is the process of selecting
records from a table or combination of tables
To perform the query, three items must be identified Which fields will be used to identify the
records required? What are the criteria for identifying the
records required? Which fields will be displayed?
![Page 18: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/18.jpg)
Search 1: Single Condition Identify the names and telephone
numbers of club members who have rented Shrek
![Page 19: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/19.jpg)
Search 2: Multiple Conditions (AND)
List those members who have rented “Shrek” since 16 August 2004
![Page 20: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/20.jpg)
Search 3: Multiple Conditions (OR)
List those members who have rented “Shrek” or “Finding Nemo”.
![Page 21: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/21.jpg)
Search 3: Multiple Conditions (OR)
Use Group By to eliminate duplicates
![Page 22: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/22.jpg)
Search 4: Combining conditions
List the members who have rented either Shrek or Finding Nemo since the 16 August 2004
The search criteria are:Film Title = “Shrek” AND Date Hired > 16/08/2004 OR Film Title = “Finding Nemo” AND Date Hired > 16/08/2004
Note that the Date Hired condition must be repeated for each film
![Page 23: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/23.jpg)
Search 4: Combining conditions List the members who have rented either
Shrek or Finding Nemo since the 16 August 2004
![Page 24: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/24.jpg)
Sorting
To perform a sort, two items must be identified: Which field (or fields) will be used to
decide the order of records? For each field selected, will the order
of sorting be ascending or descending?
![Page 25: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/25.jpg)
Sorting To produce a list of people with the
tallest first, the records would be sorted in descending order of height.
To produce a list of people with youngest first, the records would be sorted in ascending order of age.
A very common way of ordering records relating to people is in alphabetical order. To achieve alphabetical ordering requires the records to be sorted in ascending order of surname.
![Page 26: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/26.jpg)
Complex Sorting A complex sort involves more than one
sort condition involving two or more fields.
To achieve “telephone book order”, the name is sorted in ascending order of surname, then ascending order of forename. In this case, the Surname field is the primary sort key, and the Forename field is the secondary sort key.
![Page 27: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/27.jpg)
Complex Sorting
![Page 28: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/28.jpg)
Calculations
Horizontal calculations are often known as calculated fields, and vertical calculations are known as summary fields.
![Page 29: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/29.jpg)
Functions
![Page 30: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/30.jpg)
Working with Dates
to search for all DVDs rented in the last week, you would use the expression Date() – [Date Hired] <= 7
to calculate a person’s age in years from their date of birth, you would use the expression DateDiff("yyyy",[Date of Birth],Date())
![Page 31: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/31.jpg)
Parameterised Queries
![Page 32: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/32.jpg)
User Views
User views are created using forms and reports.
A form or report is usually based on a query which selects the required fields from the appropriate tables, sorting the results if necessary, and performing any horizontal calculations.
![Page 33: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/33.jpg)
Report Structure
![Page 34: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/34.jpg)
Summary Information Sum to add values to give a total, e.g.
Total Cost of DVD Rentals last month Average to find an average value, e.g.
Average Cost of Hire per DVD Count to count the number of records
found, e.g. Number of DVDs rented per member
Maximum to find the highest value, e.g. Highest number of rentals per DVD
(to find the most popular DVD) Minimum to find the lowest value, e.g.
Lowest number of rentals per member
![Page 35: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/35.jpg)
Summary Information Summary information
is produced by creating a summary field.
A summary field is a calculated field with a formula to perform the calculation, and is placed in a summary section of a report.
![Page 36: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/36.jpg)
Sub-forms and sub-reports
![Page 37: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/37.jpg)
Sub-forms and sub-reports
![Page 38: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/38.jpg)
Sub-forms and sub-reports
![Page 39: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/39.jpg)
Navigation
![Page 40: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/40.jpg)
Scripting
![Page 41: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/41.jpg)
Scripting
![Page 42: Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.](https://reader036.fdocuments.us/reader036/viewer/2022081518/5515e7bc550346d46f8b4fdf/html5/thumbnails/42.jpg)
Macros