0

I am looking for an example of expressing a "Composite Keys" in a data dictionary.

I am using an MSO Access application with a Lecturer Table and Subjects Table where I have taken the Primary Keys from their tables to create a table called Timetable.

From the information building the database file I must create a Data Dictionary but was caught off guard when I had to question myself in explaining the referencing of these two fields that create them as a Composite Key.

My "Data Dictionary" is comprised of a Field Name, Data Type with Field Size, Constraints, References and Field Description.

I have found it difficult to find any subjects on this matter which is directed by how a Composite Key in a Data Dictionary may be expressed and hope I may get some ideas here.

Bergi
  • 514
  • 3
  • 13
Jeff
  • 1
  • 1

1 Answers1

1

Notation for composite keys typically takes the form of:

(key1, key2)

This can be seen in the T-SQL language, per:

CREATE TABLE dbo.lecturers
(
    lecturer_name varchar(30) NOT NULL
        PRIMARY KEY
);

CREATE TABLE dbo.subjects ( subject_name varchar(30) NOT NULL PRIMARY KEY );

CREATE TABLE dbo.timetable ( lecturer_name varchar(30) NOT NULL FOREIGN KEY REFERENCES dbo.lecturers(lecturer_name) , subject_name varchar(30) NOT NULL FOREIGN KEY REFERENCES dbo.subjects(subject_name) , PRIMARY KEY (lecturer_name, subject_name) );

In the above example, the composite primary key for dbo.timetable is expressed as (lecturer_name, subject_name).

Hannah Vernon
  • 70,928
  • 22
  • 177
  • 323