Upload
alec
View
60
Download
5
Tags:
Embed Size (px)
DESCRIPTION
Relational Database Schema normalizer. P03. A0078012N Gong Jianlin A0078102N Wu Xianqun. Functionality. Get 3NF Find Closure Membership Test Find Keys. User Interface. Input. To use this tool, user need to enter the function dependencies first. Get 3NF. - PowerPoint PPT Presentation
Citation preview
Relational Database Schema Designer: CASE tool Teaching Aid for Bernstein’s Algorithm
02 April 2015CS4221 project presentation - by Group 03Liu Wei RanLu NanWu LongZhao Yue
Agenda
• Objective
• Bernstein’s Algorithm and its shortcomings
• Implementation
• New Features
• Future work
• Demo
Objective
• Implementation of enhanced Bernstein’s Algorithm
• Teaching aid with interactive user interface
Bernstein’s Algorithm
• Bernstein’s Algorithm was invented by Bernstein Philip in 1976
• The algorithm consists of 6 steps
• Produce 3NF with the fewest number of relations
Bernstein’s Algorithm
Given a relational schema R and a set of functional dependencies F
Step 1: Eliminate extraneous attributes from the left side of each FD in F to produce G.
Step 2: Find a non-redundant covering of G.
Step 3: Partition G into groups such that all FDs have identical left side in each group.
Step 4: Merge equivalent keys if left sides have the bijection relation to create J.
Step 5: Eliminate transitive dependencies.
Step 6: Construct relation consisting of all the attributes appearing in each group.
Shortcomings
1. It does not guarantee losslessness.
2. It does not find all the keys.
3. It does not remove all the superfluous attributes.
4. Relations produced depends on the non-redundant covering found.
5. BCNF schema may contain superfluous attributes.
Implementation
Step 1
• [find_minimal_cover] : Step one and two, eliminate extraneous attributes and find
covering.
• INPUT : <__G>, the set of functional dependencies
• RETURN : <__H>, the minimum cover of the input functional dependencies
Implementation
Step 2
• [partition] : Step three, partition the minimum cover <__H> into groups that has
identical left sides
• INPUT : <__H>, the minimum cover
• RETURN : <__partitioned_fds_list>, all the groups of partitioned functional
dependency list
Implementation
Step 3
• [merge_keys] : Step four, merge equivalent keys.
• INPUT : <__partitioned_fds_list> and <__H>
• RETURN : <__merged_fds_list>, all merged groups of functional dependency list
Implementation
Step 4
• [eliminate_transitive_fds] : Step five, find and remove transitive dependencies for the
input.
• INPUT : <__merged_fds_list>
• RETURN : <__final_fds_list>, the finalized group of functional dependency list
Implementation
Step 5
• [contruct_relations] : Step six, construct relational schema for each groups.
• INPUT : <__final_fds_list>
• RETURN : <__relations>, all the relational schemas
New Features
1.Losslessness Checker
2.Superfluous Attribute Checker
3.Candidate Key Finder
Losslessness Checker
AB -> CD, A -> CD
Schema A C B D
['A', 'C', 'D'] 1 1 0 1
Candidate Key Finder
AD -> B, B -> C, C -> D, AB -> E, AC -> F
Left Middle Right
[‘A’] [‘B’, ‘C’, ‘D’] [‘E’, ‘F’]
‘A’, ‘AB’, ‘AC’, ‘AD’, ‘ABC’, ‘ABD’, ‘ACD’
Superfluous Attribute Checker
[superfluous_attribute_detection_algorithm] : Check whether a given attribute is a
superfluous in a relational schema.
INPUT :
<relations> : The input relational schemas
<G> : The original functional dependency list
<test_relation> : A relation that is in the input relational schemas <relations>
<test_attribute> : The attribute that need to be tested for <test_relation>
RETURN : True if the <test_attribute> is superfluous in <test_relation>, False if it is not
Future work
• UI improvement
• Solve shortcoming 4 by using superfluous attribute checker to check
every attributes in all possible covers found, to get the best relations
results.
Demo
Q&APresentation by
Zhao YueWu Long
Liu Wei RanLu Nan
Thank You!Presentation by
Zhao YueWu Long
Liu Wei RanLu Nan