Hello, I am new to SQL and the site, thanks for taking the time to look at my post
I have been building all of my queries using the WHERE clause (which i read functions the same as an INNER JOIN) to deal with my related tables. my boss wants me to look into the functionality of the "Relationships..." option in Enterprise Manager to see if it is more efficient to use and would eliminate the need for a WHERE clause
i have created some relationships using this "Relationships..." dialogue box to test out what happens (without using WHERE in this test scenario), the output seems to remain the same except for the fact that it looks like more rows are being queried to determine which ones are related
can you help me understand what the benefit of doing Relationships through Enterprise Manager is as opposed to using WHERE clauses to join related tables?
1.Relationships are created in order to force a column to have its values derived from other related table (foreign key relationship). Basically, this means there are two tables - Parent and Child. Foreign key column in Child table can have only those values which are defined in Parent table's key column.
2.JOINs are used to retrieve data from two or more tables based on some common column
3. WHERE clause is used limit the number of rows based on some condition. It can be used to specify JOIN condition as well but that is not a preferred way.
I suggest you to purchase some good book on SQL Server (like Programming SQL Server by Rob Viera) which can clear your concepts on this. Also, you can go through SQL Server help if that suits you.
Harsh Athalye India. "The IMPOSSIBLE is often UNTRIED"