Functional Dependency Normalizer


This application is for learning about functional dependencies and learning to use them to help design relational database tables. Here I assume you know what functional dependencies are and just explain how to operate the app.

The application lets you enter a set of functional dependencies and then "normalize" them by producing the following:

If the total number of distinct attributes is small (10 or fewer) the following is also computed.

I've used desktop implementations of this application for teaching my undergraduate course on relational database concepts in the School of Computer Science at Carleton University in Ottawa. This web-based version is hopefully more accessible and platform agnostic. Please pass on any comments you might have and point out any defects you find.

Louis D. Nel
ldnel@scs.carleton.ca

 

Functional dependencies are expressed as follows:

A,B->C,D
StudentNumber->StudentName,EmailAddress

They can be interpreted either as a specification or a constraint. As a specification StudentNumber->StudentName,EmailAddress expresses the requirement that those attributes be stored in some table or tables and that StudentNumber could serve as a possible key for those attributes. As a constraint it expresses the requirement that if StudentNumber,StudentName and EmailAddress ever appear in the same table then whenever two rows match in their StudentNumber values they must also match in their StudentName and EmailAddress values. In other words functional dependencies can express both what needs to be included in a design and functional constraints that must be adhered to.

To use the application type, or paste, a set of functional dependencies into the Functional Dependency Input Area. Alternatively you can build up a functional dependency in the text field and add it by pressing the Add button or hitting the enter key. The text field is useful for building new functional dependencies out of existing attributes. In particular, if you double click an attribute in the input area it will be appended to the text field; double clicking a ">" arrow head in a dependency will append an "->" arrow to the text field. This way new functional dependencies can be easily built from existing attributes without retyping (and miss-spelling) them.

To normalize the set of dependencies press the Normalize button.

Input Parsing: Lines of text in the input area that do not contain a "->" will be treated as commentary and ignored. Anything after "//" in lines that do contain a "->" will be treated as a comment and ignored. Attributes in functional dependencies can be separated by commas or blanks (attribute names should not contain blanks). For example: A,B -> C,D or A B -> C D. The blanks will be replaced by commas during the input parsing.

Representing Entity Relationship Models with Functional Dependencies: In order to represent certain features of entity-relationship models as functional dependencies it is necessary to introduce temporary attributes. See Representing ER Models with Functional Dependencies for an explanation. In the application any right hand side attribute whose name contains "$" will be treated as such a temporary place holder and removed from the final 3rd Normal Form tables.