DATA MODELLING TOOLS FOR ORGANISING DATABASES. For a database to be organised and logical, it must be well-designed and set out. In such cases, the databases.

Post on 16-Jan-2016

217 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

DATA MODELLING TOOLS FOR

ORGANISING DATABASES

• For a database to be organised and logical, it must be well-designed and set out. In such cases, the databases are able to avoid problems like data redundancy as well as security.

• They too can verify the integrity and validity of data.

• Data modelling aims to create a description of data requirements and its participants.

• This can be done using data dictionaries, schematic diagrams and normalisation.

What are data dictionaries?• Metadata is data that describes data. This

is what data dictionaries hold. • They are responsible for storing each field

name / attribute and providing information about this field.

• They can help participants or users of the database to understand better, if the content of a field is ambiguous.

• They can also ensure consistency in regards to data across different tables.

What information can a data dictionary hold?

• Exact definition of the data elements• The allocations of space in the database• The reliability constraints

The following was based on: Wilson, C. (2002) Information Processing and Technology. Cambridge University Press: UK p . 44

Table Name Field Name

Data Type

Character Size Description Essential

Students Student_ID Number 7 This is a unique number that identifies the student. It consists of the year of enrolment and the number of student based on their grade.

Y

Surname Text 20 The last name of the student  

FirstName Text 20 The name given to the student  

Gender Text 1 Either an F (female) or M (male)  

Teachers Teacher_ID Number 7 This is a unique number that identifies the staff member. The first four are the year of employment and the last three are the teacher's number in the employment staff.

Y

Department Text 3 This is a 3 letter code for the department, such as ENG (English); SCI (Science)

 

ACTIVITY 1

Answer the following, based on what you remember from the previous slides:

Data dictionaries hold metadata; which is _________ that __________ data.

Why are data dictionaries a great help to users unfamiliar with the content of the database?

A data dictionary can ensure _______________ across different tables.

What are 4 headings used in a data dictionary?

What is Normalisation?

• Normalisation is a process carried out in relational databases with the purpose of eliminating redundancy within the database.

• The set of rules that aim to reduce this redundancy are known as Normal Forms (NF).

What do normal forms do?

• Normal forms divide the fields in the database into two or more tables and defines the relationships between the tables. This enables the overall topic or idea for each table to be unique.

• Therefore, it can be said that “each table is only made up of entities from a single entity class.” *

* Wilson, C. (2002) Information Processing and Technology: The HSC Course. Cambridge University Press: UK

2 steps of normal forms:

(1) Initial Normal Form (INF): This separates the fields into separate tables and then each table is given a primary key.

It gives more tables than would have normally been included.

Its advantage is that data in one table can be edited without affecting the content of another table.

(2) Domain Key Normal Form (DKNF): This is what establishes the links between the tables as to create relationships.

A field must be established which can be common to all of the tables and this will act as the relationship.

ACTIVITY 2

What does normalisation aim to eliminate?NF is an acronym for what? And what does it

do?INF is an acronym for which stage of the

normalisation process? What is the advantage of INF?DKNF stands for___________?Why is the above step vital?

Example: A school database

Application of the steps:

(1) INF: The data regarding teachers and students can be separated; therefore, there is one table relating to student data and another for the teaching staff. This allows student data to be changed without affecting teachers’ data in any way.

(2) DKNF: So long as INF has been correctly conducted, then there should not be any similarities between the teacher/student tables. But to establish a link, a common ground must be found – this being a field.

A field such as Name is not common between the tables due to the variety of names and unsuitability for relationships in a school database. However, Class would be a suitable and relevant field to link the two tables.

CLASS

What does normalisation allow?

No problems arise in modification of the database

Redundant data is eliminatedData can be separately edited and changed

without changing another tableDatabase uses a reduced amount of spaceLogical organisation of data

What is a schematic diagram?• This is a visual representation of the model of

the databases’ s design, used to show the relationship between entities (Remember – an entity is like a category of data).

• A type of schematic diagram is the ERD (entity relationship diagram). This shows the entity types, relationships and the characteristics of the particular relationship between the entities.

• These relationships are marked by lines that connect the entities.

ACTIVITY 3

STUDENTS

Student IDSurnameFirstNameGenderYearClassCode

TEACHERS

Teacher IDSurnameFirstNameDepartmentClassCode

CLASSES

Class IDSubjectClassCodeYearDayPeriod

Using the pen tool, draw in the relationships between the entities on the right.

• What is the relationship between student and teacher?

• What is the relationship between student and classes?

• What is the relationship between teacher and classes?

*For each, what type of relationship is it? (One-to-one; one-to-many)

ANSWERSTo view answers, right click on word and “open hyperlink”

top related