The following examples show how to design local views including the schedule of courses,
the instructor skills report, and the instructor schedules.
Each example shows the following parts of designing a local view:
Gather the data. For each example, the data elements are listed and two occurrences of the data
aggregate are shown. Two occurrences are shown because you need to look at both occurrences when you
look for repeating fields and duplicate values.
Analyze the data relationships. First, group the data elements into a conceptual data structure
using these three steps:
Separate repeating data elements in a single occurrence of the data aggregate by shifting them
to a lower level. Keep data elements with their keys.
Separate duplicating values in two occurrences of the data aggregate by shifting those data
elements to a higher level. Again, keep data elements with their keys.
Group data elements with their keys. Make sure that all the data elements within one aggregate
have the same key. Separate any that do not.
Determine the mappings between the data aggregates in the data structure you have
developed.
Example 1: schedule of courses
Headquarters keeps a schedule of
all the courses given each quarter and distributes it monthly. Headquarters wants the schedule to be
sorted by course code and printed in the format shown in the following figure.
Figure 1. Schedule of courses
COURSE SCHEDULE
COURSE: TRANSISTOR THEORY COURSE CODE: 418737
LENGTH: 10 DAYS PRICE: $280
DATELOCATION
APRIL 14 BOSTON
APIRL 21 CHICAGO
.
.
.
NOVEMBER 18 LOS ANGELES
Gather the data. The following table lists the data elements and two occurrences of the data
aggregate.
Table 1. Course schedule data elements
Data elements
Occurrence 1
Occurrence 2
CRSNAME
TRANS THEORY
MICRO PROG
CRSCODE
41837
41840
LENGTH
10 DAYS
5 DAYS
PRICE
$280
$150
DATE
multiple
multiple
EDCNTR
multiple
multiple
Analyze the data relationships. First, group the data elements into a conceptual data structure.
Separate repeating data elements in one occurrence of the data aggregate by shifting them to a
lower level, as shown in the following tableFigure 2. Course schedule after step 1
Next, separate duplicate values in two occurrences of the data aggregate by shifting the data
elements to a higher level.
This data aggregate does not contain duplicate values.
Group data elements with their controlling keys.
Data elements are grouped with their keys in
the present structure. No changes are necessary for this step.
The keys for the data aggregates are shown in the following table.
Table 2. Data aggregates and keys for course schedule after step 1
Data aggregate
Keys
Course aggregate
CRSCODE
Class aggregate
CRSCODE, EDCNTR, DATE
When you have developed a conceptual data structure, determine the mappings for the data
aggregates.
The mapping for this local view is: Course ◄────────►► Class
Example 2: instructor skills report
Each Ed Center needs to
print a report showing the courses that its instructors are qualified to teach. The report format is
shown in the following figure.
Figure 3. Instructor skills report
INSTRUCTOR SKILLS REPORT
INSTRUCTORCOURSE CODECOURSE NAME
BENSON, R. J. 41837 TRANS THEORY
MORRIS, S. R. 41837 TRANS THEORY
41850 CIRCUIT DESIGN
41852 LOGIC THEORY
.
.
.
REYNOLDS, P. W. 41840 MICRO PROG
41850 CIRCUIT DESIGN
Gather the data. The following table lists the data elements and two occurrences of the data
aggregate.
Table 3. Instructor skills data elements
Data elements
Occurrence 1
Occurrence 2
INSTR
REYNOLDS, P.W.
MORRIS, S. R.
CRSCODE
multiple
multiple
CRSNAME
multiple
multiple
Analyze the data relationships. First, group the data elements into a conceptual data structure.
Separate repeating data elements in one occurrence of the data aggregate by shifting to a higher
level as shown in the following figure.Figure 4. Instructor skills after step 1
Separate any duplicate values in the two occurrences of the data aggregate.
No duplicate
values exist in this data aggregate.
Group data elements with their keys.
All data elements are grouped with their keys in the
current data structure. There are no changes to this data structure.
Determine the mappings for the data aggregates.
The mapping for this local view is:
Instructor ◄────────►► Course
Example 3: instructor schedules
Headquarters wants to produce a
report showing the schedules for all the instructors. The following figure shows the report format.
Figure 5. Instructor schedules
INSTRUCTOR SCHEDULES
INSTRUCTORCOURSECODEED CENTERDATE
BENSON, R. J. TRANS THEORY 41837 CHICAGO 1/14/96
MORRIS, S. R. TRANS THEORY 41837 NEW YORK 3/10/96
LOGIC THEORY 41852 BOSTON 3/27/96
CIRCUIT DES 41840 CHICAGO 4/21/96
REYNOLDS, B. H. MICRO PROG 41850 NEW YORK 2/25/96
CIRCUIT DES 41850 LOS ANGELES 3/10.96
Gather the data. The following table lists the data elements and two occurrences of the data
aggregate.
Table 4. Instructor schedules data elements
Data elements
Occurrence 1
Occurrence 2
INSTR
BENSON, R. J.
MORRIS, S. R.
CRSNAME
multiple
multiple
CRSCODE
multiple
multiple
EDCNTR
multiple
multiple
DATE(START)
multiple
multiple
Analyze the data relationships. First, group the data elements into a conceptual data structure.
Separate repeating data elements in one occurrence of the data aggregate by shifting data
elements to a lower level as shown in the following figure. Figure 6. Instructor schedules step 1
Separate duplicate values in two occurrences of the data aggregate by shifting data elements to
a higher level as shown in the following figure.
In this example, CRSNAME and CRSCODE can be
duplicated for one instructor or for many instructors, for example, 41837 for Benson and 41850 for
Morris and Reynolds.
Figure 7. Instructor schedules step 2
Group data elements with their keys.
All data elements are grouped with their controlling
keys in the current data structure. No changes to the current data structure are required.
Determine the mappings for the data aggregates.
The mappings for this local view are:
Instructor ◄────────►► Course Course ◄────────►► Class
An analysis of data requirements
is necessary to combine the requirements of the three examples presented in this
topic and to design a hierarchic structure for the database based on these
requirements.
Related Reading: For more information on analyzing data
requirements, see IMS
Version 15.2 Database Administration.