Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

9/28/2017

Data and data modelling


DATABASE DESIGN • Data is the heart of a GIS; not only must the correct data
be captured, but it must be properly structured and stored
STAGES for access
• Spatial database design involves identifying the required
geographic phenomena and choosing an appropriate data
representation
Ivan Bamweyana
• The process of identifying the structure of an information
LSG 2102
system (the database) as the basis for employing
functions (statements for data retrieval) on the data is
referred to as data modelling

Spatial database design


• Identify the required geographic phenomena

• Choose an appropriate data representation

 understand the problem

 identify the processes and functions to be modelled

 determine what data are required and or available

Database Architecture Database Design – Iterative process

• DBMS are often designed • Database design traditionally focusses on the first of the
around a 3-layered triplet that must be defined: the choice of storage
architecture structures.
 Reason: rules and operations are defined in terms of the chosen
• ANSI/SPARC = American
structure, so can only be done afterwards
National Standards
• Design of rules and operations is important too! And will
Institute, Standards
Planning And Requirements affect the choice of data structure also.
 Hence iterative process
Committee

1
9/28/2017

Database Design Database Architecture


• Is a difficult, and error-prone process: early mistakes in • Many views, single conceptual,
the design fire back in later stages. logical and physical schema.
 Views describe how
• Phases are recognised to accommodate separation of
users see the data- what users see is
concerns: not necessarily the same, The idea is
that users’ views are separate to the
Design Concerns way data is physically stored
Phase  A combination of Conceptual and
logical
External Data requirements of individuals and
schemas define integrated logical
(conceptual) level groups of users
structure. Describes the data and
Logical level Integration of all external data relationships between them
requirements  Physical schema describes
Identification (possibly resolution) of data the files and indexes used. How the
redundancy data is stored in the database
Physical level Performance in time / space (collection of records)
• Overall description is the database schema

Database Architecture Conceptual, Logical and Physical Data


Models
• Frequently used in data modelling to differentiate levels of
• Data independence: upper
levels are unaffected by the abstraction versus detail in the model
lower level changes • The conceptual model is concerned with the real world
• The DBA can change
view and understanding of data;
“design” without affecting • The logical model is a generalized formal structure in the
external view; rules of information science;
• The DBA can change storage • The physical model specifies how this will be executed in
structures without affecting a particular DBMS instance.
external view; • Logical models ties the conceptual and physical data
models together!

Entity – Relationship Diagram (ERD) Entities


• Central concept of the ERD, also known as object or data
• Most common data modelling approach
object
• The foundation of conceptual data modelling
• A real world feature or phenomena (e.g. people, buildings,
• Displays entities (objects, nouns or things that the
land value, contour etc.)
business is interested in) as boxes and relationships
• An entity has a unique name, represented by rectangle
• Uses boxes for entities and lines to show the
relationships
• Independent of hardware and software
• Notation uses three main constructs
 Entity
Lecturer
 Relationship Student
 Attributes
Hall of Residence

2
9/28/2017

Attributes Conceptual Data Model


• A conceptual data model identifies the highest-level
• Particular characteristics or property of an entity
relationships between the different entities.
• Attributes are represented by oval/ellipses and are
• Features of conceptual data model include:
connected to the entity rectangle with a line
 Important entities and the relationships among them.
 Required attribute (“NOT NULL”) (must have a value and cannot be
left empty, e.g. first & last name of a person). Same as primary key  No attribute is specified.

 Optional attribute (does not require any value, therefore, it can be left  No primary key is specified.
empty, “middle name”). …

• Simple or composite 11/U • Only information shown via the conceptual data model is
• Single-valued and multi-valued the entities that describe the data and the relationships
between those entities
• Derived
• Keys

Conceptual Data Model


Logical Data Model
• A logical data model describes the data in as much detail
as possible, without regard to how they will be physically
implemented in the database.
• Features of a logical data model include:
 All entities and relationships among them
 All attributes for each entity are specified
 The primary key for each entity is specified
 Foreign keys (keys identifying the r/ship between different entities)
are specified
 Normalisation occurs at this level

Logical Data Model


Logical Data Model
• The steps for designing the logical data model are as
follows
1. Specify primary keys for all entities
2. Find the relationships between different entities
3. Find all attributes for each entity
4. Resolve many to many relationships - redundancy
5. Normalisation
• Types of relationships:
 one to one (1:1)
 one to many (1:N)
 many to many (M:N)
 Many to one (M:1)

3
9/28/2017

Logical Data Model


Comparison of Conceptual and logical
data model
Conceptual Logical
• No primary key is present • Presence of primary keys
• No attributes are specified • All attributes specified
within an entity
• Relationships are simply • Relationships between
stated not specified entities are specified

Physical Data Models


Physical data models
• Represents how the model will be built in the database
• shows all table structures, including column name, • The steps for physical data model design are as follows:
column data type, column constraints, primary key, foreign 1. Convert / entities / classes into tables.
key, and relationships between tables. 2. Convert relationships into foreign keys.
• Features of a physical data model include: 3. Convert attributes into columns.
4. Modify the physical data model based on physical constraints /
 Specification all tables and columns.
requirements.
 Foreign keys are used to identify relationships between tables.
 Denormalisation may occur based on user requirements.
• Physical considerations may cause the physical data
model to be quite different from the logical data model.
• Physical data model will be different for different RDBMS.
For example, data type for a column may be different
between MySQL and SQL Server.

Comparison of logical and physical Comparison (existence) of different features


data models within the three models
Feature Conceptual Logical Physical
• With the physical data model,
Entity Names ✓ ✓
 Entity names are now table names.
 Attributes are now column names. Entity Relationships ✓ ✓
 Data type for each column is specified.
Attributes ✓
• Remember, data types can be different Primary Keys ✓ ✓
depending on the actual DBMS being Foreign Keys ✓ ✓
used Table Names ✓

Column Names ✓

Column Data Types ✓

4
9/28/2017

Summary
• Complexity increases from conceptual to logical to physical
1. Conceptual data model - helps understand at high level
what the different entities in our data are and how they
relate to one another
2. Logical data model – helps understand the details of our
data without worrying about how they will actually
implemented
3. Physical data model – helps know exactly how to
implement our data model in the database of choice
• sometimes the conceptual data model and the logical data
model are considered as a single deliverable.
• Just like the logical and physical data model could be
presented as the same deliverable.

You might also like