TransitionSoft: Compare quotes on comparable services and save money!
Articles
What guidelines/steps should you follow when you design a relational database?
  Databse Design Steps and Guidelines

The design of databases takes many steps and it is often critical for the rest of the project that the preliminary steps be completed in their entirety and without errors to ensure complete and correct operation of the final database implementation. Following a set of best practices ensures that the information that is used to create the database complies with the principles of the relational model. This entails identifying well established relationships between data and from this information design tables that use this information to manage and be able to extract them in many ways in the future.

A typical process of designing a database includes identification of the purpose of the database, the review of the existing database and data models if available, making a preliminary list of fields and tables that those are going to be entered into, identification of key fields and creating a draft of relationships between tables. After this sample data should be entered so the various capabilities that are expected from a typical database could be tested. After this the normalization process should be followed to ensure the created tables adhere to design standards and principles and finally the design should be finalized and reviewed for production readiness.

After this, additional queries, views, and stored procedures and reports may need to be created to support the task of information entry and retrieval from the database but often his is the responsibility of application developers and database administrators and this step may not be required.

One of the distinct advantages that databases allow for these days is the ability to describe data in a structured and organized manner. Relational databases allow for information to be related through the use of relationships among tables which act as groups of information that are closely related around a common idea or a given context. As such the relationships between tables themselves becomes important as well.

One of the advantages of working with multiple tables is in a way they can me organized and kept track of. One particularly effective set of methods referred to as Normalization allows for information organized into tables and related through primary and foreign keys to be able to seamlessly support a great deal of functionality. For example, a benefit of organizing information in many tables comes into play when one has a set of classes to assign to multiple students with multiple professors teaching a given class. If all the information was to be put into one table there would be a big table that included a lot of information that was needlessly repeated. Instead, if we were to organize the information into 3 tables (one for Students, one for Teachers, and one for Classes) then the resulting tables will be more easily maintainable and recognizable than before.

This also allows for some property called referential integrity to be enforced. Referential integrity will make sure relationships between tables will remain consistent and not become redundant and meaningless. Referential integrity in other words makes sure that there will not be an invalid entry in a given table in a database. When there is a foreign key relating different tables, a record cannot be added to that specific table that contains that foreign key unless there are similar records in the related tables in the database. For example, when using referential integrity, the rows depend on each other, so removing a row of information required that related information may have to be removed as well.

Of the disadvantages of having multiple tables is the level of complexity that is increased in how to manage and keep track of information because later on there will be a need to use SQL queries to get information from the database of update it in some way and the more tables and relationships there are then the complexity of interaction with such a database increases and tasks become more time consuming.

Example: Designing a 3NF Normalized Table

When designing tables for use in a RDBMS, on e needs to figure out what information need to be stored and how to establish relationships between them to have the final design be consistent and useful. As such, there are 3 major levels of normalization exist that can help the information become consistent and organized for use in relational databases. The following paper contains an example of how can this be done.


Data Dependency Diagram:


Grade Report Table


Student_ID

Student_ Name

Major

Course_ID

Course_Title

Instructor_Name

Instructor_Location

Grade

168300458

Williams

IT

ITD320

Database Imp

Codd

B104

A

168300458

Williams

IT

ITP310

Programming

Parsons

B317

B

543291073

Baker

Acctg

ITD320

Database Imp

Codd

B104

C

543291073

Baker

Acctg

Acct201

Fund Acctg

Miller

H310

B

543291073

Baker

Acctg

Mktg300

Intro Mktg

Bennett

B212

A

The table is in the report state and is therefore non-normalized because it contains repeating groups and other inconsistencies that need to be taken care of in order to make it a viable relational model.

Decomposition into 3NF

First Normal Form (1NF)
Data must be in table format and no repeating groups must exist to be able to:

  1. Primary key (PK) needs to be identified:
    • StudentID + Course_ID + Instructor_Name

  2. Identify Dependencies:
    • Student_ID -> Student_Name, Major
    • Course_ID->Course_Title, Instructor_Name, Instructor_Location
    • Student_ID, Course_IDèGrade

Second Normal Form (2NF)
Table must be in 1NF and no partial dependencies should exist:

  1. Separate key components
    • Student_ID
    • Course_ID
    • Student_ID + Course_ID

  2. Assign dependent attributes to each key component
    • Student_ID ( Student_Name, Major )
    • Course_ID(Course_Title, Instructor_Name, Instructor_Location)
    • Student_ID, Course_ID(Grade )

Revised Dependency Diagram

Dependency Diagram

Third Normal Form (3NF)
Table must be in 2NF and no transitive dependencies should exist:

  1. Identify new determinants
    • Instructor_Name

  2. Identify dependent attributes
    • Instructor_Name -> Instructor_Location

  3. Remove dependent attributes from transitive dependencies
    • Instructor_Name(Instructor_Location)

    Revised Dependency Diagram

 

ER Diagram:ER Diagram


Want more info? click on each section to see more information:

data management Business Consultation
 
Subscibe to our Newsletter!

Download 8 key steps tp Small Business Success!