Database Systems and Structures Data Models
Data Models
- Data models are a collection of conceptual tools for describing data, data relationships, data semantics and data constraints. There are three different groups:
- Object-based Logical Models.
- Record-based Logical Models.
- Physical Data Models.
We’ll look at them in more detail now.
Object-based Logical Models
- Object-based logical models:
- Describe data at the conceptual and view levels.
- Provide fairly flexible structuring capabilities.
- Allow one to specify data constraints explicitly.
- Over 30 such models, including
- Entity-relationship model.
- Object-oriented model.
- Binary model.
- Semantic data model.
- Infological model.
- Functional data model.
- At this point, we’ll take a closer look at the entity-relationship (E-R) and object-oriented models.
The E-R Model
- The entity-relationship model is based on a perception of the world as consisting of a collection of basic objects (entities) and relationships among these objects.
- An entity is a distinguishable object that exists.
- Each entity has associated with it a set of attributes describing it.
- E.g. number and balance for an account entity.
- A relationship is an association among several entities.
- e.g. A cust_acct relationship associates a customer with each account he or she has.
- The set of all entities or relationships of the same type is called the entity set or relationship set.
- Another essential element of the E-R diagram is the mapping cardinalities, which express the number of entities to which another entity can be associated via a relationship set.
We’ll see later how well this model works to describe real world situations.
- The overall logical structure of a database can be expressed graphically by an E-R diagram:
- rectangles: represent entity sets.
- ellipses: represent attributes.
- diamonds: represent relationships among entity sets.
- lines: link attributes to entity sets and entity sets to relationships.
The Object-Oriented Model
- The object-oriented model is based on a collection of objects, like the E-R model.
- An object contains values stored in instance variables within the object.
- Unlike the record-oriented models, these values are themselves objects.
- Thus objects contain objects to an arbitrarily deep level of nesting.
- An object also contains bodies of code that operate on the the object.
- These bodies of code are called methods.
- Objects that contain the same types of values and the same methods are grouped into classes.
- A class may be viewed as a type definition for objects.
- Analogy: the programming language concept of an abstract data type.
- The only way in which one object can access the data of another object is by invoking the method of that other object.
- This is called sending a message to the object.
- Internal parts of the object, the instance variables and method code, are not visible externally.
- Result is two levels of data abstraction.
For example, consider an object representing a bank account.
- The object contains instance variables number and balance.
- The object contains a method pay-interest which adds interest to the balance.
- Under most data models, changing the interest rate entails changing code in application programs.
- In the object-oriented model, this only entails a change within the pay-interest method.
- Unlike entities in the E-R model, each object has its own unique identity, independent of the values it contains:
- Two objects containing the same values are distinct.
- Distinction is created and maintained in physical level by assigning distinct object identifiers.
Record-based Logical Models
- Record-based logical models:
- Also describe data at the conceptual and view levels.
- Unlike object-oriented models, are used to
- Specify overall logical structure of the database, and
- Provide a higher-level description of the implementation.
- Named so because the database is structured in fixed-format records of several types.
- Each record type defines a fixed number of fields, or attributes.
- Each field is usually of a fixed length (this simplifies the implementation).
- Record-based models do not include a mechanism for direct representation of code in the database.
- Separate languages associated with the model are used to express database queries and updates.
- The three most widely-accepted models are the relational, network, and hierarchical.
- This course will concentrate on the relational model.
- The network and hierarchical models are covered in appendices in the text.
The Relational Model
- Data and relationships are represented by a collection of tables.
- Each table has a number of columns with unique names, e.g. customer, account.
The Network Model
- Data are represented by collections of records.
- Relationships among data are represented by links.
- Organization is that of an arbitrary graph.
The Hierarchical
- Similar to the network model.
- Organization of the records is as a collection of trees, rather than arbitrary graphs.
Physical Data Models
- Are used to describe data at the lowest level.
- Very few models, e.g.
- Unifying model.
- Frame memory.
- We will not cover physical models.




This is default description text on Padangan Themes, of course you can change this text via you profile administration.