Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 422
Mark Avatar asked Dec 17 '25 20:12

Mark


1 Answers

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.

like image 68
Bill Karwin Avatar answered Dec 19 '25 09:12

Bill Karwin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!