0% found this document useful (0 votes)
23 views

DB 03

The document discusses data models and their basic building blocks. It describes how data models provide simple representations of complex real-world data structures. The key components of a data model are entities, attributes, relationships, and constraints. Different types of relationships include one-to-one, one-to-many, and many-to-many. The document also introduces relational databases and the entity-relationship model as common techniques for data modeling.

Uploaded by

yangkunbao666
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

DB 03

The document discusses data models and their basic building blocks. It describes how data models provide simple representations of complex real-world data structures. The key components of a data model are entities, attributes, relationships, and constraints. Different types of relationships include one-to-one, one-to-many, and many-to-many. The document also introduces relational databases and the entity-relationship model as common techniques for data modeling.

Uploaded by

yangkunbao666
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Data Models

• Data model basic building blocks


• Introduction to models

Database Management –
COMP3140
Billy Yu

1
Data Model?
• https://www.youtube.com/watch?v=4qFZ-5i4GS8

Model - Abstraction of a real-world object


or event
Data models
• Simple representations of complex real-
world data structures
– Useful for supporting a specific problem
domain
– A representation, usually graphic,
– used in the database design phase
2
Data Modeling and Data
Models
• Data modeling
• Always an iterative and progressive process
• The process of creating a specific data model for a
determined problem domain.
– Business example:
• https://www.youtube.com/watch?v=KA4rRnihLII

3
Data Model Basic Building Blocks
• Entity: Unique and distinct object used to
collect and store data
– A person, place, thing, concept, or event for
which data can be stored.
• Attribute: Characteristic of an entity
• Relationship: Describes an association
among entities
• One-to-many (1:M)
• Many-to-many (M:N or M:M)
• One-to-one (1:1)
• Constraint: Set of rules to ensure data
integrity 4
Business rules
Get back to the real world!
• Business rules must be easy to understand
and widely disseminated to ensure that
every person in the organization shares a
common interpretation of the rules.
• They describe, in simple language, the main
and distinguishing characteristics of the
data as viewed by the company.

5
Business Rules
Brief, precise, and unambiguous
description of a policy, procedure, or
principle

Enable defining the basic building blocks

Describe main and distinguishing


characteristics of the data

6
Sources of Business Rules

Company Department
Policy makers
managers managers

Direct
Written
interviews
documentation
with end users
Example:
• A customer may generate many invoices.
• An invoice is generated by only one
customer.
• A book can have only one publisher.
• …

Video:
• https://www.youtube.com/watch?v=6xRbYXqdUUU

8
The Relational Model
• Produced an automatic transmission
database that replaced standard
transmission databases
• Based on a relation
– Relation or table: Matrix composed of
intersecting tuple and attribute
• Tuple: Rows
• Attribute: Columns
• Describes a precise set of data
manipulation constructs
https://en.wikipedia.org/wiki/Relation_(database)
9
Relational Database
Management System (RDBMS)

• Performs basic functions provided by


the hierarchical and network DBMS
systems
• Makes the relational data model easier
to understand and implement
• Hides the complexities of the relational
model from the user
10
Figure 2.2 - A Relational
Diagram

11
SQL-Based Relational
Database Application
• End-user interface
– Allows end user to interact with the data
• Collection of tables stored in the
database
– Each table is independent from another
– Rows in different tables are related based
on common values in common attributes
• SQL engine
– Executes all queries
12
Relational Model
Advantages Disadvantages
• Structural independence • Requires substantial
is promoted using
independent tables hardware and system
• Tabular view improves software overhead
conceptual simplicity • Conceptual simplicity
• Ad hoc query capability is gives untrained people
based on SQL the tools to use a good
• Isolates the end user system poorly
from physical-level details
• Improves implementation
• May promote
and management simplicity information problems
• More on a separate chapter
13
The Entity Relationship Model
• Graphical representation of entities and
their relationships in a database structure
• Entity relationship diagram (ERD)
– Uses graphic representations to model
database components
• Entity instance or entity occurrence
– Rows in the relational table
• Connectivity: Term used to label the
relationship types

14
Figure 2.3 - The ER Model
Notations

15
More example

https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model
16
Figure 2.4 - A Comparison of
OO, UML and ER Models

17
Entity Relationship Model
Advantages Disadvantages
• Visual modeling yields • Limited constraint
conceptual simplicity representation
• Visual representation • Limited relationship
makes it an effective representation
communication tool • No data manipulation
• Is integrated with the language
dominant relational model • Loss of information
content occurs when
attributes are removed
from entities to avoid
crowded displays
• More on a separate chapter 18
Big Data Challenges

Volume does not allow the usage of conventional structures

Expensive

OLAP tools proved inconsistent dealing with unstructured data

19
Big Data New Technologies

Hadoop
Hadoop Distributed File
System (HDFS)

MapReduce NoSQL

20
NoSQL Databases
• Not based on the relational model
• Support distributed database
architectures
• Provide high scalability, high availability,
and fault tolerance
• Support large amounts of sparse data
• Geared toward performance rather than
transaction consistency
• Store data in key-value stores
21
Figure 2.5 - A Simple Key-
Value Representation

22
Figure 2.6 - The Evolution of Data
Models

23
NoSQL
Advantages Disadvantages
• High scalability, • Complex programming is
availability, and fault required
tolerance are provided • There is no relationship
• Uses low-cost support
commodity hardware • There is no transaction
• Supports Big Data integrity support
• Key-value model • In terms of data
improves storage consistency, it provides
efficiency an eventually consistent
model
24

You might also like