79629349

Date: 2025-05-19 19:23:42
Score: 1
Natty:
Report link

The short answer is that you are creating a representation of a many-to-many relationship between two tables that you want to join in various ways.

Let's say you have a database that's representing an apartment complex.

You may have a "Building" table that contains information about each building, and a "Unit" table that contains information about specific units in the Apartment Complex. But each Unit will share a lot of information with other units of the same type, so we make a "UnitType" table. If each Building has many "UnitTypes" in it, and each "UnitType" is in multiple buildings, you may want to (in a relational database) create a "BuildingType" table that handles the many-to-many relationship between the Building and its composite UnitTypes.

This is the primary reason I can think of to create a table that is only a Composite Key.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: user2074599