Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
53 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
102 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 ...
0
votes
1answer
28 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
63 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
vote
1answer
40 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 ...
2
votes
2answers
102 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 - ...
4
votes
1answer
122 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 ...
0
votes
1answer
67 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
0answers
21 views

Correct way of representation in tuple relational calculus

Given the schema: Customer=(C-name,C-street,C-city) Borrower=(C-name,Loan-no) Depositor=(C-name,Account-no) and 3 relations more(not useful in this context),the tuple relational query for: "All ...
2
votes
1answer
59 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?
1
vote
0answers
31 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 ...
0
votes
0answers
49 views

Decomposition into BCNF where an attribute appears in multiple functional dependencies

I am trying to decompose my relation: R = (A, B, C, D, E) with Functional Dependencies F = {D -> BC, E -> B, A -> B, B -> D} The problem is that D appears in two dependencies and in ...
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 | ...
1
vote
1answer
112 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
52 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
votes
1answer
40 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 ...
2
votes
2answers
132 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 ...
0
votes
1answer
355 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 ...
2
votes
1answer
92 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. ...
0
votes
1answer
38 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 ...
1
vote
1answer
173 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, ...
0
votes
3answers
106 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 ...
2
votes
0answers
314 views

Transform XPath map into XML document using relational data

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
2answers
1k 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 ...
1
vote
0answers
213 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
votes
1answer
143 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 ...
1
vote
1answer
161 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 ...
43
votes
5answers
6k 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 ...
4
votes
1answer
176 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 ...
2
votes
1answer
221 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
967 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 ...
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 ...
1
vote
1answer
111 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: ...
17
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(...) = ...