The best way to talk about database relationship is exemplifying their use, certain information often depends on another for it to exist and with that comes the need to create a way to link them. Database Relationships is just that, a way to link the data from one table to another from a certain information.

To make it easier to understand we will use a practical example, imagine categorize all products in a database. Each product must have a category. Then consider the following scenario:

Table: tbl_cat -> Fields: cod_cat, name

Table: tbl_produto -> Fields: cod_prod, cod_cat, Name, Price

Note that the field cod_cat that stores the category code is used to indicate, in the table product, that product belongs to which category. It features a one to many relationship where one category can be used for several products. If it were not possible to create relationships all table information category would have to be included in the product table and it probably would bring future problems if were necessary add more information related to the category.

As quoted above, the type of relationship used was the one to many, but there are still two other types of relationships with them one to one where there is a direct relationship between two primary keys and many to many relationship where it is possible to use multiple records and the same relationship is no possibility of repeating the table.


Understand how relationships is essential to model and optimize your database, so it is important to get all requirements and fully understand the role of each information.

By ,

September 4, 2013


You might also like…

5 reasons you can’t miss a Black Friday Scriptcase!

This November we bring you the biggest and most important discounts of the year! And do you know wh...

Taking a look at Scriptcase version 9.7

After the big Scriptcase 9.7 presentation event, we have a new version of Scriptcase for download, ...

October Newsletter

Follow the latest news for the month of October! Webinars, blog posts, videos, and more. WEB...

You might also like…

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at Learn more about our Privacy Police.