Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
Coming Soon
hidden | true |
---|
Multi-Hop Worked Examples
We will use the data shown in the ERD above, with tables for Buildings, Rooms, Bookings, Staff, Departments and Certificates.This example uses the School Data from the Learning Centre, containing tables for Students, Attendees, Courses, Teachers, Departments and Classrooms.
ERD Setup
Accessing Attributes
If you have a booking- On a View on the Courses table, you can access the
- Department name and
- Student name
Aggregating on Attributes
HTML Comment | ||
---|---|---|
| ||
|
Example: Quantity of Males vs Females on Each Course
We want to see the number of males and females on each course.
- On the Course table, create a new View
- Name:
CourseByGender
- Save the View
- Name:
- In the View Attributes section, click the
iconInsert excerpt _attributes_icon _attributes_icon nopanel true - In the Available Attributes window:
- From the Course table, drag across the CourseID and Name attributes into the View Attributes section of the View
- Under Related Tables, select the Attendees table - this allows access to the Attendee's related tables
- Under Related Tables, select the Students table
- Drag across the Gender attribute twice into the View Attributes section of the View
- Double click on one of the Schools_StudentsGender attributes
- On the View Attributes properties:
- Name:
Males
- Aggregate Function: choose
Count
- Filter: create a new filter
- Name:
ByMales
- Filter Details:
Gender
containsMale
- Name:
- Name:
- On the View Attributes properties:
- Repeat these steps for the other Schools_StudentsGender attribute but this time for Females
- Display the data in the View by hovering over
and clickingInsert excerpt _more_options _more_options nopanel true
DisplayInsert excerpt _view_show_icononly _view_show_icononly nopanel true
HTML Comment |
---|
Example 2: Students on Each CourseWe want to see the number of males and females on each course. Example 2: Students and Teachers in a DepartmentWe want to see the names of teachers and students umber of males and females on each course. |