120 likes | 273 Views
P04. CS4221 Project . Implement Bernstein’s algorithm. He Jingxiao ( A0087637N ) LeNhat Minh ( A0074403N ) Wang Zihao ( A0073222U ) Wu Shitong ( A0070050B ). Why do we need a CASE tool ?. Fast way to extract relations schema based on given functional dependencies.
E N D
P04 CS4221 Project Implement Bernstein’s algorithm He Jingxiao ( A0087637N) LeNhat Minh ( A0074403N ) Wang Zihao ( A0073222U ) Wu Shitong ( A0070050B )
Why do we need a CASE tool ? • Fast way to extract relations schema based on given functional dependencies. • Display the results of each decompose step.
Front-end • GUI & API • Server : http://54.251.192.210/index.php/bernstein/ • Language : PHP, JavaScript, html
Input • Users input functional dependencies.
Back-end • Perform normalization and synthesizing to 3rd normal form following Bernstein's algorithm: • Step 1: Eliminate extraneous attributes. • Step 2: Finding covering. • Step 3: Partition. • Step 4: Merge equivalent keys. • Step 5: Eliminate transitive dependencies • Step 6: Construct relations. • Language used : Java
Back-end ( Enhancements in Bernstein’s algorithm) • Shortcoming 1: Bernstein’s algorithm does not guarantee reconstructibility (or losslessness). Output of example 3:
High level logic to add new relation with key and loss attributes • 1. Find all the attributes from the previous relations • 2. Compare the attributes from last step with the original full attributes to retrieve the loss attributes • 3. Create a new Relation with any key and loss attributes
Back-end ( Enhancements in Bernstein’s algorithm) • Shortcoming 2: Bernstein's algorithm does not always find all the keys
High level logic to find all the keys • Find all the attributes • Get every combination of attributes • Check if the closure of the combination is all the attributes • Retain only keys
Result Results are then fed back to the frond end