开发者

What kind of data is highly relational

I'm new to databases, and 开发者_如何转开发is exploring SQL vs noSQL.

What kind of data is highly relational and benefits from SQL and what kind of data does not?

Please provide some examples.


Relational data fits into the definition of a relation:

  • A header defines a finite set of columns.
  • Each column has a name and a data type.
  • Data types are a named, finite set of distinct values.
  • Each column in a given row of the relation contains one value of the appropriate data type for the respective column.
  • Rows have no implicit order.
  • Columns have no implicit order.
  • Duplicate rows are not allowed.

These conditions are prerequisites for all the Normal Forms of relations. That is, a table doesn't qualify even for First Normal Form unless it's a relation. Many operations in SQL don't work right if the table isn't relational.

To be more practical, a relational table must have the same properties on every row, by the same names, and must have a primary key defined over one or more columns so you can reference each row individually.

NoSQL is actually a marketing term used to brand and promote some data management products. It's not a computer science term.

But if you mean non-relational, then you can see that a non-relational data store is allowed to break some of the rules above:

  • Two entries (rows) in a given collection can be duplicates.
  • The fields can vary per entry. Different number, different names, different data types.
  • A given field can contain the same value in two entries, yet the value is considered different for some reason (for example, depending on the value in another field).
  • Order of entries is significant (for example, the entries are assumed to be in chronological order).
  • Order of fields is significant (for example, the first field is assumed to be a key of some kind).

But by breaking these rules, you lose the foundation on which relational operations work.


Your question seems to be burdened with a few misconceptions. Relational as in Relational Database refers to a type of data model - the system of representation used for data. Any information that consists of facts (propositions) can be represented relationally if your DBMS supports that type of information. There is no intrinsic quality of any information that makes it more or less suitable for an RDBMS.

SQL is a (strictly non-relational) database language.

NOSQL is a loose term that can be applied to any database system that doesn't use SQL or that extends the capabilities of SQL. NOSQL and relational are not mutually exclusive concepts. NOSQL does not have to mean "non-relational", it just means "not SQL".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜