15
1 Lecture 10 Rounding Up

1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

Embed Size (px)

Citation preview

Page 1: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

1

Lecture 10

Rounding Up

Page 2: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

2

Denormalisation (controlled redundancy)

Trade offProvides quicker updatesAt the expense of retrieval

E.g have the results of calculations in tables rather than creating a query to create the result

Using the COURSE_TUTOR table instead of normalising it further

Further reading - Denormalisation - An `Optimal Database Design' Tactic (1993) Bernard W Bennetto and

Matthew C O Todd http://home.clara.net/tt-ltd/normalsn.html (abstract supplied)

Page 3: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

3

Denormalisation (controlled redundancy) Less computing resource needed

May suit the client

Can complicate the insertion and alteration of data

Three common examples1. Holding calculated value in parent table2. Holding calculated values in the same table3. Merging tables (see Dowling p65 for more detail)

Page 4: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

4

Multiple users

Single file – ok for single user

Typically database multi-user

front-end/back-end application

Page 5: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

5

An application consisting of two database files. The "back-end" database file contains the tables.

The "front-end" database file contains all other database objects (queries, forms, reports, macros, and modules) and links to the tables in the back-end database.

In Access need to convert database into MDE file

Page 6: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

6

Typically the back-end database is located on a network server, and copies of the front-end database are installed on individual users' computers.

Allows alteration to the front-end code without effecting the data

A file-server application not a client-server application

Page 7: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

7

Data Design

PurposeUse the right data type for data

elements E.g. time/date, text, numbers etc.

What operations are going to be carried out on the data?

Page 8: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

8(see handout)

Page 9: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

9

Data types

Mathematical operations?What will the number represent

a measurement a percentage

Conversion Is a conversion rate going to change

over time Format of data may also need

converted

Page 10: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

10

Data types

Time – two different forms Dates Durations

Numeric data Represent a value e.g bank balance A string of digits e.g Student

registration number

Page 11: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

11

Data Types

Text values Access limits to 255 Can use memo – but cannot index this

data typeTime represented by Date/Time

As with other data types includes ‘masks’ to assist data input

Page 12: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

12

Data Types

Logical values True or False Yes No

Not just two values also ‘Null’ Avoid by having a default value (‘British’

in Workshop) Disallow if necessary

Page 13: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

13

Data Types

‘Null’ Unknown Unspecified Not applicable Currently unknown Was specified but is no longer needed

Page 14: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

14

Data Types

‘Null’ Can’t assume all nulls are the sameNull + PriceOfEggs = NullNull is a ‘token’ that represents a

missing valueUse encoding schemes if necessary

ISO standard for gender0=Unknown, 1=Male, 2=Female, 3= Not

applicable

Page 15: 1 Lecture 10 Rounding Up. 2 Denormalisation (controlled redundancy) zTrade off zProvides quicker updates zAt the expense of retrieval yE.g have the results

15

Data encoding schemesConventions and Standards should be,

Complete Unambiguous Not error prone Expandable Consistent Convenient Verifiable Well documented

Encoding schemes aim to provide consistency through repetition which in theory should lead to less errors

Y2K issues due to historic encoding schemes