A “part-key”

database-theoryprimary-keyrelational-theoryterminology

I'm a beginner and student with regards to database design. The tutor recently discussed “part-keys”. I am struggling to find any information on what a part-key is, and I suspect it probably goes by another name.

The example we were given in class was this:

ACTIVITY(Activity(PK), Fee)
STUDENT_ACTIVITY(StudentID(PK), Activity(PK))

Is the table showing part-key dependency?

Yes. Since the second determinant (Activity) is part of the primary key (StudentID, Activity).

Is anyone able to give me any further information?

Best Answer

This example does not contain a partial dependency to me.

A partial dependency would be if a table column functionally depends on part of the table's primary key, like in this denormalized table:

CREATE TABLE student_activity (
   studentid bigint NOT NULL,
   activity character varying(30) NOT NULL,
   fee numeric(10,2) NOT NULL,
   PRIMARY KEY (studentid, activity)
);

where fee depends on activity.

The solution would be to split this table in two parts like in your question.