The tag has no wiki summary.

learn more… | top users | synonyms

46
votes
5answers
7k views

Why can't RDBM's cluster the way NoSQL does?

One of the big plusses for nosql DBMS is that they can cluster more easily. Supposedly with NoSQL you can create hundreds of cheap machines that store different pieces of data and query it all at ...
18
votes
3answers
3k views

Why does ANSI SQL define SUM(no rows) as NULL?

The ANSI SQL standard defines (chapter 6.5, set function specification) the following behaviour for aggregate functions on empty result sets: COUNT(...) = 0 AVG(...) = NULL MIN(...) = NULL MAX(...) = ...
6
votes
1answer
1k views

Find the highest graded student, using Tuple Relational Calculus

Suppose I have a table of students, containing their ID and their grade: ----------------- | id | grade | ----------------- | 1 | 83 | | 2 | 94 | | 3 | 92 | | 4 | 78 | ...
4
votes
1answer
191 views

Symmetric self-referential many-to-many

I'm trying to model a hierarchy of categories where a category can have multiple parents ( an overlapping tree model as described in this book ) I have the following tables video_categories int ...
4
votes
1answer
123 views

Logical optimization of joins and selections

I am studying query optimization. I have read that it might be preferred to apply relational selections before a logical join operation. Is there a scenario where joining first and then applying ...
2
votes
2answers
109 views

Algebra of joins, is there ever a need to repeat a table in a series of joins?

First, I'm just asking about inner joins. And, I'm thinking self joins or reflexive joins through a join table are special cases which depend on how the data is structured (e.g. city - state - ...
2
votes
1answer
99 views

How to select nodes where all children is satisfied?

I have a tree structure of light bulbs. I want to turn on all the light bulbs starting from the leafs of the tree. A light bulb cannot be turned on unless all its immediate children are turned on. ...
2
votes
2answers
2k views

How does ORDER BY really work? [duplicate]

I have one question that confusing me. By logical query processing, the SELECT clause comes before the ORDER BY clause, and in theory, every step in a query creates a virtual table. So, how is it ...
2
votes
1answer
3k views

Check if relation is in BCNF

I have the following relation and function dependencies. R = ABCDE F: C->AB, D->A, BE->CE, E->B I have to check whether this relation is in BCNF. Wikipedia states: ...if and only ...
2
votes
1answer
99 views

What is the difference between a union and an “isa” disjoint relationship?

To me, it seems that a union and an "isa" disjoint relationship are the same. What is the difference between the two?
2
votes
2answers
155 views

What do you call a relationship between two entities without a foreign key?

Let's say I have two tables that are related in that one table contains a field that is a key to the other table. In other words, it would be a 1:1 or 1:* depending on constraints. Let's call it an ...
2
votes
0answers
354 views

Transform XPath map into XML document using relational data [closed]

Background Most modern databases have XML functions that can be used to extract data in an XML format. I want to avoid the task of manually calling XML functions to extract the data. This problem ...
2
votes
1answer
268 views

Configuration options for relational algebra evaluator “ra.jar”

I am participating in the Stanford Database Class, and there are some problem sets to be solved in "mathy" relational algebra syntax. The course instructors demand from students to use this ...
1
vote
1answer
64 views

Relational Algebra Queries - How to Approach Problems?

I have the following schema: employee(sin, emp_name, emp_address, salary, supervisor_sin, dept#) works_on(emp_sin, project_number, hours) The question is: Assume that no employee works on more ...
1
vote
1answer
1k views

Is this partial dependency?

I have this relation: R = ABCDE F: AB->DE, AC->B, DE->C, AE->C, C->AB. Is AC->B a partial dependency in F? I'm guessing it is, because C->AB can be decomposed to C->A C->B ...
1
vote
1answer
119 views

An example of a relation without any functional dependency?

I have to find a really bad example where you cannot apply Heaths Theorem because of a missing functional dependency. But am I right, that every relation has at least one functional dependency? Or ...
1
vote
1answer
270 views

3NF Decomposition - I'm not sure about this example

I am trying to make sense of an example of 3NF decomposition using the 4-step algorithm mentioned by Ullman here, but I'm not understanding what my lecturer is doing with the last step (or, worse, I'm ...
1
vote
1answer
45 views

Is this table in third normal form?

I have a table L(A, B, C). Functional dependencies are: A->B, A->C, B->A, B->C. Is this table in 3nf? My thoughts: A and B are keys of this table. Table is in 3nf if there are no transitive ...
1
vote
1answer
71 views

Estimating a Size of Joining a Relation with itself

I'm studying size estimation of logical query plans in order to select a physical query plan. I was wondering what is the size of joining (natural join) a relation to itself? e.g R(a,b) JOIN R(a,b)
1
vote
1answer
198 views

Separating tables vs having one table

At the moment I have a table setup that looks somewhat like this: create table tbl_locationcollections ( id int(11) PRIMARY KEY IDENTITY, --(Primary Key), name varchar(100) not null, ...
1
vote
1answer
166 views

Approach to Analyzing Database Requirements

When presented with requirements for a database driven system, I always find it useful to imagine a world with no computers, where data records were kept in filing cabinets and data was collected by ...
1
vote
0answers
26 views

In terms of relational databases is a Relvar the equivalent to a Schema?

I've been reading up on relational databases and the term Relvar and schema keeps coming up. From my understanding: A relvar is a variable holding a relation. A schema is a logical definition of a ...
1
vote
0answers
33 views

Keys of a relation

I got relation: R = { (ABCDEF) , (A B F -> C, B C -> F, F -> A, F -> B, D E -> E, E -> D)} keys of this relation are: {BCE}, {EF} But i dont get it... why? Why not only {EF}.. it got less ...
1
vote
0answers
299 views

Closure of attributes definition clarification

A databases book I am using states [1]: The closure of {A1, A2, ..., An} under the FD's in S is the set of attributes B such that every relation that satisfies all the FD's in set S also satisfies ...
1
vote
1answer
119 views

Relation candidate keys

I have the following relation: R = ABCDE F: AB->DE, AC->B, DE->C, AE->C, C->AB I need to determine this relations candidate keys. Now, if I understood the defintion correctly: ...
0
votes
1answer
86 views

autonumber and one-to-many relationship

I have a main table with an autonumber key. I need to introduce a new table, related to the main table in a one-to-many relationship (i.e. a record in the main table could conceivably link to several ...
0
votes
1answer
423 views

Event Management System

I'm working on a "Event Management System" Online Software Project where the system requires the following: Viewers can sign up for their user account Events can be created by the admin from the ...
0
votes
1answer
39 views

Referencing a Join table

I have a relationship that I am trying to represent in a database. Imagine I have series of many to many relationships... Say student to proffesor, and professor to classes... A student can many ...
0
votes
3answers
111 views

Column partially determining accepted values of another column, should be somehow normalized?

I have a table that describes a set of properties (yes it's metadata, in this case there's a valid reason to have it in the database); among other things I tell the type of the data that can be ...
0
votes
0answers
12 views

expressing constraints in relational algebra

I need to express this constrain in relational algebra: I have some table with one column with all possible values: ALL_VAL and table with some values from ALL_VAL that not mach some rule: ...
0
votes
1answer
33 views

Database relationship refresher

All, After several years of programming applications, I'm looking to refresh my understanding of databases. What I knew to begin with was fairly basic, and honestly, it's disappeared over time. I ...
0
votes
0answers
82 views

MySQL Associative Weak Entity

I'm working on a project in MySQL that has a table of users who have favorite foods. Favorites is an associative entity between Users and Foods. I want the Favorites table to be a week entity of the ...
-1
votes
1answer
45 views

Relation that combines entries with their subsequent entries, in order of date

I need to come up with a query that can do the following: I have a table with a bunch of transaction records, whose attributes are not important, other than the attribute Date. I need to come up ...
-1
votes
1answer
178 views

What is the real-world purpose of an optional 1:1 relationship?

I know that one-to-one relationships can be used to split data into multiple tables for performance or security and that it is used to create a is-a-relationsship. But aside from that things, what is ...