Standardize databases in Access - Relationships between tables

In this article, TipsMake.com will work with you to learn about Standardizing databases and an overview of relationships, data links between tables.

Standardize the database

Database Normalization is the process of organizing the columns (attributes) and tables (relations) of the relational database to be reasonable to minimize data redundancy.

This process divides data across multiple tables to improve the overall performance, integrity, and life of the database.

In short, you can understand:

  1. Standardization is the process of organizing data in a database.
  2. The process involves creating tables and establishing relationships between tables according to rules designed to protect data, making the database more flexible by eliminating inconsistencies and inconsistencies. .

For example:

Please follow the table in this example, the data here can be judged to be redundant, more likely to mistakenly type and generate inconsistencies in the input process.

IDKH
Ten
Address
TenSanPham
Soluong
Gia
Tongtien
1 Bui Thu 56 Duy Tan, Cau Giay, Hanoi Chocolate Chip 5 $ 2.00 $ 10.00 2 Tran Oanh 12 Khuat Duy Tien., Thanh Xuan Bac, Thanh Xuan, Ha Noi Choc Chip 3 $ 2.00 $ 6.00 3 Le Quyen 56 Duy Tan., Q Cau The Hanoi Chocolate Chip 5 $ 2.00 $ 10.00

To solve this problem, we need to restructure our data and divide it into multiple tables to eliminate some redundancy as shown in the following three tables.

Standardize databases in Access - Relationships between tables Picture 1
Create linked tables with fields like this

Here, we have 1 table for Customers , 1 Product table and 1 Order table.

If only splitting data into multiple tables is simple, nothing can be done because the tables are not linked, there is no way for the data of this table to be related to the other table. To make the data connection in many of these tables, you will need to add Foreign Key (Foreign Key) to the Order table .

Identify relationships between tables

Relationship between tables works by matching data in columns, usually columns of the same name, present in both tables. The primary key column in the table will provide a unique ID for each record (each row) and a foreign key in another table.

There are 3 types of relationship settings:

1-1 relationship

Relation 1-1 is the relationship between two tables that a record of table A relates only to a record of table B and vice versa.

One-to-one relationships are created when both connection fields are primary keys or have unique constraints.

This type of relationship is not common. You can use 1-1 relationship in the following cases:

  1. Divide a table into multiple columns.
  2. Isolate part of the table for security reasons.
  3. Storing data is short-lived and can be easily deleted by deleting the table.
  4. Information store only applies to a subset of the main table.

1-n relationship (one-to-many)

The 1-n relationship is the most common type of relationship. In this relationship, a record in table A can have multiple matching records in Table B, but a record in Table B has only one matching record. In table A. It can be understood, the primary key in table A can be copied multiple times in another table.

For example, the Customers and Orders table has a one-to-many relationship: each customer can place multiple orders, but each order only comes from one customer.

Relationships (many-many)

The nn relationship is the relation between two tables, a record of table A can have multiple records matching in table B and vice versa.

To create such a relationship, define the third table, called a join table, with the primary key including foreign keys from both Table A and Table B.

For example, the Customers table and the Product table have nn relationships defined by a 1-n relationship from them to the Orders table .

Previous article: Alternate Criteria in Access 2016

Next lesson: Alternate Criteria in Access 2016

4.5 ★ | 2 Vote

May be interested

  • 1-n relationship between tables in Access1-n relationship between tables in Access
    the 1-n relationship is the type of relationship in which a record in the table may have multiple matching records in another table, but a record in the second table only has one matching record in the first table.
  • Create Table (Table) in Access 2016Create Table (Table) in Access 2016
    the objects in the database depend a lot on the table, you should always start designing your database by creating all the tables.
  • Steps to export Microsoft Access data to Word documentsSteps to export Microsoft Access data to Word documents
    access provides most of the features you would expect from a relational database management system. you can create tables, forms, queries, relationships, reports, macros, modules, etc. but sometimes, you may want to export data from microsoft access to word.
  • The Microsoft Access test has the answer P5The Microsoft Access test has the answer P5
    microsoft access is specifically designed for the purpose of managing and exploiting databases for small projects that need to be deployed quickly and this is also an advanced software that all professional office staff should know. if you are a beginner of this software, the quiz below will provide you with lots of useful information for the process.
  • Introduction to tables, queries, forms, reports in AccessIntroduction to tables, queries, forms, reports in Access
    access database includes 4 objects: tables, queries, forms and reports. combining these 4 objects together can import, store, analyze and compile data the way you want.
  • What do you know about data queries?What do you know about data queries?
    query is a way to search and compile data from one or more tables. query execution is like asking a detailed question about databases. when creating a query in access, you are defining specific search conditions to find exactly the data you need. in the quiz below, go with the network administrator to learn about this topic.
  • MS Access 2003 - Lesson 39: Analyzing tablesMS Access 2003 - Lesson 39: Analyzing tables
    access includes a very powerful tool that you can use to analyze data in one or more tables.
  • MS Access 2003 - Lesson 15: Create an initial tableMS Access 2003 - Lesson 15: Create an initial table
    in this section, you are ready to create a table for the new database. in chapter 2, you used the table wizard to create tables easily. this not only shows that creating a table manually is difficult; but it is a sure way to understand the table.
  • MS Access 2003 - Lesson 12: Working with a tableMS Access 2003 - Lesson 12: Working with a table
    you have learned how to create and design tables in access. and now it's time to learn how to manipulate all tables.
  • Create data queries in Access 2016 from simple to complexCreate data queries in Access 2016 from simple to complex
    the query allows to retrieve information from one or more tables based on the search conditions you defined. in this lesson, you will learn how to create queries on a simple table and query on multiple tables in access 2016.