How would you answer this equi-join question?

Using the STUDENT and TEACHER tables, show what data would be available in the joined table after execution of an SQL command that performed an equi-join, include all column headings.

Tables

How do you answer this question? I have googled around but I have yet find out how to work out the answer. I know about the basic joins, but I have never heard of equi-join.:confused:

Comments

  • paulbeattie87paulbeattie87 Posts: 1,258
    Forum Member
    ✭✭✭
    Look what the Google dragged in! http://en.wikipedia.org/wiki/Join_(SQL)#Equi-join
  • [Deleted User][Deleted User] Posts: 64
    Forum Member
    Look what the Google dragged in! http://en.wikipedia.org/wiki/Join_(SQL)#Equi-join

    I found that and understand how that works, but how do I apply that to the question? That's just shows a basic SQL version that is very easy to understand.

    Also I have no clue what so ever why I put, "I have never heard of equi-join" what I was meant to say was that I have never learned about equi-join.:o
  • GogfumbleGogfumble Posts: 22,155
    Forum Member
    ✭✭✭
    I am taking it this is some sort of uni/college work in which case surely you learnt about equi-join in lectures/labs/classes?

    Although I don't see how you could do it with the two tables you linked to as they don't have a mutual column.
  • [Deleted User][Deleted User] Posts: 64
    Forum Member
    Gogfumble wrote: »
    I am taking it this is some sort of uni/college work in which case surely you learnt about equi-join in lectures/labs/classes?

    Although I don't see how you could do it with the two tables you linked to as they don't have a mutual column.

    No it was on a exam question that I did about a week ago. I got the question wrong I know that, but I just want to know what the correct answer is.

    And no I didn't learn about equi-join in lesson and it is not in any of the notes, and the notes normally cover everything. The notes have inner join etc but not equi-join. That's another thing do you think that it right to put something in an exam that's not been covered?
  • thepuffinthepuffin Posts: 1,662
    Forum Member
    ✭✭✭
    And no I didn't learn about equi-join in lesson and it is not in any of the notes, and the notes normally cover everything. The notes have inner join etc but not equi-join. That's another thing do you think that it right to put something in an exam that's not been covered?

    If you look at the already quoted wikipedia article you'll see that the example SQL for an equi-join uses the INNER JOIN syntax. An inner join *is* and equi-join.

    I'd be raging at my lecturers if they failed to get that across and the exam relied on it though. :mad:
  • [Deleted User][Deleted User] Posts: 4,563
    Forum Member
    ✭✭✭
    No it was on a exam question that I did about a week ago. I got the question wrong I know that, but I just want to know what the correct answer is.
    The graphic showing the tables doesn't help, as it's not got a separating space delimiting the tutor# foreign keys from the telephone numbers in the student table, or the salaries from boss# in the teachers table. Your join result would show all the column headings from both tables, and under them all the rows from the students table, with the relevant row from the referenced tutors table appended onto it according to which tutor is referenced in the student's tutor# column. So:

    Columns would be: Student#, First_Name, Surname, Tel_No, Tutor#, Teacher#, First_Name, Surname, Salary, Boss#, Emplyed, Dept
    And row one would be: S1, John, Brown, 77762134, S7, S7, Anita, Patel, 45000, NULL, 23-Jan-1989, English
    Row 2 would be the details for student S2 and teacher S6, row 3 would be student S4 and teacher S7 again, and row 4 would be student S3 and teacher S6.

    Bob :)
  • [Deleted User][Deleted User] Posts: 64
    Forum Member
    bob.stone wrote: »
    The graphic showing the tables doesn't help, as it's not got a separating space delimiting the tutor# foreign keys from the telephone numbers in the student table, or the salaries from boss# in the teachers table. Your join result would show all the column headings from both tables, and under them all the rows from the students table, with the relevant row from the referenced tutors table appended onto it according to which tutor is referenced in the student's tutor# column. So:

    Columns would be: Student#, First_Name, Surname, Tel_No, Tutor#, Teacher#, First_Name, Surname, Salary, Boss#, Emplyed, Dept
    And row one would be: S1, John, Brown, 77762134, S7, S7, Anita, Patel, 45000, NULL, 23-Jan-1989, English
    Row 2 would be the details for student S2 and teacher S6, row 3 would be student S4 and teacher S7 again, and row 4 would be student S3 and teacher S6.

    Bob :)

    Thank you:)

    This question has been bugging me for ages, it now seems so easy.
Sign In or Register to comment.