1

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?

1 Answer 1

1

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.

1
  • Hi Laurenz, thanks for the answer. Okay, that clarifies it perfectly. Much appreciated. Commented Oct 9, 2019 at 0:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.