Solved–Programming Assignment #2 –Solution

$30.00 $19.00

Construct relational data models for the information contained in files data1.txt, data2.txt, and data3.txt. These files contain information from a recent collection of Dungeons and Dragons games, both about the players and their character. Data1 contains the player list, Data2 contains the class-spell relationship (which classes know which spells), and Data3 contains the spells by…

You’ll get a: . zip file solution

 

 

Description

5/5 – (2 votes)

Construct relational data models for the information contained in files data1.txt, data2.txt, and data3.txt. These files contain information from a recent collection of Dungeons and Dragons games, both about the players and their character. Data1 contains the player list, Data2 contains the class-spell relationship (which classes know which spells), and Data3 contains the spells by type. The .cpp file combined_tables.cpp listed in sample programs may be used as the basis for your final (fully joined) table. Your relational data models must be able to do the following:

  1. Insert all information from the data files into a hash table of appropriate size. When inserting, you must ensure that no duplicate entries are inserted. Only half credit (for the entire program) will be given for tables which contain duplicate entries
    1. Note that for entries to be duplicate the entire tuple must already be present in the table
    2. As in the previous assignment, if you implement a resize function, you will get +5 bonus points
  2. For the information in data1.txt, you must construct a secondary index structure for field Class.
  3. Implement the selection, projection, and join operations to solve the queries below.
    1. BONUS: If you are able to implement generic queries, such as “Who do you want to know the highest spells of?”, or “Which characters can learn spell X”, where X is specified by user input, you can receive up to 40 bonus points (less bonus points will be given for implementations that are not robust, i.e. cannot handle all kinds of generic queries).
  4. Translate the following three queries into relational algebra equations, and then output the correct solution (append the translation to the submission of the first two problems):
    1. What type(s) are the highest level spells that Jovani and William know?
    2. What are the names of the characters that can learn wish currently (at their given player level)? What characters can learn wish in general?
    3. What are the types of the highest level spells each cleric can cast?
    4. What are the names of each character that can cast the highest level Illusion spells?