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
46
votes
4 answers

Triple Stores vs Relational Databases

I was wondering what are the advantages of using Triple Stores over a relational database?
Sam
  • 1,479
  • 3
  • 14
  • 16
43
votes
3 answers

Relational vs. Dimensional Databases, what's the difference?

I'm trying to learn about OLAP and data warehousing, and I'm confused about the difference between relational and dimensional modeling. Is dimensional modeling basically relational modeling, but allowing for redundant/un-normalized data? For…
40
votes
5 answers

Safe modelling of relational data in Haskell

I find it very common to want to model relational data in my functional programs. For example, when developing a web-site I may want to have the following data structure to store info about my users: data User = User { name :: String ,…
Rotsor
  • 13,655
  • 6
  • 43
  • 57
39
votes
5 answers

what are the advantages of defining a foreign key

What is the advantage of defining a foreign key when working with an MVC framework that handles the relation? I'm using a relational database with a framework that allows model definitions with relations. Because the foreign keys are defined through…
Daniel
  • 34,125
  • 17
  • 102
  • 150
37
votes
1 answer

What is the difference between 3NF and BCNF?

Can someone please explain the difference between 3NF and BCNF to me? It would be great if you could also provide some examples. Thanks.
36
votes
7 answers

MySQL query, MAX() + GROUP BY

Daft SQL question. I have a table like so ('pid' is auto-increment primary col) CREATE TABLE theTable ( `pid` INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, `timestamp` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `cost` INT UNSIGNED NOT NULL, …
codinghands
  • 1,741
  • 2
  • 18
  • 31
35
votes
4 answers

Using a Filesystem (Not a Database!) for Schemaless Data - Best Practices

After reading over my other question, Using a Relational Database for Schema-Less Data, I began to wonder if a filesystem is more appropriate than a relational database for storing and querying schemaless data. Rather than just building a file…
35
votes
6 answers

designing database to hold different metadata information

So I am trying to design a database that will allow me to connect one product with multiple categories. This part I have figured. But what I am not able to resolve is the issue of holding different type of product details. For example, the product…
Obaid
  • 4,328
  • 9
  • 42
  • 42
35
votes
3 answers

Why are relational databases having scalability issues?

Recenctly I read some articles online that indicates relational databases have scaling issues and not good to use when it comes to big data. Specially in cloud computing where the data is big. But I could not find good solid reasons to why it isn't…
lahiru madhumal
  • 1,185
  • 2
  • 12
  • 30
34
votes
4 answers

Query the contents of stored procedures on SQL Server

I am exploring a legacy database system and have very little knowledge of its internals. I would like to find all the stored procedures that invoke another stored procedure A. How best to do this? Can I write something like this pseudocode: select…
Ben Aston
  • 53,718
  • 65
  • 205
  • 331
34
votes
3 answers

Postgresql delete multiple rows from multiple tables

Consider 2 or more tables: users (id, firstname, lastname) orders (orderid, userid, orderdate, total) I wish to delete all users and their orders that match first name 'Sam'. In mysql, I usually do left join. In this example userid is unknown to…
fawzib
  • 774
  • 2
  • 9
  • 23
33
votes
1 answer

SQL semantics for "FOR UPDATE" & "JOIN"

I'd like to understand the exact semantics of using "FOR UPDATE" in connection with "JOIN". Does it just lock all the rows that were effectively used to build the end result? Does it do something else? From this…
julx
  • 8,694
  • 6
  • 47
  • 86
33
votes
10 answers

Is MongoDB a valid alternative to relational db + lucene?

On a new project I need a hard use of lucene for a searcher implementation. This searcher will be a very important (and big) piece of the project. Is valid or convenient replacing Relational Database + Lucene with MongoDb? edit: Ok, I will clarify:…
Hugo
  • 2,139
  • 4
  • 22
  • 30
32
votes
3 answers

Can one make a relational database using MongoDB?

I am going to make a student management system using MongoDB. I will have one table for students and another for attendance records. Can I have a key in the attendance table to reach the students table, as pictured below? How?
İlker Dağlı
  • 1,593
  • 3
  • 13
  • 10
32
votes
2 answers

Decomposing a relation into BCNF

I'm having trouble establishing when a relation is in Boyce-Codd Normal Form and how to decompose it info BCNF if it is not. Given this example: R(A, C, B, D, E) with functional dependencies: A -> B, C -> D How do I go about decomposing it? The…
raphnguyen
  • 3,565
  • 18
  • 56
  • 74