Table variables and temporary tables serve the same basic purpose: to store an intermediate resultset to be used by a subsequent query. Database developers use these to break down complex joined queries that typically are not very efficient.
This means that a complex T-SQL query can be broken down into simpler T-SQL statements that store intermediate results before being used to join with other tables. Imagine a developer needs to build a query in the AdventureWorks sample database that returns the sales quota data by year for each ...