Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement in C++ answer with any code of your liking to showcase your idea. Problem#6 Assume we have 2 tables Employees (ID, Name, Department) and
Implement in C++
answer with any code of your liking to showcase your idea.
Problem#6 Assume we have 2 tables Employees (ID, Name, Department) and Transactions(Sold Product, Sold By, Sold To). Sold By in Transactions is a foreign key to "ID" in Employees. We would like to join the 2 tables. Joining the 2 tables means we would like to know what each row in the Transactions table maps to in Employees table Employees Primary Key(ID) Name Department XDFSE1 Jack Electronics XDVBA2 Mary Aesthetics Transactions Sold Product Foreign Key(Sold By) Sold To TV XDFSE1 Mark Radio XDFSE1 Susan (Multiple rows in the middle / Skipped for showcase purposes) Skincare Ointment XDVBA2 Lisa Assuming the Employees table has N rows and Transactions M rows. We would like to build a list of size Mthat maps a row in Transactions to the appropriate row in Employees. In this example we can see the first 2 rows in map to row 0 and the last row to 1 (The appropriate indices in the table) 0 0 Usually this would entail doing a normal search through the records in both tables causing the complexity to be O(M * N). Can you propose a better way to know the joins? How would you store the tables accordingly and how would you do the search? Note: This doesn't require complex code. You are free to write your thoughts and suggestions and theStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started