S
S
sorry_i_noob2019-07-01 20:52:19
Database
sorry_i_noob, 2019-07-01 20:52:19

Can you explain in simple terms what is the difference between an entity and a table?

I understand that a table is what is in MySQL, for example. And essence is a result of request to this table? And then not only to her, but even to several? Correctly?
I'll give you an example.
There is a books table. It contains fields: id, author_id, genre_id. The last two fields are foreign keys for the authors and genres tables, which contain the fields: id, title.
And there is the essence of the Book. It contains the following fields: id (but usually hidden), author name (authors.title), genre name (genres.title).
That is, an entity is more human-readable data that is the result of a query against the table(s)?
Therein lies the difference. I understand correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
orbit070, 2019-07-01
@sorry_i_noob

That is, an entity is more human-readable data that is the result of a query against the table(s)?
Therein lies the difference. I understand correctly?

No, you are probably confusing it with a projection (specifying the desired columns for output during a select operation).
An entity is something about which information is stored in a table.
If the table is Users, it stores information about the entity User.
If the table is Cars, it stores information about the Car entity.
Etc.
The term entity comes from here . In relational databases, information about entities is stored in tables, but there are other types of databases where information about entities is not stored in tables. That is, an entity is something about which we store information, and in your case in mysql you store information about entities in tables.
upd: for your case, the Books table stores information on the Book entity, the Authors table stores information on the Author entity, the Genres table stores information on the Genre entity

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question