Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

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|improve this question
add comment

migrated from cstheory.stackexchange.com Feb 14 '13 at 8:52

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

4 Answers

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|improve this answer
add comment

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|improve this answer
add comment

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

share|improve this answer
add comment

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|improve this answer
add comment

Your Answer

 
discard

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.