Why create a table in MySQL?

3

I'm learning how to work with MySQL and I'm looking at some examples of how to work with more than one table, as an example below:

Id      Nome        Faculdade_id
101     Amanda      11
102     Bianca      12
103     Carla       13
104     Daniela     12
105     Edna        11

id      Faculdade   Estado
11      UERJ        RJ
12      UESP        SP
13      UNEB        BA

The purpose of the example is to learn how to use more than one table, but struck a question, in practice what is the advantage of creating two tables instead of simply creating other columns?

In the example I put in, I imagine there is no more advantage if the tables are multiple columns and hundreds of rows, would it really be faster to use two tables instead of adding more columns?

    
asked by anonymous 03.04.2017 / 21:29

1 answer

1

When creating a second table you can divide information, imagine that you have all the relevant data to a person, about 20 metadata for example and one of those metadata refers to the faculty that that person attended, keep all information of college in the people table is not semantically correct in addition to causing the database to bring more information if no filter is applied. If there are 15 metadata referring to college the table of people can get very large and it will get more difficult to work with.

    
03.04.2017 / 21:40