Skip to main content
33 votes
Accepted

Why the term "relation(al)"?

First of all, I highly recommend the scientific paper in which Dr. Edgar Frank Codd published the relational framework to the general public in 1970, i.e., A Relational Model of Data for Large Shared ...
MDCCL's user avatar
  • 8,530
17 votes
Accepted

Is a table without a primary key normalized?

If a relation does not have any candidate key (and the primary key is just one of the candidate keys), then it can have duplicate rows, so in fact it is not a relation! (since relations are always ...
Renzo's user avatar
  • 4,080
16 votes

Why the term "relation(al)"?

The interesting thing behind 'relational database' is, that it does not (primarily) refer to the relations between tables, as you might expect, but it refers to the relation of multiple properties (...
eckes's user avatar
  • 1,456
14 votes
Accepted

Integrity constraints in a relational database - should we overlook them?

If, as stated in your post, the intention is to create a relational database (RDB for brevity) and, therefore, it is expected that it functions as such, the short answer is: No, you should not ...
MDCCL's user avatar
  • 8,530
13 votes
Accepted

Unused columns in WHERE clause

Both queries are ridiculously complicated. Use DELETE FROM "Foo" WHERE "CreatedAt" < current_timestamp;
Laurenz Albe's user avatar
  • 54.1k
11 votes

Does using composite keys violate 2NF?

Your definition of 2NF is not quite correct. 2NF is when a relation is in 1NF and it has no partial dependencies, meaning there are no predicates (columns) that depend on only part of a multi-part ...
Joel Brown's user avatar
  • 12.5k
11 votes
Accepted

Why Cassandra is not considered a relational database?

Cassandra is not an RDBMS because it does not support the relational data model. The fundamental assumption of the relational model is that all data is represented as mathematical n-ary relations, an ...
David Browne - Microsoft's user avatar
10 votes

Why the term "relation(al)"?

The term "relational" comes from mathematics and has nothing to do with relationships between entities. I'm not a mathematician (whereas Codd had a PhD in Mathematics) and so won't elaborate, but ...
Todd Everett's user avatar
  • 3,548
9 votes

Integrity constraints in a relational database - should we overlook them?

The basic premise of your developers is absolutely wrong. Foreign keys will impact slightly the performance of the DML of your system. They are not used at all in queries thus have no effect on their ...
TommCatt's user avatar
  • 2,139
9 votes

Does the concept of candidate key exist only in theory?

As far as I know, no SQL database management system (DBMS) supplies the CANDIDATE KEY keyword as such, but (as I consider that you are suggesting in the question) that does not mean that the notion (...
MDCCL's user avatar
  • 8,530
9 votes
Accepted

Why is it considered that a set unnormalizes a database absolutely?

The reference for this post is an amazing book called Database System Concepts 6th Edition which I recommend you read. In the book, page 328, it states: A domain is atomic if elements of the ...
Chessbrain's user avatar
  • 1,223
8 votes

First Normal Form: Definitive Definition

Preliminary The definition of normal form (which from the presentation of “Further Normalization of the Data Base Relational Model” in 1971 is known as first normal form) and the definition of the ...
MDCCL's user avatar
  • 8,530
8 votes
Accepted

RDBMS: Proper way to store data - comma separated variables or in different fields or tables?

Why storing data as a string a problem : Storing multiple datums as (in this case comma separated) strings is bad practice because: First reason: It breaches Codd's second rule (called the "...
Vérace's user avatar
  • 30.3k
7 votes
Accepted

Database design: Normalizing a "(many-to-many)-to-many" relationship

Option 1 *This doesn't seem like a great idea to me, because it complicates the SQL to select all properties applied to a feature… It does not necessarily complicate query SQL (see conclusion ...
Jack Douglas's user avatar
  • 40.1k
7 votes

Why the term "relation(al)"?

It's an intuitive name when you think of them with natural keys. You can think of a cell value as representing an entity. Relation: Employee |--------+------------+--------| | name | job | ...
JoL's user avatar
  • 289
7 votes
Accepted

Is combining independent tables called normalisation?

No, the task you are being asked to fulfill —arranging (a) columns that belong in two or more distinct base tables in (b) a single base table— is not called normalisation (nor normalization for those ...
MDCCL's user avatar
  • 8,530
7 votes
Accepted

How does normalization fix the three types of update anomalies?

1NF is basically just "don't keep too much data in a single column", so I think that 2NF and 3NF are the primary fix for all 3 database anomalies, since both 2NF and 3NF involve breaking out items ...
BradC's user avatar
  • 10k
7 votes

Is saving disk space still considered an advantage of normalization?

Normalization was never about saving disk space. In his 1971 normalization paper E.F.Codd wrote: "It is important to remember that we are not making a case for or against any physical storage ...
nvogel's user avatar
  • 3,777
7 votes

How do I identify the SQL server brand via SQL queries

Go by elimination. Failing select @@version will eliminate both SQL Server and MySQL; failing select version() will eliminate both Postgres and MySQL; etc. Examples of such queries have been helpfully ...
mustaccio's user avatar
  • 26.4k
6 votes
Accepted

Proof that Inner Join is Commutative

An inner join is the subset of rows from the cartesian product where a certain condition is true. Although the cartesian product is not commutative (nor associative), it is with regard to relational ...
joanolo's user avatar
  • 13.5k
6 votes
Accepted

What are object-relational databases, and why is this model necessary in spatial databases?

The relational model and the object-oriented paradigm The state-of-the-art relational model, originated in 1970 by Dr. E. F. Codd, is applied science concerning the field of database administration. ...
MDCCL's user avatar
  • 8,530
6 votes

Why the term "relation(al)"?

You have already accepted a very long answer that has to say a lot about databases, but let me answer the question you actually asked: Why the term "relational". Because a table is a concrete ...
AnoE's user avatar
  • 351
6 votes
Accepted

How are joins Commutative and Associative?

You've made an incorrect assumption. If three's a relationship between A and B, and between B and C but no relationship between A and C, joining A and C doesn't give you no rows. It actually gives ...
RDFozz's user avatar
  • 11.6k
6 votes
Accepted

Do my relational algebra operations produce the desired results?

This is indeed the error: R4 := R2 ∩ R3 If we try to get the intermediate results of your solution, we get: R1: bid bname color sid date --- --------- ----- --- -...
ypercubeᵀᴹ's user avatar
6 votes
Accepted

What normalization rules does this table break

This is a terrible pattern, but it doesn't actually break any normalization rules. The reason is that it's actually a change in what you are modeling. Instead of your database modeling, say, ...
David Browne - Microsoft's user avatar
6 votes
Accepted

Incorrect result when using 'case when count()=0' & 'where'

just move where conditions to the join part: select U.Mail, count(P.ID) as PostCount, case when count(P.ID) = 0 then 'none' when count(P.ID) <= 2 then 'few' when count(P.ID)...
NikitaSerbskiy's user avatar
6 votes

One and only one relationship - ER diagram to relational schema

You have several possibilities, each of them with advantages and disadvantages. Solution 1 Define a single table: AB(a b c d e f) with two candidate keys, b and e. You chose one of them as primary ...
Renzo's user avatar
  • 4,080
5 votes

A tuple relational calculus equivalent for the given SQL query

A tuple relational calculus expression should be written with the usual language of first order logic. In this case, for instance, you could write: { [e.Name, d.Name] | Ǝ e ∈ Employee, Ǝ d ∈ ...
Renzo's user avatar
  • 4,080
5 votes
Accepted

Estimate result size of Natural Join

You have at most 1000 rows from the natural join of R1 and R2 because there are two possible cases: either 1) all the values of R1.C are present in R2.C (i.e. R1.C is a “foreign key” for R2), or, 2) ...
Renzo's user avatar
  • 4,080
5 votes

What is the correct term to describe a single "data point" in a database?

The term Attribute would be the most appropriate. Relational Database Theory Basically, you're talking about columns and 'Column' is most appropriate when talking about the database itself or in SQL ...
Ian_H's user avatar
  • 1,656

Only top scored, non community-wiki answers of a minimum length are eligible