A family of Microsoft relational database management systems designed for ease of use.
Use one tblContributor table for people and one tblTitleContributor junction table containing the contributor’s role, rather than separate Composer, Lyricist, and Arranger tables.
Recommended structure
Composer, lyricist, and arranger are roles, not different kinds of people. The same person could compose one title, arrange another, or hold multiple roles on the same title. Storing that person once avoids duplicate names and inconsistent details, consistent with Access normalization guidance.^1^
Create these tables:
tblTitle
| Field | Type | Notes |
|---|---|---|
TitleID |
AutoNumber | Primary key |
TitleName |
Short Text | |
| other title fields | appropriate types |
tblContributor
| Field | Type | Notes |
|---|---|---|
ContributorID |
AutoNumber | Primary key |
GivenName |
Short Text | |
FamilyName |
Short Text |
tblRole
| Field | Type | Example values |
|---|---|---|
RoleID |
AutoNumber | Primary key |
RoleName |
Short Text | Composer, Lyricist, Arranger |
tblTitleContributor
| Field | Type | Notes |
|---|---|---|
TitleContributorID |
AutoNumber | Primary key |
TitleID |
Number, Long Integer | Foreign key |
ContributorID |
Number, Long Integer | Foreign key |
RoleID |
Number, Long Integer | Foreign key |
Each record in tblTitleContributor represents one fact, such as:
| TitleID | ContributorID | RoleID |
|---|---|---|
| 10 | 4 | Composer |
| 10 | 7 | Lyricist |
| 10 | 4 | Arranger |
A many-to-many relationship is implemented by a junction table that turns it into two one-to-many relationships.^2^
If a credit has additional information—such as credit order, pseudonym, or notes—put those fields in tblTitleContributor, because they describe that particular title/person/role association.
Also create a unique multi-field index over:
-
TitleID -
ContributorID -
RoleID
That prevents the same person from accidentally receiving the same role twice for one title.
Create the relationships
In Database Tools > Relationships:
- Relate
tblTitle.TitleIDtotblTitleContributor.TitleID. - Relate
tblContributor.ContributorIDtotblTitleContributor.ContributorID. - Relate
tblRole.RoleIDtotblTitleContributor.RoleID. - Select Enforce Referential Integrity for each relationship.
- Make sure every junction foreign key is Number / Long Integer, because it references an AutoNumber primary key.
The resulting relationships are:
tblTitle 1 ─── ∞ tblTitleContributor ∞ ─── 1 tblContributor
∞
│
1
tblRole
Referential integrity prevents junction records from referring to nonexistent titles, contributors, or roles.^2^
Query all titles for a composer
Use the junction table to connect and filter records, but normally display fields such as the title name from tblTitle and the person’s name from tblContributor.
In Create > Query Design, add all four tables. Access should add the joins automatically if the relationships are defined. A query needs the junction table even when its ID fields are not displayed.^3^
Equivalent Access SQL:
SELECT C.ContributorID,
C.GivenName,
C.FamilyName,
T.TitleID,
T.TitleName
FROM ((tblContributor AS C
INNER JOIN tblTitleContributor AS TC
ON C.ContributorID = TC.ContributorID)
INNER JOIN tblTitle AS T
ON TC.TitleID = T.TitleID)
INNER JOIN tblRole AS R
ON TC.RoleID = R.RoleID
WHERE R.RoleName = "Composer"
ORDER BY C.FamilyName, C.GivenName, T.TitleName;
Access uses JOIN clauses to retrieve related information from multiple tables; the key fields can be used for matching without being shown to users.^4^
To show titles for only one particular contributor, add this criterion under ContributorID:
Forms![frmContributor]![ContributorID]
Display the titles on a form
A main form/subform design is the simplest arrangement:
- Create
frmContributor, based ontblContributor. - Save the composer query as
qryContributorTitles. - Create a continuous or datasheet form named
sfrmContributorTitles, based on that query. - Include
ContributorIDin the subform’s record source, but hide its control if desired. - Open
frmContributorin Design View and add a Subform/Subreport control. - Set:
- Source Object:
Form.sfrmContributorTitles - Link Master Fields:
ContributorID - Link Child Fields:
ContributorID
- Source Object:
The subform will then show only titles associated with the contributor currently displayed on the main form. Access subforms are designed for this one-to-many parent/child display.^5^
For entering credits, use a subform bound to tblTitleContributor and combo boxes for ContributorID and RoleID. Store the numeric IDs while displaying contributor and role names.
Separate contributor tables and three junction tables can technically work, but they duplicate the same kind of entity and make it awkward when one person has multiple roles. Use that design only if composers, lyricists, and arrangers truly require fundamentally different data and can never overlap.
References