Explore BrainMass

Explore BrainMass

    Subquery vs. Join.

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Please help me with this question:
    Which is better to use, a subquery or a JOIN? Why?
    Show an example of each to support your reasoning.
    Communicate with a relational database to create tables, and query and manipulate data.
    Use normalizing and data integrity methodologies when designing a database.
    Create and manage databases and their related components.

    © BrainMass Inc. brainmass.com March 5, 2021, 12:21 am ad1c9bdddf

    Solution Preview

    ** Please see the attached file for Word formatted version of the solution **

    There are ongoing arguments among experts about the superiority of sub-query vs JOIN. Both sides have their reasons to support their position. From my point of view, there are several axis of being "better":
    - better performance
    - better readability
    - better maintainability
    - better flexibility and so on

    In JOINs RDBMS can create an execution plan that is better for our query and can predict what data should be loaded to be processed and save time, unlike the ...

    Solution Summary

    This solution compares sub-query with JOIN, and provides an example of each database system to support the assessment.