Questions tagged [relational-database]

A relational database is a database consisting of relation variables (which are also called *relvars*, *R-tables* or just *tables*). The definition, manipulation and integrity rules of relational databases are based on relational operations equivalent to or similar to the Relational Algebra and Calculus. Relational database principles are the basis of a substantial part of data management theory and practice.

A relational database is a database consisting of relation variables (which are also called relvars, R-tables or just tables). The definition, manipulation and integrity rules of relational databases are based on relational operations equivalent to or similar to the Relational Algebra and Calculus. Relational database principles are the basis of a substantial part of data management theory and practice.

Targeted Questions

This tag is appropriate for questions concerning the relational model, relational and relational database implementation.

The SQL language is commonly used to specify relational database-designs and to define and solve relational database problems. However, DBMSs based on SQL are by definition not s and therefore not all SQL questions are relevant to the relational database tag. Questions specific to or its implementations should be tagged accordingly.

6790 questions
14
votes
4 answers

Where Result set is stored while working with jdbc and oracle driver

Once I use jdbc with oracle driver and run select query is the result of the query is stored in the server of oracle memory or file system or temp table ? and once I run the next method by getting the next row is it loaded from the oracle server…
Blue Label
  • 427
  • 1
  • 7
  • 15
14
votes
2 answers

natural key vs surrogate key an innodb foreign key

A question: I have 2 tables: Product id INT name VARCHAR(64) something TEXT else INT entirely BOOL and Ingredient id INT name VARCHAR(64) description TEXT Now I also have a link table Products_Ingredients product_id INT ingredient_id INT for my…
14
votes
7 answers

What is the relational database equivalent of Factorial and the Fibonacci function?

When learning a new programming language there are always a couple of traditional problems that are good to get yourself moving. For example, Hello world and Fibonacci will show how to read input, print output and compute functions (the bread and…
hugomg
  • 68,213
  • 24
  • 160
  • 246
14
votes
5 answers

Representing Number Ranges in a Relational Database (MySQL)

I'm trying to understand if there are any standard best practice approaches for modelling number ranges in a Relational Database (In this case MySQL) and if this is in fact a sensible thing to do. I shall explain the task that prompted the question…
Nick Long
  • 1,908
  • 3
  • 18
  • 28
14
votes
1 answer

How does sharding handle the joining of related tables?

When I read about sharding, looks like authors don't take into account other tables the sharded table has to be joined to (even though they describe a shard as a "subset of an original database"). However, this is a very common situation and I still…
raiks
  • 1,270
  • 1
  • 15
  • 12
14
votes
2 answers

Decomposition into Third Normal Form (3NF)

Scheme (R) = (A,B,C,D,E,F,G,H) Function Dependencies (F) = {A->CGH, AD->C, DE->F, G->H} How would I perform a lossless-join decomposition of the schema R into Third Normal Form (3NF)? Any help will be appreciated.
Chris
  • 141
  • 1
  • 1
  • 3
14
votes
4 answers

Storing graphs in fully-normalized relational databases

Goal Find a perfect, flexible schema for storing many different types of objects with a wide variety of links between them in a relational database. Problem EAV is a workaround to the normal confinements of a RDBMS. If you were to normalize an EAV…
14
votes
1 answer

How to describe performance issue in relational database?

I have a query running in a relational database that doesn't fulfill the expectation of the users. What information should I provide and what should I avoid, so that I can receive an effective help on this site?
Marmite Bomber
  • 19,886
  • 4
  • 26
  • 53
14
votes
3 answers

Difference between Relational Algebra and Relational calculus

What is the exact difference between relational algebra and relational calculus? At most references, it will be Relational algebra is procedural and calculus is non-procedural. What do these terms mean? We can solve all problems using relational…
14
votes
3 answers

Strategic issue: Mixing relational and non-relational db?

There has been a lot of talk about contra-revolutionary NoSQL databases like Cassandra, CouchDB, Hypertable, MongoDB, Project Voldemort, BigTable, and so many more. As far as I am concerned, the strongest pros are scalability, performance and…
Ta Sas
  • 9,573
  • 15
  • 51
  • 73
14
votes
4 answers

Why is it bad to use boolean flags in databases? And what should be used instead?

I've been reading through some of guides on database optimization and best practices and a lot of them suggest not using boolean flags at all in the DB schema (ex http://forge.mysql.com/wiki/Top10SQLPerformanceTips). However, they never provide any…
David Chanin
  • 533
  • 6
  • 17
14
votes
6 answers

How to change MySQL Primary Key from signed to unsigned?

In my MySQL InnoDB Database with foreign keys I accidentally made some of my primary keys signed instead of unsigned as I want them to be. Now I want to change it with a ALTER TABLE statement but it does not work: ALTER TABLE `users` CHANGE `id`…
Norwald2
  • 695
  • 4
  • 9
  • 19
13
votes
2 answers

When would it be worth it to maintain an inverse relationship in Doctrine2?

In the Doctrine manual, under Constrain relationships as much as possible, it gives the advice "Eliminate nonessential associations" and "avoid bidirectional associations if possible". I don't understand what criteria would make an association…
theazureshadow
  • 9,499
  • 5
  • 33
  • 48
13
votes
4 answers

Checking the type of relationship between columns in python/pandas? (one-to-one, one-to-many, or many-to-many)

Let's say I have 5 columns. pd.DataFrame({ 'Column1': [1, 2, 3, 4, 5, 6, 7, 8, 9], 'Column2': [4, 3, 6, 8, 3, 4, 1, 4, 3], 'Column3': [7, 3, 3, 1, 2, 2, 3, 2, 7], 'Column4': [9, 8, 7, 6, 5, 4, 3, 2, 1], 'Column5': [1, 1, 1, 1, 1, 1, 1, 1, 1]}) Is…
dank
  • 303
  • 4
  • 20
13
votes
3 answers

which data structure is used in most popular databases?

i want to know which data structure(AVL, B-Tree, etc...) is used in most popular relational databases. and also in what way the data structure is superior than other in-class data structures? if possible a small comparison could help me a lot!…
brainless
  • 5,698
  • 16
  • 59
  • 82