Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.)

1
vote
0answers
27 views

Do candidate key concept 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 anyway to designate particular column or a set of columns as candidate ...
1
vote
2answers
44 views

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 ...
2
votes
1answer
61 views

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: ...
5
votes
3answers
808 views

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 ...
17
votes
4answers
91k views

What is the difference between Primary key and Super key in DBMS

I am new to DBMSs and I am still learning the theory. I am getting really confused with this key business and after googling I have narrowed it down to just 2 keys I don't get (primary and super key)....