Docsity

Data Modeling and Database Management Systems: Building Blocks and Evolution, Lecture notes of Database Programming

Partial preview of the text

Download Data Modeling and Database Management Systems: Building Blocks and Evolution and more Lecture notes Database Programming in PDF only on Docsity!

Data Models / Chapter

DATABASE MANAGEMENT

SYSTEM

Asma Irfan Department of Computer Science Bahria University (Karachi Campus) [email protected] https://sites.google.com/site/asmair fanbukc

Objective

s

Data Modeling and Data

Models

Importance of Data Models

Building Blocks of Data Model

Business Rules

Evolution of Data Models

2

Importance of Data

Models

Facilitate interaction among designer, application

programmer and the end-user. (communication

tool)

Improved understanding of the organization for

which the database design is developed.

Without a model, data view will be different for

different levels of employees, manager, clerk,

president, application programmers and for different

departments.

When a good database blueprint is available, differences in view of data by different employees/departments do not matter anymore. 4

Basic Building Blocks of Data

Model

Entity

 (^) Anything about which data are to be collected and stored (a person, a place, a thing, or an event). Example: CUSTOMER  (^) Each entity occurrence is unique and distinct 

Attribute

 (^) A characteristic of an entity Example: customer name, customer phone number, etc. 

Relationship

 (^) Describes an association among entities For example, a relationship between customers and agents can be described as “an agent can serve many 5

Basic Building Blocks of Data

Model(contd.

 Constraint )

 (^) A restriction placed on the data  (^) Helps ensure data integrity  (^) Examples:  (^) A student’s GPA must be between 0.00 and 4.  (^) Each class must have one and only one teacher  (^) An employee’s salary must be between 6,000 and 350, 7

Business

Rules

 (^) A brief, precise and unambiguous description of a policy, procedure, or principle within a specific organization. (Note: an organization could be a business, government unit, research laboratory, university, etc. that stores and uses data to generate information)  Used in defining entities, attributes, relationships and constraints.  (^) Nouns for entities, verbs for relationships  (^) Examples:

  1. A customer may generate many invoices
  2. An invoice is generated by only one customer
  3. A training session cannot be scheduled for fewer than 10 employee or more than 30 employees Entities: CUSTOMER, INVOICE, EMPLOYEE, TRAINING 8

Evolution of Data Models

(contd.)

Hierarchical Model (1960s)

 (^) To manage large amount of data for complex manufacturing projects such as Apollo rocket that landed on the moon in 1969  (^) Logical Structure represented by an upside down tree  (^) Contains levels or segments (segment = file system’s record type)  (^) 1:M relationships Lack of ad hoc query capability 10 A C D E F H B G  (^) C is parent of G and H  (^) G and H are children of

Evolution of Data Models

(contd.)

Network

Model ^ To represent complex data relationships more

effectively than the hierarchical model  (^) To improve database performance and to impose database standards.  (^) Allowed a record to have more than one parent  (^) Lack of ad hoc query capability  (^) Generally not used today but the definitions of standard database concepts that emerged with the network model are still used by modern data 11 A C D H B E F G  (^) B and C are parents of F

Evolution of Data Models

(contd.)

Relational Model

 (^) Introduced by E. F. Codd (of IBM) in 1970  (^) Major breakthrough, a database revolution  (^) Based on mathematical concept “relation”  (^) Relation = matrix (table) consisting of tuples (rows) and attributes (columns)  (^) Tables are related through a common attribute (Fig. 2.1)  (^) Relational Database Management Systems (RDBMS)  (^) Used Relational Diagrams (Fig. 2.2)  (^) Introduced Structured Query Language (SQL) 13

Evolution of Data Models

(contd.)

14

Evolution of Data Models

(contd.)

Entity Relationship Model (ERM)

 (^) Widely accepted standard for data modeling  (^) Peter Chen introduced ER data model in 1976  (^) Graphical representation of entities and their relationships in a database structure  (^) Represented in a Entity Relationship Diagram (ERD)  (^) Entity: represented by rectangle, capital letters, singular form, each row called Entity Instance or Entity Occurrence  (^) Relationships: describes association among data (Fig. 2.3)  (^) (Will cover in more detail in coming lectures) 16

Evolution of Data Models

(contd.)

17

Evolution of Data Models

(contd.)

19

Evolution of Data Models

(contd.)

Newer Data Models: Object/Relational

and XML

 (^) Demand to support more complex data representations gave rise to Extended Relational Data Model (ERDM).  (^) ERDM gave birth to a new generation of relational databases supporting OO features.  (^) With emergence of internet as a business communication tool, Extensible Markup Language (XML) emerged as the efficient exchange of structured, semi-structured and unstructured data.  (^) To address the need of managing large amounts of unstructured data such as word-processing documents, Web pages, emails and diagrams, XML databases emerged. 20