Introduction to RDBMS : Day 1 : Chapter 1
In this chapter, you will learn to:
What is Object-Based Logical Model ?
Object-based logical model,
- Describes the data at the conceptual and view levels.
- Provide fairly enough structuring capabilities.
- Allow one to specify data constraints explicitly.
- Object based Model provides more than 30 models, including
- Entity-relationship model.
- Object-oriented model.
- Binary model.
- Functional data model.
There are various object-based models. The most widely used is the Entity-Relationship model (ER model) introduced by Peter Chen. So Now we are going to focus on this model.
Example 1 : A sample Entity-Relationship model, where
Entities: SUPPLIER, PARTS
Relationship: SHIP (or SHIPMENT)
Example 2 : A detailed Entity-Relationship model
Attributes of Customer (Entity): Customer ID, Name,Street,City
Attributes of Account (Entity): Account Number and Balance
What are Entities in Entity-Relationship model ?
- Chen defined an entity as “a thing, which can be easily identified”.
- An entity is any object, place, person, or activity about which data is recorded.
- In the diagramming technique, entities are named and represented inside a box.
- An entity type is a set of things that share common properties:
- STUDENT, COURSE, and GRADE are examples of entity type.
- An entity type is usually in uppercase.
What are the Types of Entities ?
- Dependent entity: Is an entity whose existence depends on the existence of another entity and are also called weak entities
- Independent entity: Is an entity which does not depend on any other entity for existence and are also called regular entities
Define Relationships in Entity-Relationship model ?
Chen defines a relationship as “an association among entities”. For example, the relationship between students and instructors represents the fact that an instructor teaches several students and a student is taught by several instructors. This relationship could be named TEACH.
Relationships are depicted as a diamond with the name of the relationship type.
What are Types of Relationships are available in Entity-Relationship (ER) model?
- One-to-Many (or Many-to-One)
Consider the example of a university. For one DEPARTMENT (like the department of social sciences) there can be only one department head. This is a one-to-one relationship.
One-to-Many (or Many-to-One)
A STUDENT can MAJOR in only one course, but many STUDENTs would have registered for a given MAJOR course. This is a many-to-one relationship.
A STUDENT can take many COURSEs and many STUDENTs can register for a given COURSE. This is a many-to-many relationship