What is the most efficient way to get comparison statistics for data from 2 large tables? Is it better to reply on SQL to do the comparisons or it can be equivalently efficient doing it in C# using LINQ? How to do it if we do it in C#?
For example, I have 2 oracle tables: A and B. A and B have the same columns:
- Location (string)
- category (string)
- new_model (Y/N)
- item_code (string)
A table has about 80,000 records; B table has about 20,000 records. The comparisons needed are the folowing.
For each location:
How many items in A match items in B with the condition of the same location, the same category and the same model?
How many items in A match items in B with the condition of the same location, the same category but different model?
How many items in A that are in B but at a different location?
How many items are in A but not in B?
Thank you for your help!