Tutorial 3

IMS1907 Tutorial 3, Summer Semester, 2004/5
IMS1907 – Database Systems
Tutorial 3
Database Systems Development
MS Access – Relationships, Joins and Forms
Tutorial Objectives
At the end of this tutorials you should:
understand the activities associated with database development, and how these
activities map onto the phases and activities of the SDLC
comprehend the nature of the data-centric approach used to analyse data
requirements, and understand how this approach differs from more traditional
development approaches
have further developed your understanding of how to use MS Access to create and
manipulate data in a simple database, join tables using relationships and design
basic forms for data entry
Tutorial Resources
Tutorial 3 handout
IMS1907 Lecture 2 –Introduction to DBMS – Microsoft Access
IMS1907 Lecture 3 –Database Systems Development and the SDLC
MS Access
Revision Questions
1. Information Engineering (IE) is a methodology that takes a data-centric approach
to the development of information systems. What are the characteristics of a datacentric approach to systems development?
2. Why is a data-centric approach useful when developing database systems?
3. How does a data-centric approach to the development of information systems
differ from more traditional development methodologies?
4. What are the three steps in the IE planning phase?
5. Describe the objectives and activities associated with each step in the IE planning
6. What are some of the various planning matrices used in the process of database
Systems Planning? How are the various planning matrices used?
7. What is meant by the term, an enterprise data model?
8. Why is an enterprise data model useful when developing database systems?
9. What are the activities associated with database development?
Page 1 of 4
IMS1907 Tutorial 3, Summer Semester, 2004/5
10. Describe the tasks and objectives of each of the activities associated with database
11. What are packaged data models, and why are they useful to database systems
12. What are the two types of packaged data models and how do they differ?
13. Briefly describe the roles of the various people involved in database systems
Using MS Access to Create a Simple Database
In this exercise we will build on and further develop the simple database that you
started to create last tutorial. As in the last tutorial, this exercise is aimed at
encouraging you to explore and learn about MS Access by playing and experimenting.
As has been mentioned, MS Access has been designed with ‘learning by exploration’
in mind.
Joining tables with relationships
In this tutorial you will add to the database you have started to create. By now you
should have created and populated your two database tables with data about members
and their ticket purchases.
1. Open your MS Access database so the Database window appears. Select ‘Tables’
and the two tables in your database should be listed
2. Select the ‘Tools’ menu, and then select ‘Relationships…’ - a screen showing your
tables should appear
3. Create a relationship between the two tables by firstly selecting and highlighting
the PK (Member No) field in the member table. Hold down the left mouse button
on the highlighted field and drag the mouse to the corresponding field (Member
No) in the ‘Tickets’ table (Member No is a foreign key in the ‘Tickets’ table).
4. The ‘Edit Relationships’ dialog box appears. Check the ‘Enforce Referential
Integrity’ box and press ‘Create’.
A line representing the relationship now appears linking your two tables. The Member
table is at the ‘1’ end of the relationship while the Tickets table is at the many () end
of the relationship. Your tables are now joined on the common data element Member
Sorting data in tables
5. Close all windows except the Database window. Double click on the Ticket table
to display the datasheet view. Position the cursor in the first field of the first
record and select the ‘Sort Ascending’ control from the menu bar. This sorts the
record based on the field where the cursor is situated. Move the cursor to the next
field of the first record and repeat the exercise to see how it changes the order of
the data in the datasheet. Try again using the ‘Sort Descending’ control on the
menu bar. Close the ‘Ticket’ datasheet.
Page 2 of 4
IMS1907 Tutorial 3, Summer Semester, 2004/5
Displaying related data using subdatasheets
6. Double click on the Members table to display the datasheet view. A ‘+’ sign
appears at the left of each record in the datasheet. Click on the ‘+’ for the first
record to display a subdatasheet that shows all the ticket purchase details for that
The relationship makes this subdatasheet view possible because each member record
is now linked to its related transactions. Repeat this exercise for each record in your
Member table.
7. Close all windows except the Database window.
Creating forms and subforms
Datasheets can be useful for entering and displaying data but if too many records
exist, they may become cumbersome, and it can sometimes be hard to make sense of
large data sets. Forms provide a convenient way to add data to tables without having
to interact directly with the table. The form is in effect a type of application that
facilitates data entry and display.
Initially we will use the Access wizards to create simple forms. This will give you an
idea of what forms look like, and how they work. However forms created using
wizards can be limited in their functionality and applicability, and many would say
that they have limited aesthetic appeal.
It is okay to use the wizards to set up your form but you should then explore it’s
properties, and modify and add to it using the Forms Design view. Ideally you should
create your forms entirely in the Design view because you have more control over the
appearance, contents and workings of the form.
8. From the Database window, select Forms, and then double-click ‘Create form
using wizard’.
9. Select the Member table from the drop-down list of tables, and then select all the
available fields. Navigate through the wizard set up screens and choose
‘Columnar’ layout and ‘Standard’ style. Name your form ‘Members’ (or ‘Add
New Members’ perhaps) and finish the wizard. A form is generated displaying the
first record in your Members table. Controls at the bottom of the form allow you
to navigate through the records, and also indicate the number of records in the
table. Add a new record using the form. Right-click on the form and select
‘Datasheet View’ to check that the record is present.
10. Repeat this procedure, using the table that stores details of member’s ticket
purchases, to create a Ticket Sales form and add a record to the table.
The forms created using this procedure might be useful for simple applications
involving data entry to a single table but they are not as functional when it comes to
entering and displaying data from related tables. To enter data into related tables we
need to include a form (subform) within a form. We can again use a wizard to create a
simple form containing a subform.
11. From the Database window, select Forms, and then double-click ‘Create form
using wizard’. Select the Member table and then select Member No, Member first
name and Member last name from the list of available fields.
Page 3 of 4
IMS1907 Tutorial 3, Summer Semester, 2004/5
12. Now select the Ticket Sales table from the drop-down list, and select Ticket No,
Purchase Date, Event No, Event Name and Ticket Price from the list of available
fields. You can include other fields if you wish but don’t include any fields from
the Ticket sales table that relate to the member. Click ‘Next’
13. Select view data by member and ‘Form with subform’. Then select ‘Tabular’
(looks slightly better than ‘Datasheet’) layout and ’Standard’ style. Name your
form and subform and finish the wizard.
The resulting form and subform allows you to view the sales details for each existing
member, add sales details for an existing member, add a new member and add sales
details for a new member. Both the form and subform have their own navigation
controls to view all records in the set.
As mentioned these forms have some use but you can really fine-tune your forms if
you custom design them from first principles using the Design view.
14. Close all windows except the Database window, select Forms (if not already
displayed) and highlight one of the forms you created using the wizard. Select
Design view.
15. Examine each element that appears on the design, select each item and view it’s
properties. Pay particular attention to the ‘Control Source’ property of entry fields
– this connects a field in a form with a field in the underlying table. Try
reorganizing the layout of your form. Add new elements from the toolbar and set
properties for the element. Add another subform. Try modifying form elements by
interacting directly with the Properties window.
16. Repeat this for each of the forms you have created.
17. Save your database and tables for next week.
Continue populating your database – a good range of records will be useful for the
next tutorial. In the next tutorial you will continue to develop this database by
generating reports based on the data in the tables, and creating a range of standard and
ad hoc queries.
Page 4 of 4