My Notes on Practical Data Modeling With C# and SQL Server

What I’ve Learned Lately

Hey how’s it going? Let’s dive into the topic of today which is data modeling! Here are some notes and thoughts I had from a course on Data Modeling with C# and SQL server.

The big thing I learned from this course was normalization.

Normalization is an approach to the database design process. The goal is to organize data in a consistent structure and to simplify entities while also removing redundancies. 

Some other terms that I learned were:

  • Entities – Essentially a class of properties
  • Properties – A single part of an entity. 
  • For example:
    • “Contact” is a class/entity that is full of properties such as “First Name”, “Last Name”.

When designing the data model, it is important to listen to the customer and try to hear their problem so as to better find the solution. 

We want to store each data point only once. So if there are multiple people in a class, for example, that share an address, we would extract that address and create it into its own entity. This way we can create relationships between the entities that will allow for more maintainable models of data. 

Example of redundant data.
Break the redundant data up in to separate entities and then create relationships with them.

Some things to keep in mind while designing the data model

  1. What kind of time-based data should be stored if any?
    1. History – Keep a start & end time.
    2. Version – Update as each new change comes with a new “Version”.
    3. Archive – Timestamp each change.
  2. Watch out for unnecessary dependencies.
    1. This could result in redundancy due to an entity having properties that it shouldn’t. 
    2. For example, if a character in a comic book is stored with an alter ego, what happens when a character doesn’t have an alter ego? Don’t force a dependency when it doesn’t have to be there. 
  3. Always keep an open mind when designing. Don’t default to something you’ve done in the past. 

Finally, I wanted to reference the final product of the course. It was designed to create a comic book collection and keep all the necessary information about it contained in an organized format. Here’s how the data model shaped up:

Final data model for the comic book project.

That’s all I got for now. I’m still digesting the new information myself and hope to use it in the next project I’m working on: The COG List!

This course can be found here: https://app.pluralsight.com/library/courses/practical-data-modeling-csharp-sql-server/table-of-contents

Why did I write this post? I wanted to do something different and take the time to remember and extract what I learn from taking courses. Most of the courses I take are through a company called Pluralsight, but I will make sure to reference where the information was from if not for people curious but for my own sake when I go back and try to find the source.