Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In terms of comparing data structures, is a relational database just a >1 dimensional array? I'm just asking because I don't know much about databases, but I know a bit about data structures.

I am trying to make this clear in my mind.

share|cite|improve this question

migrated from Feb 14 '13 at 8:52

This question came from our site for theoretical computer scientists and researchers in related fields.

No, it isn't. A data structure can be described in two ways:

  1. How does it store the data.
  2. Which operations are supported, their performance (usually given as asymptotic time- and/or space-complexity), and what laws do they obey.

Obviously, a database doesn't store all its data as a single array.

Arrays support, as basic operations, retrieving an element by index and storing an element under an index. Operations required for databases are (to a first approximation) given by relational algebra: selection, projection, union, difference, and join (or product).

share|cite|improve this answer

Technically, you could say that a database can be represented as a huge array. The benefit of a DB, however, is the ability to represent this huge array very succinctly.

More theoretically, the benefit of a DB can be compared to the topological fact that cylinder sets can be represented succinctly, as opposed to more complex subsets. Essentially, a DB is a representation of a cylinder set as a multiplication of its respective dimensions.

share|cite|improve this answer

In database literature this idea is widely known as universal relation.

share|cite|improve this answer

There is some basic similarity between relational DB and large array (table~multidimensional array).

Relational DB is based on relational algebra which makes it powerful. By using relational operators, information could be retrieved, updated, inserted, deleted etc... in DB efficiently.

Considering array as a simple data structure, it only supports read/write operators in constant time $O(1)$. while in relational db you can write lots of complex queries using relational algebra.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.