19
Relational Database Schema Designer: CASE tool ching Aid for Bernstein’s Algorithm 02 April 2015 CS4221 project presentation - by Group 03 Liu Wei Ran Lu Nan Wu Long Zhao Yue

Relational Database Schema normalizer

  • Upload
    alec

  • View
    60

  • Download
    5

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

Page 1: Relational Database Schema normalizer

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

Page 2: Relational Database Schema normalizer

Agenda

• Objective

• Bernstein’s Algorithm and its shortcomings

• Implementation

• New Features

• Future work

• Demo

Page 3: Relational Database Schema normalizer

Objective

• Implementation of enhanced Bernstein’s Algorithm

• Teaching aid with interactive user interface

Page 4: Relational Database Schema normalizer

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

Page 5: Relational Database Schema normalizer

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.

Page 6: Relational Database Schema normalizer

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.

Page 7: Relational Database Schema normalizer

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

Page 8: Relational Database Schema normalizer

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

Page 9: Relational Database Schema normalizer

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

Page 10: Relational Database Schema normalizer

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

Page 11: Relational Database Schema normalizer

Implementation

Step 5

• [contruct_relations] : Step six, construct relational schema for each groups.

• INPUT : <__final_fds_list>

• RETURN : <__relations>, all the relational schemas

Page 12: Relational Database Schema normalizer

New Features

1.Losslessness Checker

2.Superfluous Attribute Checker

3.Candidate Key Finder

Page 13: Relational Database Schema normalizer

Losslessness Checker

AB -> CD, A -> CD

Schema A C B D

['A', 'C', 'D'] 1 1 0 1

Page 14: Relational Database Schema normalizer

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’

Page 15: Relational Database Schema normalizer

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

Page 16: Relational Database Schema normalizer

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.

Page 17: Relational Database Schema normalizer

Demo

Page 18: Relational Database Schema normalizer

Q&APresentation by

Zhao YueWu Long

Liu Wei RanLu Nan

Page 19: Relational Database Schema normalizer

Thank You!Presentation by

Zhao YueWu Long

Liu Wei RanLu Nan