'What happens when you copy a database table?

This is kind of a high-level question. I am trying to join two tables and generate a report based on the results, but I only interested in some of the data in the able I am joining to.

I wasn't sure which was a better approach:

  1. Write a complicated statement with lots of WHERE conditions to filter out the data I don't want included.

or

  1. Copy the initial table and drop records I don't want included in my report before joining to the other table.

Is there an approach that is generally favored? Do copied tables maintain the relationships that the original table had to others in the database?

sql


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source