Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [candidate-key]

A candidate key of a relational table is a set of columns whose subrow values are unique (a unique key, aka superkey) that doesn't contain a smaller such set. One can be chosen primary key; each other is then an alternate key. (An SQL PRIMARY KEY or UNIQUE NOT NULL declaration declares a superkey. It is a candidate key if no smaller one is declared within it.)

Filter by
Sorted by
Tagged with
1 vote
1 answer

Simple and Composite Candidate Key and Nulls

One of the differences between a candidate key and a primary key is that "candidate keys can contain nulls." I have been unable to find a more precise definition of what this means. One ...
Ryan R. Rosario's user avatar
1 vote
0 answers

Solution verification for functional dependency using armstrong axioms [closed]

I have the following functional dependencies which includes all attributes of the relation: {AB -> C, BC -> AD, D -> E, CF -> B} CF supposedly is a candidate key. The task is: Show that CF ...
Rubus's user avatar
  • 131
1 vote
2 answers

What are the disadvantages of using surrogate keys? [closed]

I am using MS SQL Server but in general database design I want to know what problems can arise when every row in a database has its auto generated surrogate key value. I know some advantages, for ...
igelr's user avatar
  • 2,132
7 votes
2 answers

Does the concept of candidate key exist only in theory?

I know the concept of candidate key in RDBMS theory, but do candidate keys really exist in actual SQL engines? I mean is there any way to designate a particular column or set of columns as a candidate ...
RajS's user avatar
  • 249
1 vote
2 answers

Defining a primary key: Customer numbers are unique only within a country but may be duplicated across different countries

I am facing the following problem: I have a table with customer information like the customer number, i.e. customerID set up as the primary key, and, besides a number of other data, also a country ...
 Poldi60's user avatar
3 votes
1 answer

What is the meaning of "minimal key"?

In the definition, it says minimal key is a minimal set of attributes needed to identify the table. Does the "minimal" part mean "minimal number of attributes" or "cannot be eliminated"? For example: ...
Stephanie Mussi's user avatar
8 votes
3 answers

When should a primary key be meaningful?

Excuse the looseness of any definitions here, but I am trying to explore a simple concept. A Primary Key uniquely identifies a row. There are possibly other columns in a table with unique values, so ...
Manngo's user avatar
  • 2,839
26 votes
3 answers

What is the difference between a primary key and a superkey in a DBMS

What is the difference between a primary key and a superkey in a DBMS? Can a primary key and a superkey both have multiple columns? Is a primary key a subset of a superkey or vice versa?
MikeHil's user avatar
  • 369
2 votes
2 answers

Composite primary key plus a separate (surrogate) id column for foreign key references

I am trying to build a database about locations like so: Country → Region → Town Countries will be populated with a list of pre-defined worldwide countries, regions & towns are input by users. ...
the_peacock's user avatar