Results 1 to 5 of 5

072711, 15:15 #1Registered User
 Join Date
 Jul 2011
 Posts
 2
Need help with my HW on Database Management Course
Hi,
I am very new to dbms and i have a HW which i don't know how to answer and it is not in my database textbook. Could anybody help and let me know where i can find something to learn them. One more thing i apologize if i posted under the wrong heading, i just thought database management might be related. Below are the questions.
Thanks in advance! Tuy
Question 1
Suppose relation R(A,B) has the tuples:
A B
1 2
3 4
5 6
and the relation S(B,C,D) has tuples:
B C D
2 4 6
4 6 8
4 7 9
Compute the thetajoin of R and S with the condition R.A < S.C AND R.B < S.D
Question 2
Suppose relation R(A,B,C) has the tuples:
A B C
1 2 3
4 2 3
4 5 6
2 5 3
1 2 6
and relation S(A,B,C) has the tuples:
A B C
2 5 3
2 5 4
4 5 6
1 2 3
Compute (R  S) [union] (S  R), often called the "symmetric difference" of R and S.
Question 3
Suppose relation R(A,B) has the tuples:
A B
1 2
3 4
5 6
and the relation S(B,C,D) has tuples:
B C D
2 4 6
4 6 8
4 7 9
Compute the outerjoin of R and S, where the condition is: R.A>S.B AND R.B=S.C.
Question 4
Suppose relation R(A,B,C) has the tuples:
A B C
1 2 3
1 2 3
4 5 6
2 5 3
1 2 6
and relation S(A,B,C) has the tuples:
A B C
2 5 3
2 5 4
4 5 6
1 2 3
Compute the bag union R [union] S,

072711, 20:57 #2Purveyor of Discontent
 Join Date
 Mar 2003
 Location
 The Bottom of The Barrel
 Posts
 6,102
I'm guessing it is indeed in your textbook and you may simply not know where to find it.
What textbook is it?

072811, 12:36 #3Resident Curmudgeon
 Join Date
 Feb 2004
 Location
 In front of the computer
 Posts
 15,579
This is a homework question that is straight from a Relational Algebra 101 class.
If you have a specific question about your homework, we'll probably help you to understand whatever piece you are missing. That is decidedly in our best interest because it helps to ensure that there will be new people to do database jobs in the future.
We will not do your homework for you. That wastes time, money, and every thing else associated with your taking the class and it not only wastes your time but your teacher's time too. This is decidedly not in our best interest since it could contribute to your passing classes while learning nothing, and then we might end up having to train you "on the job" which adds to the waste!
PatPIn theory, theory and practice are identical. In practice, theory and practice are unrelated.

072811, 15:47 #4Registered User
 Join Date
 Jul 2011
 Posts
 2
Help on finding a book
Hi Pat,
Thanks for your reply but as you can see i am only asking where i can find material to study for this, i am not a lazy student, i have a textbook and i did reply Teddy which book we are using in class and if there is any other good textbook which explains this type of questions as the current database book i have doesn't explain them.
I would appreciate you not assuming that i am asking somebody to do my HW. All i asked was where can i get more help in doing this HW. In fact with the help of wikipedia, i have been working on my HW and am getting some understanding and will keep on working on it until i get them as that's the only way i can sit for my final exam and do them.
Thks.

080411, 05:55 #5Registered User
 Join Date
 Jul 2011
 Posts
 14
Hi Tuy,
These are so simple that if you just understand the join (inner and outer), set operations on sets and bags concepts, then they would be piece of cake!
For example, to solve the last one:
The result is going to be a bag.
If you add something in a (let's say plastic) bag, it accumulates there. So, if you add some tuples in a bag, they would accumulate there.
What's Union of two relations in a bag?
Answer: Accumulating all tuples (without removing the repeated tuples)
So, the answer is obvious. Just accumulate all tuples.
Hopefully, it works for you.