Question
The purpose of this lab is to gain some experience programming with sets. One of the most common uses of sets is with databases, usually
The purpose of this lab is to gain some experience programming with sets. One of the most common uses of sets is with databases, usually implemented using SQL. Each SQL join is an operation on two sets. The following shows all of the relationships.
(INNER) JOIN: Returns records that have matching values in both tables
LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records from the right table
RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records from the left table
FULL (OUTER) JOIN: Returns all records when there is a match in either left or right table
For this lab, the goal is to implement a program in Rust using hash sets which implements each of the joins for two sets, each of which represent the primary keys for Table A or Table B. The program should be able to read the table keys from a file, or from the keyboard. The table keys may be integers, or words. For each pair of tables input, the program should output the keys that would be selected for each join. The output should be labeled using set notation: X Y, X Y, etc. A brief tutorial on working with Rust hash sets is at: https://www.tutorialspoint.com/hashset-in-rust-programmingLinks to an external site. Create at least three examples of sets of table keys of at least five per table. Submit your completed program code and your report in the standard format. For extra credit: (5 points) Implement the program to include full tables of data rather than just the keys. (5 points) Implement the program to accept other data types as keys. (10 points) Allow for the inclusion of a 3rd set and implement at least four set operations. Be sure to output the operations performed.
need a code for extra credit as well.
Step 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