46
Use database forms and reports Contents Use database forms and reports 1 Contents 1 Overview 4 Evansdale Realty Database 4 Introduction to Evansdale Realty 5 Installing the Evansdale Realty Database 6 Logging in to the Evansdale Realty Database 9 Introducing the Evansdale Realty database 10 Database functions: the ‘ribbon’ 10 Entering data 12 Collecting data 12 Data types 13 Entering a market appraisal 17 Searching 21 Using search criteria 21 Listing a property for sale 23 Amending existing listings 24 Add a buyer prospect 24 Producing reports 25 Use database forms and reports 1 © NSW DET 2008

CLIPS Word Template - lrrpublic.cli.det.nsw.edu.aulrrpublic.cli.det.nsw.edu.au/.../LRRView/7719/documents…  · Web viewEvansdale Realty has been ... contact surname Peart Vendor

Embed Size (px)

Citation preview

Use database forms and reports

ContentsUse database forms and reports 1

Contents 1

Overview 4Evansdale Realty Database 4Introduction to Evansdale Realty 5

Installing the Evansdale Realty Database 6

Logging in to the Evansdale Realty Database 9

Introducing the Evansdale Realty database 10Database functions: the ‘ribbon’ 10

Entering data 12Collecting data 12Data types 13Entering a market appraisal 17

Searching 21Using search criteria 21Listing a property for sale 23Amending existing listings 24Add a buyer prospect 24

Producing reports 25Reporting features 25The Current Listings Report 26Mail merge 27

Designing database tables 29Table design 29

Use database forms and reports 1© NSW DET 2008

Relationships between tables 31

Check your learning 33

Summary 34

2 Use database forms and reports© NSW DET 2008

Use database forms and reports 3© NSW DET 2008

Overview

From the user’s perspective, operating a database consists of interacting with forms and producing reports. Forms display the data in a convenient way, and allow data to be added, deleted or modified. Reports summarise information, usually in tabular form, and can be sorted and grouped in ways that suit a particular purpose.

In this topic you’ll learn to:

enter client and property information into database forms

access required property and client information

interrogate databases using appropriate search techniques

produce reports summarising information in a database

use databases to enhance customer relations

describe how database tables can be related using foreign keys.

Evansdale Realty DatabaseWe have included with this topic a sample Microsoft Access™ application called the Evansdale Realty Database. This is a simple database with features similar to those you would expect to see in a commercial database. You will need to install this database to your computer in order to complete the exercises. See the first three sections for instructions on installing and running the database.

4 Use database forms and reports© NSW DET 2008

Introduction to Evansdale RealtyThroughout this topic you’ll see comments from the staff at the fictional real estate agency, Evansdale Realty.

Evansdale Realty has been operating in Evansdale, Belmore Heights and surrounding areas, and as far out as Brunswick Park, for over 15 years. It specialises in commercial and residential sales and leasing.

Sarah Hampden, Manager

Sarah is the licensee-in-charge and manager of Evansdale Realty. As licensee, she oversees all aspects of the business: sales, property management, trust accounting and strata management. She manages all aspects of staffing, including induction and training.

Vince Berger, Sales Manager

Vince is responsible for the day-to-day management of the sales team: listing, advertising, open house and other inspections for both commercial and residential properties.

Adrian Carrasco, Sales Consultant

Adrian works on the sales team and helps Vince with all aspects of the sales process, both in the office and on the road.

Jackie Mansour, Reception/Sales Support

Jackie wears two hats in Evansdale Realty – she’s the receptionist and also supports the sales team. She’s in charge of all office procedures and helps with the advertising, listings and photo displays.

Ellen Chu, Property Manager

Ellen manages Evansdale Realty’s rental property division. She’s responsible for tracking down, inspecting, listing and letting properties and collecting rent on behalf of the owners. She has responsibility for tenant selection and sign-up for all tenancy agreements as well as for the financial aspects of leasing.

Dave Mathews, Assistant Property Manager

Dave helps Ellen in all aspects of her work by keeping the internal property management systems running smoothly. He’s also involved in advertising properties for lease and organising repairs and maintenance.

Use database forms and reports 5© NSW DET 2008

Installing the Evansdale Realty Database

To complete the activities in this topic you will need to install the Evansdale Sales Database to your computer.

System requirements

To install this software you require Microsoft Windows XP with Service pack 2, or Microsoft Windows Vista.

Screen resolution

The Evansdale Realty Database is optimised for a screen resolution of at least 1024 x 768. If you have a lower resolution, you will need to use the scroll bars to see all parts of the application windows.

Installation Steps1. Make sure you have the Cert III in Property Services (Agency) CD

in your computer’s CD-ROM drive.

2. Use Windows Explorer to locate the Evansdale Realty Database on the CD. Double-click on the ‘My Computer’ shortcut on the desktop then navigate to the CD drive.

The path to the setup file is: <CD drive letter>/lo/7719/database/setup.exe

3. Locate the setup.exe file and by double-clicking it. You will see a Welcome screen as shown below. Click next to start the installation.

6 Use database forms and reports© NSW DET 2008

Welcome screen in Evansdale Realty Database setup wizard.

4. The next screen is to enter your personal information. For the user name, enter your name. For the organisation, type in ‘Evansdale Sales Team’.

Entering customer information.

5. In the next screen, you select the type of setup. There is no custom setup provided, so just click ‘Typical’ setup as shown below:

Selecting the setup type.

Use database forms and reports 7© NSW DET 2008

6. Now the database is ready to install. Confirm that you wish to proceed by clicking the Install button.

Confirming the install.

There are several more screens showing progress and confirming the installation. Just click OK for each until the installation process is complete.

Final dialog box indicating successful installation.

8 Use database forms and reports© NSW DET 2008

Logging in to the Evansdale Realty Database

Starting the application

Now you should be able to start up the Evansdale Realty Database. You will find a shortcut on your computer’s desktop. Just double click to run the application. Alternatively use the shortcut under the Windows Start Menu.

Evansdale database desktop shortcut

Logging on to a database

The database opens with a screen that simulates logging in to a standard agency database. For simplicity, we have provided the username and password right there on the screen (click the hint button). Of course in a real system, every user would be given a separate user name and password which they would need to remember!

Log in dialog window

Use database forms and reports 9© NSW DET 2008

Introducing the Evansdale Realty database

We have included with this course a Microsoft Access application called the Evansdale Realty Database. This is a simple database with features similar to those you would expect to see in a commercial database. You will need to install this database to your computer in order to complete the exercises. See the Appendices for instructions on how to install and run the application.

Database functions: the ‘ribbon’The Evansdale Realty Database has been created for you using the database software application called Microsoft Access. Access is part of the suite of business applications in Microsoft’s Office 2007 package. Like other Microsoft Office 2007 applications, the Evansdale Realty Database has a ‘ribbon’ (a large, enhanced toolbar) at the top of the window.

All functions of the database are selected from this ribbon as shown in the image below. Note that it is called ‘Residential Sales’. A more complex database would have more functions including trust accounting functions located in the ribbon.

The database functions are available via the Residential Sales ribbon

10 Use database forms and reports© NSW DET 2008

The functions of the Evansdale Realty database are listed below:

The Contacts group

This group of functions allows you to view and edit your contacts, whether they are purchasers, vendors or other contacts:

All — allows you to view or edit all contacts, or add new contacts

Owners — allows you to view or edit only those contacts who are owners/vendors of properties

Buyer prospects — allows you to view or edit only those contacts who are the potential purchasers.

The Properties group

In this group, you access the information about properties in the database:

All — view or edit all properties

Search — search for a particular property using multiple criteria

Listings — view all properties that are currently listed for sale with the agency

Sold — view all properties that are in the process of being sold or have been settled.

The Reports group

In this group you can run two reports:

The Current Listings report — which shows all properties currently listed with the agency, ordered by suburb

The Purchaser Updates mail merge — which generates letters to purchasers informing them of recent listings that match their property search requirements.

The ‘Under the hood’ group

This group lets you look at the raw tables at the core of the database. It is like looking at the engine or underlying mechanism of what makes the database work. Normally the user does not see these underlying tables.

We do not recommend you attempt to edit these tables directly. They are provided so you can learn more about these internal structures.

Use database forms and reports 11© NSW DET 2008

Entering data

When using a database, users will spend most of their time interacting with forms. A form is an application window or html page containing controls which allow information to be viewed, entered or modified.

Forms are your window into the relational database tables, presenting information for you in a convenient way. The diagram below illustrates this concept.

TablesForms

Forms are used to view or edit data in the database

Collecting dataThe idea of electronic forms in a database is simply an extension of the older idea of paper-based forms. In many agency offices, you will find both still being used — and this makes sense. Data will be collected in the field on a paper form then entered into the database when the agent arrives back in the office. The following is a sample of a section of an inspection form used in property management.

12 Use database forms and reports© NSW DET 2008

An example of a paper-based form

Data typesDatabases must accommodate a number of different data types, and there are specific ways to display and enter each type of data. For example:

Text

Text is entered using controls called ‘text boxes’. For simple data such as names and addresses we don’t want text boxes to allow text formatting such as font size or underlining.

Modern database forms do allow formatting however, and it is useful for fields such as free-text descriptions or memos.

Plain text box

Text box with formatting

Use database forms and reports 13© NSW DET 2008

Boolean values

These values assume one of the two values ‘true’ or ‘false’ (or ‘yes’ or ‘no’). These fields are conveniently entered using checkboxes. The form below is an example, where the user is answering two separate questions which each have yes/no answers.

Checkbox function for entering ‘either/or’ data

Dates

Dates can be entered using a textual date, or by selecting from a calendar. Direct manipulation using controls like calendars can reduce mental effort and data entry errors. For example, if you need to select a date three weeks from today, it’s much easier with a calendar.

Calendar function for entering dates

List boxes and combo boxes

List boxes are useful for either textual or numerical data. They simplify data entry by making it more difficult for the data entry operator to make an error when entering information.

A list box allows the user to make a selection from a fixed number of alternatives. A combo (combination) box consists of a list box plus a text box which allow new values to be entered.

14 Use database forms and reports© NSW DET 2008

List box allows the user to select from a fixed set of alternatives

Numerical data

Some systems allow numerical data to be entered using convenient controls such as sliders or ‘spin boxes’. Again, the ability to make exact selections helps to reduce the potential of human error on the part of the data entry operator.

Spin box and slider control

Image data

Digital images have been around for many years but their use has undergone explosive growth since the advent of low-cost digital cameras.

The digital photography revolution has affected the real estate industry more than most. Images are required for advertising in both sales and property management. Digital photographs can also be used as documentation – for example as an adjunct to the condition report for a property.

In the past, databases had limited capabilities for storing images. Often the images were stored separately as computer files, and the database merely held references to these external files. Modern databases cater fully for the native (internal) storage and display of images.

Use database forms and reports 15© NSW DET 2008

Real estate databases can hold image data such as photos

Mapping data

Nowadays, mapping data from Geographical Information Systems (GIS) can be displayed and combined with positioning data from the Global Positioning System (GPS). Together, these types of data are having a large impact on many fields of endeavour, including the real estate industry.

Some real estate databases may include GIS data such as maps and satellite images.

Graphs and charts

These are very useful for summarising information in visual form. Of course graphs and charts don’t allow data entry - they only display information that has been input by other means. They can be used in both forms and reports.

16 Use database forms and reports© NSW DET 2008

Graphs and images add meaning to reports and documents

Jackie Mansour, Reception/Sales

Support

I do more data entry than anyone in the office, assisting both the sales team and the property management team. I appreciate the improvements in form design over the years – anything that speeds up data entry and improves accuracy is worthwhile when you’re using the database day in and day out. Occasional users will use the mouse to get around, but for power users like me, everything has to be smoothly accessible using just the keyboard.

I’m impressed with the recent developments with mapping data and GPS. People can see where the property lies in relation to schools, transport, main roads and shops for example, before they visit the property. They can look at the council zoning, at topographic maps to get information about flood-prone land, and even satellite imagery.

Entering a market appraisal Let’s begin using the database! Imagine that you’ve just returned to the office after completing a market appraisal for the owner, Mr Peart, and you must now enter the information you have gathered.

1. Click the ‘All’ button in the Contacts group to show the contacts form. You will see the contacts form as shown below.

Use database forms and reports 17© NSW DET 2008

The contacts form

2. To enter a new contact, click the ‘Add new contact’ button in the control panel. The control panel is shown below, and the functions are (from left to right) ‘Delete contact’, ‘Add contact’, ‘Previous contact’ and ‘Next contact’. Note that if you hover the mouse cursor over each button, you will see pop-up tooltip describing the button.

The control panel.

3. Enter the contact details for the owner, Mr Peart as shown below:

FIELD DATA ENTRY

Vendor contact surname Peart

Vendor contact first name Neil

Mailing address PO Box 23, EVANSDALE

Email [email protected]

Home phone 4385 7744

Mobile 0426336757

4. Click the check box indicating that Mr Peart is an owner. When you do this, you will see additional tabs for Property description, Features and Listing.

18 Use database forms and reports© NSW DET 2008

5. Click the Property description tab and fill out the fields as shown below:

FIELD DATA ENTRY

Property type House

Unit number Leave blank

House number 22

Street The Avenue

Suburb Python Point

Description This expansive residence has four bedrooms and two bathrooms. The kids will love the in-ground pool. In excellent condition overall.

6. Add a photo. Take a digital photo of your house (or other house), transfer it to your computer, and add it to the description page. Double click on the empty photo box and a dialog box will open to add a new photo as shown below. Click the ‘Add…’ button. Another dialog box will appear that lets you navigate to your photograph file.

Dialog box for adding a photograph to your database record

Use database forms and reports 19© NSW DET 2008

7. Add Property features. Click on the Features tab and add the information as shown below:

FIELD DATA ENTRY

Land area 700 square metres

Aspect North

Year Built 1980

External Walls Brick Veneer

Roof Cement Tile

Swimming Pool Yes

Floor Area 160 square metres

Bathrooms 2

Bedrooms 3

Laundry Yes

Dining Room Yes

Rumpus/games Room Yes

Floor covering Carpet

8. Select the Listing tab and enter the information below. Although the property is not listed yet, some fields in this section are relevant to an appraisal, such as the appraisal value and the status.

FIELD DATA ENTRY

Listing type Leave blank

Listing status Appraisal

Price 350000

Leave the remaining fields blank, as they become relevant only when the property is listed.

Jackie Mansour, Reception/Sales

Support

It’s very important to go carefully when you are entering data into a database. Check the information both before data entry, and again after it’s been entered. It’s so easy to go make an error, especially if you have a lot of data to enter.

It may seem like a trivial thing, to have a typo in a name, an address or a phone number for example. But this can mean that the customer is ‘lost’ somewhere in the database, and does not receive their emails or letters, the salesperson is not reminded to call them and so on. It can mean that the agency loses the customer altogether.

20 Use database forms and reports© NSW DET 2008

Searching

Now you can try searching for the property you have just entered.

Click the Property Search button on the ribbon, and open the property search form from the ribbon. You will see a form similar to this:

The Evansdale Realty Database property search form

Using search criteriaThe top section of the property search form is where you can enter the search criteria, that is, the conditions that must be satisfied by the records returned by the search.

The available search criteria for the property search are:

Search for a particular property using the street name

The street name will be the most useful criteria if you simply want to get to a particular property that you have in mind, rather than list all properties with certain attributes.

Use database forms and reports 21© NSW DET 2008

To find the appraisal you have just entered, type ‘The Avenue’, and click the search button. You should see one item in the table below for 22 The Avenue, Python Point. Of course, if there was more than one house on The Avenue listed with the agency, you would see all of them.

The data entered in the search criterion does not have to be an exact match for the street name. It can be any part of the street name, so that you could enter simply ‘Avenue’, and the search would return all properties with ‘Avenue’ in the street name. Also, this search is not case sensitive, which means that the case (capitals or lowercase) of the letters in the search criteria is ignored. Therefore you can enter ‘avenue’ and obtain the same result.

Search using multiple criteria

The remaining search criteria include the following:

Suburb is the name of a suburb that the property must be in

The minimum price and maximum price for the property

The minimum number of bedrooms in the property

The minimum number of cars that can be accommodated in the property.

All of the criteria can be used in combination to narrow the search. Consider the following search criteria:

Criteria:

Suburb = Python Point

Minimum price = 400000

Maximum price = 600000

Number of bedrooms = 4

This search will return all properties in Python Point, AND with price more than $400000 AND less than $600000 AND with at least 4 bedrooms. In other words, only properties that match ALL of the criteria will be shown.

Another type of search is where ‘OR’ is used to combine the separate criteria, meaning that if ANY of the criteria is true for a record, then the record will be included.

22 Use database forms and reports© NSW DET 2008

Jackie Mansour, Reception/Sales

Support

There are basically two ways to find the information you seek. Search is where you enter one or more search terms and the system returns all the records that match those criteria. Browsing is where the user looks through the information to find what is of interest to them.

Usually searching and browsing are used in combination – first a search to narrow the range of records, then browsing to look more closely. This is typical when you are showing listings to a potential buyer – you narrow the search using criteria like suburb, number of bedrooms, and price, then you have a close look at the properties returned by the search.

Listing a property for saleMr Peart has agreed to list his property so you make an appointment to see him that afternoon. When you return from the appointment, you have obtained an exclusive listing at an asking price of $345 000 for 90 days duration. You must now update the record with this information.

The first step is to search for the property:

1. Click on the Search icon under the Property group.

2. Find the property by entering the street name ‘The Avenue’ (or some part of it).

3. Press the enter key to start the search or press the Search button.

4. Select ‘22 The Avenue’ from the datasheet.

5. Then click the ‘Detail’ button. This will open the Property Detail form. The ‘Property Detail’ form looks just like the ‘All Properties’ form, except that it allows access to only one property.

6. Select the ‘Listings’ tab, and amend the fields below:

FIELD (Find this field) DATA ENTRY

Status For sale

List Type Exclusive Listing

Price 345000

Date listed Enter today’s date

Expiry Enter the date 4 months from today’s date

Occupied Yes

Key number S055

Lot 6

DP DP45678

Use database forms and reports 23© NSW DET 2008

Amending existing listingsAfter attending the weekly sales meeting you are required to make amendments to some of the office’s listings. To save you time, a number of listings have been preloaded into the database. You will need to locate the listings using the search function and update the following information:

7 Main Street, Koala Cove has had a price reduction to $600,000.

2/22 Snake Drive, Python Point has been withdrawn from sale. Amend the listing status on the listing tab.

The listing of 1 Long Road, Emus Nest has been upgraded from open to exclusive for a period of 4 months from today’s date at the amended price of $830 000. Correct a previous data entry error to 4, as opposed to 3 bedrooms.

Add a buyer prospectA common requirement in sales databases allows you to enter buyer prospects into the system and match them to existing listings.

To enter a prospect, click the Buyer Prospects button on the ribbon, then enter the following:

FIELD DATA ENTRY

First name Noel

Surname Redding

Phone (W) 9744 6635

Phone (H) 4324 8879

Street No. 23 Stratocaster Hwy, Python Point

Email [email protected]

Tick the ‘Is Purchaser’ option, and the Purchaser Requirements tab will open. Select this tab, and enter the requirements as shown below.

FIELD DATA ENTRY

Need a House

Purpose Residence

In suburb Python Point

Bedrooms (minimum) 3

Price (maximum) 400000

24 Use database forms and reports© NSW DET 2008

Producing reports

Reports are typically documents that show tabular data and summary information. They are the common means of producing paper documents from the information in a database. The diagram below illustrates this concept.

Note that there is some scope for confusion here, because the term ‘report’ is one that is commonly used in business to mean a document that is produced to fulfil a specific need. You may even find that a significant part of a business report consists of a database report.

ReportsTables

Reports are printable documents derived from the information in a database

Reporting featuresReports often use the following features:

Queries — data for a report is usually drawn from multiple tables and filtered according to certain criteria. Queries are used for this purpose, so that the arrow in the diagram above would represent a query extracting data from the tables for presentation in the report.

Tabular data — data is usually presented in tabular form, with column headings at the top of the page.

Printing — reports are designed so they can be printed, so you will find the data is split neatly on page boundaries, with page numbers at the bottom. Often the date and time of the report is shown, because the results may be different each time a report is run due to changes in the data.

Use database forms and reports 25© NSW DET 2008

Sorting and grouping — the tabular data is sorted, and this will normally mean that the fields in some columns occur again and again. For example, when displaying properties by suburb, there will be multiple properties in each suburb. Rather than just repeating this information, we can group the records under a sub-heading of the suburb for a more attractive and meaningful display.

Statistical data — often, calculated statistics on the data are displayed in a report, including for example sums, minima and maxima, and totals or averages for each group.

The Current Listings ReportAs an example of a report, click the ‘Current Listings Report’ button under the reports group. You will see a report similar to the image below.

Current listings report

Use of queries

Let’s examine how this report uses the reporting features of the database. Firstly, the report is based on a query that extracts data from two tables. The Vendor field comes from a table called ‘people’ whereas the other fields come from the properties table.

If you are interested, the SQL for this query looks like this:

SELECT properties.*, people.[first name], people.[last name] FROM people INNER JOIN properties ON people.ID=properties.vendor WHERE (((properties.status)="for sale") AND ((properties.[listing expires])>Now()));

26 Use database forms and reports© NSW DET 2008

You don’t need to understand this, but just note that the query JOINS multiple tables together and then filters the results on particular criteria. As the report is for the current listings, we are only interested in properties where the status is ‘for sale’ and the agency agreement has not yet expired.

Sorting and grouping

This report is sorted by suburb, then by street name, and is grouped by suburb – note the sub-headings for each suburb.

Printing features

Note the column headings at the top of the page, and the footer containing the report title, date and time, and the page number.

Statistical data

No statistical data has been calculated for this report, but an example of this could be a simple count of listed properties for each suburb, or a total of the listed price for each suburb.

Mail mergeA mail merge is a particular type of report where data is inserted into a business letter or email to personalise the communication, and provide information specific to that client. Usually a mail merge is performed in concert between the database application and a word processing application. Microsoft Access and Microsoft Word for example are often used together to do mail merges.

As an example of mail merge, run the ‘Purchaser Updates’ report, and you will see a report that contains letters to each of the purchasers, with a list of properties that match their particular requirements.

Use database forms and reports 27© NSW DET 2008

Sample of a mail merge report from the Evansdale Realty Database

Jackie Mansour, Reception/Sales

Support

Be sure you double check the results of a mail merge before sending it out, ensuring that there are no embarrassing mistakes in the letter or the merge itself. Once you have printed a mail merge and the envelopes there is the manual step of putting all the letters into the envelopes and mailing them out. There are companies that can do this for you, but at Evansdale Realty it falls to me. Again, be sure to have a reliable person do this. We once had a lot of letters go into the wrong envelopes.

28 Use database forms and reports© NSW DET 2008

Designing database tables

By now, you are familiar with the types of data stored in a real estate database, and you have learnt that relational databases are able to store this data across many tables.

In this chapter we will take a closer look ‘under the hood’, at the structure of relational database tables and why they need to be carefully designed.

Table designAs a simple example of table design, consider how the Evansdale realty database should store the owner for each property.

One could conceivably store all the owner information directly in the property table, as shown in the table below.

Address Owner Price Bedrooms (etc)

3 Hodgkins Rd Peter Banks $233000 2 …

74 Ryan Cres Cathy Baxter $456000 3 …

(Note that this table is conceptual only - of course, there are many more fields for both the property and the owner than we can show here, and the address and owners name would also be broken up into more fields)

The problem with this design is that it’s not flexible enough. Consider these two points for example:

What happens if a person owns more than one property? The owner details would need to be re-entered for each property. This would multiply the chance of an error occurring, and make it a nightmare to maintain. If an owner’s details (such as their phone number) changed, the agent would need to ensure that every occurrence was updated.

What happens if an owner was also looking to buy a property? Their name would need to appear again in (say) a table of potential purchasers.

Therefore this design is not workable in a practical database, as it’s inflexible and hard to maintain. Having duplicated information reduces the

Use database forms and reports 29© NSW DET 2008

quality of the data, makes relationships more difficult to observe, and makes searching more difficult.

The solution is to break up the tables so that there is no duplication by dedicating a separate table to every different kind of ‘thing’. In this case we need to use separate tables to hold data about people and properties.

This is illustrated below, where we have shown sections of the ‘people’ table and the ‘properties’ table from the Evansdale database.

The properties table holds data only about properties

This people table holds data only about people

This has solved the problem of duplicated information, because a person only appears once in the people table, no matter how many properties they are selling (or buying). We can search for a person and see all the information relating to that person.

It is typical for real databases to have dozens, or even hundreds, of tables. The design of databases is a field of study in its own right, and there are many more things to consider than we have mentioned here. For our

30 Use database forms and reports© NSW DET 2008

purposes it’s enough to understand that database tables must be correctly designed to eliminate duplication and processing errors.

Relationships between tablesOur solution above has certainly made the tables less complex, but where is the information that relates a property to its owner? Look at the rightmost column shown in the image of the properties table, and you will see a field called ‘owner’. This field contains a reference to a record in the people table. For example, look at the second row and you’ll see the owner field contains a value of 7. Now look at the people table, and you can find a record with an ID of 7, representing the person ‘Guido Glover’. Thus Guido Glover is the owner of 45 Main Street, Koala Cove.

Now, if Guido owns other properties on the Evansdale database, it’s very simple. The record for every property he owns will refer to Guido as the owner by having a 7 in the owner field. So we don’t need to duplicate Guido’s Information for every property he owns. Also, if Guido is also interested in buying a property, there is no problem referring to his record in the people table from yet another table such as a ‘purchaser requirements’ table.

Technically, this mechanism of referring to a record of a different table is known as a foreign key. It’s called this because the referring field (in this case the owner field) contains the value of a key field from a different (foreign) table.

Note carefully that the user does not need to know about these inter-table references. Once the database application has been designed, they are maintained automatically by the database and are kept hidden from the user. All that matters here is that the database knows how to combine the data from multiple tables to get a result.

When we code the database application, we tell the database system about the required relationships between each table, and the database will take care of the details for us. The image below shows how a relationship is defined using Microsoft Access database system. The people and property tables of the Evansdale database are joined by a line which the designer draws using their mouse. Once this is done, the database system ‘knows’ that the owner field in the properties table contains a reference to a record in the people table.

Use database forms and reports 31© NSW DET 2008

Defining a relationship in Microsoft Access

The labels ‘1’ and ‘∞’ at the ends of the relationship line mean that the relationship between the people table and the properties table is one-to-many. This means that one person can own many properties, but each property has only one owner recorded. (In reality of course there can be more than one owner for a property, but this is not catered for in this simple database.)

32 Use database forms and reports© NSW DET 2008

Check your learning

Here is a check-list of the things you should now know or be able to do. Put a tick beside each one you feel confident about.

I can …

Log in to a database by entering a user name and password

Describe the purpose of database forms

Enter data into forms using a variety of controls for textual data, numerical data, dates, photographs and Boolean data

Search for data using either exact match or an approximate match

Search for a set of records determined by multiple criteria, such as suburb, prices and number of bedrooms

Describe the features of reports, and the meaning of a mail merge.

Describe how database tables can be related using a foreign key

How did you go? If there are some areas you’re not sure of, you may like to revise them before attempting your assessment tasks.

Use database forms and reports 33© NSW DET 2008

Summary

This topic has allowed you to use the features of a simple database and to perform operations typical of a real estate office. You have entered data into forms, searched for relevant information and produced reports. You have also learnt more details about the structure of database tables.

34 Use database forms and reports© NSW DET 2008