Query Optimization (trees) trees against SQL expression

Posted on 2009-02-15
Last Modified: 2012-05-06
Both these trees represent the same SQL query posed against the Student and Course database tables can you try to  Produce the SQL expression.

Question by:evry2004
    LVL 40

    Expert Comment

    What is your expected result?

    Author Comment

    SELECT DISTINCT Student-name FROM Student-no, Student, StudentGradeWHERE C.Credit-point= 3
    AND S.Student-no = SG.Student-no
    AND C.Course-no = SG.Course-no;
    LVL 40

    Accepted Solution

    Are you looking for this?

    SELECT DISTINCT S.[Student-Name]
      FROM Student S
      JOIN StudentGrade SG ON S.[Student-No] = SG.[Student-No]
      JOIN Course C ON SG.[Course-No] = C.[Course-No]
     WHERE C.[VCredit-Point] = 3

    Open in new window


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    This article describes some very basic things about SQL Server filegroups.
    Read about achieving the basic levels of HRIS security in the workplace.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now