Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2014
    Posts
    7

    Unanswered: The problem about SQL




    Assume a company having three relational table.
    Employee (E#, E-Name, Address, Salary)
    WorkRecord (E#, P#, Hours)
    Project (P#, P-Name)
    List all the E-Name and Salary for the employee joining project and order by salary.
    The answer is:

    SELECT E-Name, Address
    FROM Employee, WorkRecord
    WHERE Employee.E#=WorkRecord.E#
    ORDER BY Salary


    I can't understand the clauses "WHERE Employee.E#=WorkRecord.E#"
    Can everyone tell me?
    Thanks.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    This is the old style of JOIN syntax and should be avoided.

    Your query is equivalent to:
    Code:
    SELECT E-Name
         , Address
    FROM   Employee
     INNER
      JOIN WorkRecord
        ON Employee.E# = WorkRecord.E#
    ORDER
        BY Salary
    George
    Home | Blog

  3. #3
    Join Date
    Dec 2014
    Posts
    7
    Yes, I understand it.
    Thanks.

Posting Permissions

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