Reading-Notes

Introduction to Databases and ERDs

This topic is important to me because I want to form databases for my application to hold data and be able to learn how to set relations.

Retrospective 11

References

Data Models

DBMS

Data Models

Steps Covered

  1. Creating the Model:
    • Defining multiple entity classes with properties representing different aspects of the data.
  2. Defining Relationships:
    • Establishing relationships between entities using navigation properties (e.g., one-to-many, many-to-many).
  3. Creating DbContext:
    • Creating a DbContext class that inherits from DbContext to represent the database context and manage interactions with the database.
  4. Seed Data:
    • Adding sample data to the database context to facilitate testing and demonstration.
  5. Using DbContext in a Controller:
    • Injecting the database context into a controller to access and manipulate data.
  6. Displaying Related Data:
    • Utilizing navigation properties to display related data in views, enhancing the user experience.

Benefits

Data Models Questions

  1. Do some research on what a Database Schema is. What is a Schema? Why do we use them? What do they look like?
  2. What are the different types of Database Keys? What is a Primary Key? What is a Foreign Key? What is a Composite Key? How are they different? When do you use 1 over the others?

Data Models Answers

  1. A schema is essentially the blueprint. We use it to define how the data is going to be structured. They usually are set with how the data is going to be for the end user.
  2. The colum or columns that contain values that uniquely identify each row in a table. A column used to link data between tables. A combination of two or more columns in a table to uniquely identify each row. Primary when you need a unique identifier. Foreign when you want to establish relationships between tables Composite when a single column isn’t enough for uniqueness.

DBMS

A DBMS stores data in such a way that it becomes easier to retrieve, manipulate, and produce information.

A modern DBMS has the following:

A typical DBMS has users with different rights and permissions who use it for different purposes.

Some users retrieve data and some back it up.

The roles can be categorized as:

DBMS Questions

  1. What are Relationships in a relational database?

    What is a 1:1 relationship? What is a Many:Many relationship? How about a 1: Many or a Many:1?

DBMS Answers

Things I want to know more about

I want to know more about setting the relationships between tables.

I want to learn how to get better with understanding when I need to connect different tables.