UNIT 2 - Weebly

Download Report

Transcript UNIT 2 - Weebly

UNIT 2

System Architecture

Conti….

Conti…

Introduction

• A data model is a collection of conceptual tools for describing data, data relationships, data semantics, and consistency constraints.

• • The relational model is a lower-level model.

It uses a collection of tables to represent both data and the relationships among those data.

Benefits of Data Modeling

• Forcing on essentials • Easy of communication and understanding • • Product or process improvement Exploring alternatives

Types of Models 1. Hierarchical model 2. Network Model 3. Relational Model 4. Object Relational Model

Phases of Database Modeling

• • •

Fully characterize the data needs of database users

• Interact extensively with domain experts and users.

• outcome of this phase is a specification of user requirements.

conceptual-design phase

• Chooses a data model, and by applying the concepts of the chosen data model.

• Translates these requirements into a conceptual schema of the database.

Specification of functional requirements

• users describe the kinds of operations

Logical-design phase

• designer maps the high-level conceptual schema onto the implementation of data model

Physical-design phase

• physical features of the database are specified like file organization and the internal storage structures

The Entity-Relationship (ER) Model

• The entity-relationship (E-R) data model perceives the real world as consisting of basic objects, called entities, and relationships among these objects.

• Represents the overall logical structure of a database

Conti…

Conti…

Conti…

Generalization

Specialization

• An entity set may include subgroupings of entities that are distinct in some way from other entities in the set.

• A subset of entities within an entity set may have attributes that are not shared by all the entities in the entity set.

• Specialization is depicted by a triangle component labeled ISA. • Apply specialization repeatedly to refine a design scheme.

Aggregation

• One limitation of the E-R model is that it cannot express relationships among relationships.

• To illustrate the need for such a construct, consider the ternary relationship works-on, between a employee, branch, and job. • Aggregation is an abstraction through which relationships are treated as higher level entities.

Exercise

Draw the E-R diagram of an online bookstore.

a) List the entity sets and their primary keys.

b) Suppose the bookstore adds music cassettes and compact disks to its collection. The same music item may be present in cassette or compact disk format, with differing prices. Extend the E-R diagram to model this addition, ignoring the effect on shopping baskets.

c) Now extend the E-R diagram, using generalization, to model the case where a shopping basket may contain any combination of books, music cassettes, or compact disks.

Exercise

Consider a university database for the scheduling of classrooms for final exams. This database could be modeled as the single entity set exam, with attributes course-name, section-number, room-number, and time.Alternatively, one or more additional entity sets could be defined, along with relationship sets to replace some of the attributes of the exam entity set, as

course with attributes name, department, and c-numbersection with attributes s-number and enrollment, and dependent as a weak entity set on courseroom with attributes r-number, capacity, and building a) Show an E-R diagram illustrating the use of all three additional entity sets listed.

b) Explain what application characteristics would influence a decision to include or not to include each of the additional entity sets.