Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question.

Asked: September 23, 2025 - 6:19 pm UTC

Last updated: September 24, 2025 - 4:58 am UTC

Version: 19.28.0.0

You Asked

Hello,

I work as a dba and get requests from developers to create tables which we often review and sometimes change for better design and/or implementation.

One of the developers recently sent a request to create a table such as the following ;

table_name:t1_relation

Column_names:
c1_master_id_pk (foreign key to t1_master table)
c1_attribute
c1_value

primary key all 3 columns.

They explained that the data in all these columns are all non nullable and that they are all needed to uniquely identify a record.

having all the columns of a table as a primary key didn't look very right to me and so
I suggested we create a surrogate key and make the 3 columns unique with not null constraints on all of them. they initially said yes then came back and said to change it to be how they requested initially.

I'm messaging to ask if this is proper database design and what would be the ideal way to implement this?

and Connor said...

There is no inherent issue with a PK being all columns in a table. For example, its common in intersection tables:

- Students take many classes
- Each class has many students
which will give rise to:

STUDENTS table ( primary key STUDENT_ID)
CLASSES table ( primary key CLASS_ID)
STUDENT_CLASSES intersection table (columns = STUDENT_ID, CLASS_ID, and primary key the same)

But !!!!!!!!!!!!

Based on the description you've provided, unless you've simply anonymised things for the question, it sounds a lot like a generic style data model.... and that can be very very bad news.

Check out these asktom posts - I'd encourage you read the "Bad Carma" one :-)

https://asktom.oracle.com/ords/asktom.search?tag=query-on-design

https://asktom.oracle.com/ords/asktom.search?tag=data-models