| bio | website | |
|---|---|---|
| location | ||
| age | ||
| visits | member for | 2 years, 1 month |
| seen | yesterday | |
| stats | profile views | 71 |
|
May 13 |
awarded | Caucus |
|
May 10 |
answered | Can a surrogate key and a primary key be in the same table? |
|
May 2 |
answered | Database design - People and Organisations |
|
Mar 31 |
awarded | Yearling |
|
Dec 4 |
comment |
The four properties of a primary key Perhaps you were taught wrong. Those four conditions are neither necessary nor sufficient to make a key. Keys must be irreducibly unique (a minimal superkey) and non-nullable. Non-partial dependence is a requirement of 2nd Normal Form but not a fundamental requirement of keys. Indexing also has nothing to do with whether a set of attributes qualify as a key or not. |
|
Aug 29 |
comment |
Why should a CTE start with a semi-colon? "Why should a CTE start with a semi-colon?" In Standard SQL every statement is supposed to end with a semi-colon. The problem is that T-SQL only enforces that rule in a few places and one of those is for any statement that comes before a CTE. If there is no statement before WITH then you don't need ;. |
|
Jul 18 |
comment |
Primary key should be chosen so as attributes never change? You can't have read what I wrote. I was not "praising" anything. I've certainly changed surrogate key values plenty of times. In fact I'm surprised if you haven't encountered the need to update surrogate keys. Anyway, the question is about keys in general, not just surrogates. If you meant your answer to apply only to surrogate keys then you ought to say so. |
|
Jul 18 |
comment |
Primary key should be chosen so as attributes never change? What is the relevance of saying the identity of an "entity" cannot change? By "entity" I understand you to mean "the thing about which information is recorded in the table". In practice the identifying attributes of things do sometimes change. In any case, the process and effect of changing keys is exactly the same whether you say a thing is the same entity afterwards or not. Enforcing immutability of keys is practically impossible in very many cases and unlikely to be helpful. |
|
Jul 18 |
answered | Primary key should be chosen so as attributes never change? |
|
Jun 29 |
comment |
Is database normalization dead? @Nupul, It seems very unlikely that the specified example of a surrogate key and a key consisting of an email address would be in violation of 2NF or BCNF. 2NF is violated only where there is a partial-key dependency. |
|
Jun 8 |
awarded | Caucus |
|
Apr 18 |
revised |
What normal form does a surrogate key violate? expanded based on ypercube's comment |
|
Apr 18 |
comment |
What normal form does a surrogate key violate? 5NF is "obscure"?! More to the point, the "nothing but the key" cliché isn't a very precise description of 3NF. 3NF is concerned equally with all the candidate keys of a relation, not just one. A surrogate key won't violate 3NF unless it gives rise to some partial key dependency. Most people will understand "surrogate" to mean a simple (non-composite) key consisting only of arbitrary values, so a partial key dependency involving a surrogate is extremely unlikely. |
|
Apr 18 |
answered | What normal form does a surrogate key violate? |
|
Apr 16 |
revised |
Using an RDBMS for querying tens of Terabytes of time-series data? The text of the question indicates that the title should be 10s rather than 10ths |
|
Apr 16 |
comment |
Using an RDBMS for querying tens of Terabytes of time-series data? Exadata, Netezza, Greenplum, etc. These are some of the popular SQL DBMSs for handling 10s or 100s of Terabytes of data. |
|
Apr 16 |
suggested | suggested edit on Using an RDBMS for querying tens of Terabytes of time-series data? |
|
Mar 31 |
awarded | Yearling |
|
Mar 9 |
awarded | Necromancer |
|
Feb 20 |
comment |
Would it be considered as a bad practice to have multiple nullable FKs on a table in SQL Server One nullable foreign key is one too many. |