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 > Relational Algebra question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-03-12, 18:22
adohertyd adohertyd is offline
Registered User
 
Join Date: Oct 2011
Posts: 10
Relational Algebra question

I am currently studying for an exam in relational algebra and have come across the following: Please note that all italic words are replacing the symbols that represent those words.

Schema:
EMPLOYEE: Number, Name, Age, Salary
SUPERVISION: Head, Employee

Find the reg numbers of the supervisors of the employees earning more than 40k

Solution:

project Head(SUPERVISION join EMPLOYEE = Number(select salary > '40k' (EMPLOYEE)))

Before I seen the solution I had come up with the following:

R = project Number (select salary > '40k' (EMPLOYEE))
project Head(Supervision join R)

Can someone tell me if my original solution would be considered correct? If not, why does it differ from the given solution? This algebra is doing my head in!
Reply With Quote
  #2 (permalink)  
Old 01-04-12, 11:44
tonkuma tonkuma is online now
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
Quote:
Find the reg numbers of the supervisors of the employees earning more than 40k
Where is the information "the supervisors of the employees"?
Reply With Quote
  #3 (permalink)  
Old 01-04-12, 11:46
adohertyd adohertyd is offline
Registered User
 
Join Date: Oct 2011
Posts: 10
Sorry the supervisors are also employees should have specified that
Reply With Quote
  #4 (permalink)  
Old 01-04-12, 11:57
tonkuma tonkuma is online now
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
Quote:
the supervisors are also employees should have specified that
Please update the following informations according to your statement.
I'm not so well at English, so I couldn't ubderstand well the phrase "should have specified that".

Quote:
Schema:
EMPLOYEE: Number, Name, Age, Salary
SUPERVISION: Head, Employee

Find the reg numbers of the supervisors of the employees earning more than 40k

Solution:

project Head(SUPERVISION join EMPLOYEE = Number(select salary > '40k' (EMPLOYEE)))

Before I seen the solution I had come up with the following:

R = project Number (select salary > '40k' (EMPLOYEE))
project Head(Supervision join R)
And, it is not clear by what condition(s) to "Supervision join R".
There is no common column.

Last edited by tonkuma; 01-04-12 at 12:04.
Reply With Quote
  #5 (permalink)  
Old 01-04-12, 12:02
adohertyd adohertyd is offline
Registered User
 
Join Date: Oct 2011
Posts: 10
Relationship Schema:

Employee: Number, Name, Age, Salary
Supervision: Supervisor Number, Employee Number

Is this better?
Reply With Quote
Reply

Tags
relational algebra

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