If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Need help with my HW on Database Management Course

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-27-11, 14:15
Tuy Tuy is offline
Registered 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 theta-join 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,
Reply With Quote
  #2 (permalink)  
Old 07-27-11, 19:57
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
I'm guessing it is indeed in your textbook and you may simply not know where to find it.


What textbook is it?
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
  #3 (permalink)  
Old 07-28-11, 11:36
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
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!

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #4 (permalink)  
Old 07-28-11, 14:47
Tuy Tuy is offline
Registered 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.
Reply With Quote
  #5 (permalink)  
Old 08-04-11, 04:55
dbGuyo dbGuyo is offline
Registered User
 
Join Date: Jul 2011
Posts: 9
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On