Hello, Readers. In my previous post, I discussed different Database models and types of database. This post aims to explain different views of data and also discusses different types of entities.
So, what is an entity in DBMS(Data Base Management System)?
An entity is simply a real world object. So, it must have a set of properties that describes it.
Logical and physical views of data
Data is stored by Oracle in tables. And that data is visible to us in two views, namely
- Logical View
- Physical View
When you see the data arranged in tables in the form of records, that is called the Logical view. It defines all the constraints that may be applied to the data. Finally, it defines tables, some views of those tables, etc.
When you traverse the File System directories to see how the data is stored on the disk in sectors, etc, that refers to the Physical View. So, physical view of data simply shows us how the records are stored and is available in a secondary storage.
However, both views are independent of each other. Even if we change the table format or view of data, it does not change the records that are stored on the disk. The record stays the same, only its structure in logical view changes. Also, if we change or upgrade the storage device, it does not impact the logical view or schema.
Entity and its classification
Finally, as mentioned above, an entity is simply any real world object that is easily identifiable. Same as in the real world, an entity has its own properties. These properties are referred to as an entities attributes. An entity can be either a strong entity or a weak entity.
Let there be a record of a student, with some properties like roll number, name and age of the student. These properties describe the student.
So, it can be said that a strong entity is where identification of primary key is easy. Whereas a weak entity is where we can not identify a key attribute.
So, coming back to the relation described above, a key property is the one which the relations depend on. The non-key attributes do the documentation of the key attribute.
A weak entity creates redundancy. As a result, information may be lost.
Thanks for reading. Comments and suggestions are welcome. You may reach me through my contact page.