Results 1 to 5 of 5
  1. #1
    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!

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Find the reg numbers of the supervisors of the employees earning more than 40k
    Where is the information "the supervisors of the employees"?

  3. #3
    Join Date
    Oct 2011
    Posts
    10
    Sorry the supervisors are also employees should have specified that

  4. #4
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    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".

    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 13:04.

  5. #5
    Join Date
    Oct 2011
    Posts
    10
    Relationship Schema:

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

    Is this better?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •