Are all databases relational?

Question

In the context of this exercise, are all databases relational?

Answer

No, not all databases are relational databases. Databases can be non-relational, and this type of database is referred to as NoSQL databases.

NoSQL databases are structured differently from the relational database structure. With relational, we structure tables by the type of relations, but NoSQL keeps all the information in one place, in the form of key-values or documents.

For example, consider a database of people and their subscriptions to a newsletter.

Using a relational database structure, we might separate the information for each person, having their id, name, and email, in one table named customers, and then another table for the subscriptions, having the newsletter name, and other information associated with the subscriptions.

With a NoSQL database, instead of separating information in this way, we might just have a single document with the person’s information, as well as the subscription information, all in one document. As you might tell, this type of structuring might have some benefits and some cons compared to relational databases.

26 Likes

Is a relational database defined by what data you are comparing for a given query and not actually the structure of the database itself?

For example, by this definition, would the customers table on its own be considered a NoSQL database combining name, address, and id if you wanted to specifically compare name and address?

Then a relational SQL database of the same information would require 3 single-column tables for “customer-name,” “customer-id,” and “customer-address”?

6 Likes

In this context, the customers table on its own is meaningless. This table will be helpful if it is used in relation to another activities by the customers. Hence, creating a relation between customers and activities. On the other hand, NoSQL will store all this data together in one place so you end up with one table instead of multiple tables with relations.

14 Likes

I feel like this kind of all in one pile document by specific keys may derive in faster performance for some applications due to the fact it wouldnt have to join so many tables between them and make connections like in a relational database. Also I believe there are different types of non relational databases like Hadoop or NoSQL types, which can be with no structure or semi structured. I just would like to understand in a more tangible way which applications could these be.

6 Likes

No,there are 3 types of data models(dbms)
1)network model
2)hierarchy model
3)relational model
the first two are not preferred for various reasons like accessing data, data redundancy etc where rdbms is preferred as it contains data in form of tables and each table is related to one or more tables via a relation and it eliminates data redundancy.
We use sql for passing queries to rdbms like mysql,sql server etc which maintains relatinal database .

7 Likes

So is an Excel sheet a NoSQL database?

2 Likes

Yes. Its columns and rows have no link to keys or indices of other data sets, or at least that’s the easily made presumption, given a raw Excel worksheet. It’s just tabular data; without a framework, destined to be nothing more.


What are the relational elements of that table? As I see it, Row 1 (A…Z), Col A (4…34), and Col B (4…34) as keys; the rest being a jumble of arranged data points.

With some analysis we can zero in on the maximums and minimums, but hardly a lot of relations, apart from what we’ve already stated would be potential keys in a relational database. In general terms this is called, cross-joining, but it goes much deeper than that so just keep that term in the margin of your notes.

We can and do use spreadsheets (tables) in databasing. Even if it is a single worksheet it is still a form of database and we can still dynamically access and manipulate it with software. Is it a relational database? No. It’s just data in a table. We have to define the relations that exist, if not in this table, in the group of tables that combine with it in the data set. Note all the tabs in the screenshot.

3 Likes