Database

Published on May 2016 | Categories: Types, School Work | Downloads: 83 | Comments: 0 | Views: 487
of 55
Download PDF   Embed   Report

Database and system analisis

Comments

Content

Acknowledgement

We would like to thank Mr. Tharanaga Gunarathne for his continuous support and
guidance in the preparation of this assignment. Without his invaluable supervision,
all our efforts could have been short-sighted.
We owe quite a lot to our families who provided the chance to fulfill our career
objectives and for the support throughout our studies. We would like to dedicate
this study to them as an indication of their significance in this study as well as our
lives.
Finally, we are responsible for any errors that remain in this thesis

1|Page

Table of Contents
Acknowledgement...........................................................................................................................1
Table of Contents.............................................................................................................................2
Task 1.1............................................................................................................................................6
Different Data Models.................................................................................................................6
Data Modeling Concepts.............................................................................................................7
Advantages of hierarchical databases........................................................................................10
Disadvantage of hierarchical databases.....................................................................................11
Advantages & Disadvantages of a Relational Database Model.................................................11
Advantages and disadvantages of database network model......................................................12
Task 1.2..........................................................................................................................................14
SAITM accommodation, data mining & data warehousing. Database technologies and its
Functions....................................................................................................................................14
Data Warehouse.........................................................................................................................16
Data Warehousing Models.........................................................................................................16
Types of Data Warehouses.........................................................................................................16
What is Database Technology?..................................................................................................17
Functions of a DBMS................................................................................................................20
Task 1.3..........................................................................................................................................22
Different approaches of the database.........................................................................................22
Task 2.1..........................................................................................................................................24
Apply Data Analysis and Design Techniques............................................................................24
ER Diagram...............................................................................................................................25
Task 2.2..........................................................................................................................................26
Justification of the database design...........................................................................................26
Entities and Their Attributes......................................................................................................27
Relationships of SAITM Accommodation System....................................................................28
Task 2.3..........................................................................................................................................30
Visual Tool Which Used to Design the ERD.............................................................................31
2|Page

Interface Of the Visual Tool (E-draw Main Menu)...................................................................31
Convert ER to physical implementation....................................................................................33
Task 3.1..........................................................................................................................................36
Create Database, Table Creation with Suitable Attributes and Data Types...............................36
Task 3.2..........................................................................................................................................40
Visual Tools which use to create the database and Tables.........................................................40
Task 3.3..........................................................................................................................................42
Use of Query tool to retrieve data from the database SAITM Database...................................42
Task 4.1..........................................................................................................................................43
Identify data requirements for Deferent users...........................................................................43
Data Dictionary..........................................................................................................................46
Task 4.2..........................................................................................................................................52
Verification and Validation........................................................................................................52
Task 4.3..........................................................................................................................................54
Database Testing........................................................................................................................54
Tools used for database testing..................................................................................................55
Reference.......................................................................................................................................57

3|Page

Introduction

SAITM student Accommodation office requires a Database system to
maintain the SAITM student accommodation system
This Database should contain all student details who rent, lease rooms
on Hall of residence and Flat rooms in Flats
Students may rent a room in a hall a student flat for various period of
time.
New lease agreements are negotiated at the start of each academic year
with a minimum rental period of one semester and maximum rental
period of one year

4|Page

Task 1.1
Different Data Models
Data models have been used to design information systems for many years. These software
typically uses a relational database management system (RDBMS) based on Structured Query
Language (SQL). Logical data models are used to organize and understand information structure.
Physical data models include data types and other design details needed to generate SQL code.
The relational model is mostly used by commercial databases. Most database systems use a
vendor specific form of SQL to define the database schema

Data Modeling Concepts

The data modeling process can be described as reappearance of the following steps.



Create a data model as one or more Entity-Relation Diagrams (ERDs) and associated




dictionary.
Set presentation defaults and save your work into a project folder.
Using the tool palette, create entities and relationship connections and fill in property




dialogs.
Merge the diagrams into the dictionary to generate associated entries.
Use a dialog to fill in detailed information about entities, attributes and other SQL




elements.
Use menu commands to generate foreign keys, verify and balance the model.
Generate SQL code.

Hierarchical Model
5|Page

The hierarchical data model will organize the data in a tree structure where there is a hierarchy of
parent and child data segments. This structure implies that generally in the child data segments a
record can have repeating information. Data is a series of records, which have a set of field
values attached to it, collecting all the instances of a specific record together as a record type.
These record types will be the equivalent of tables in the relational model and the individual
records being the equivalent of rows. The hierarchical model uses the Parent Child Relationship
in order to create links between these record types. These are 1:N mapping between record types.
This is done by using trees, like set theory used in the relational model, "borrowed" from maths.
For example, an organization might store information about an employee, such as name,
employee number, department, salary; also it might store information about an employee's
children, such as name and date of birth. The employee and children data forms a hierarchy,
where the employee data represents the parent segment and the children data represents the child
segment. If an employee has three children, then there would be three child segments associated
with one employee segment. In a hierarchical database the parent-child relationship is a “one-tomany” which restricts a child segment to have only one parent segment.
Ref No 1

Ref No 2

Network Model

6|Page

The popularity of the network data model corresponds with the popularity of the hierarchical
data model. Some data were more naturally modeled with more than one parent per child.
Therefore the network model permitted the modeling of many-to-many relationships in data. In
1971 the Conference on Data Systems Languages (CODASYL) formally defined the network
model. The basic data modeling built in the network model is a set construct. A set consists of an
owner record type, a set name, and a member record type. A member record type can have a role
in more than one set; hence support the multi parent concept. An owner record type can also be a
member or owner in another set. The data model is a simple network that a link and intersection
record types (called junction records by IDMS) may exist, as well as sets between them. Thus,
the complete network of relationships is represented by several pair wise sets; in each set some
(one) record type is owner (at the tail of the network arrow) and one or more record types are
members (at the head of the relationship arrow). Usually, a set defines a 1:M relationship,
although 1:1 is permitted. The CODASYL network model is based on mathematical set theory.

Relational Model
RDBMS (relational database management system) is a database developed by E.F. Codd, based
on the relational model. This allows the definition of data structures, storage and retrieval
operations and integrity constraints. In such a database the data and relations between them are
organized in tables. A table is a collection of records and each record in a table contains the same
fields.

Properties of Relational Tables:

7|Page








Values Are Atomic
Each Row is Unique
Column Values Are of the Same Kind
The Sequence of Columns is Insignificant
The Sequence of Rows is Insignificant
Each Column Has a Unique Name

Object/Relational Model
Object/relational database management systems (ORDBMSs) add new object storage capabilities
to the relational systems at the heart of modern information systems. These new facilities
integrate management of traditional fielded data, complex objects such as time-series and
geospatial data and diverse binary media such as audio, video, images, and applets. By
encapsulating methods with data structures, an ORDBMS server can execute complex analytical
and data manipulation operations to search and transform multimedia and other complex objects.

Object-Oriented Model
Object DBMSs add database functionality to object programming languages. They bring much
more than persistent storage of programming language objects. Object DBMSs extend the
semantics of the C++, Smalltalk and Java object programming languages to provide full-featured
database programming capability, while retaining native language compatibility. A major benefit
of this approach is the alliance of the application and database development into a seamless data
model and language environment. As a result, applications require less code, use more natural
data modeling, and code bases are easier to maintain. Object developers can write complete
database applications with a modest amount of added effort.

Advantages of hierarchical databases

8|Page

A hierarchical database model consists of data arranged into a structure that looks a lot like a
family tree or company organizational chart. If you need to manage data that provides itself to
being represented as parent/child relationship, you can make use of the hierarchical database
model.
The main advantages of the hierarchical database are:
Performance: Steering among the records in a hierarchical database is very fast because
the parent/child relationships are implemented with pointers from one data record to another. The
same is true for the sideway relationships from child to child and parent to parent. Thus, after
finding the first record, the program does not have to search an index (or do a table scan) to find
the next record. Instead, the application needs only to follow one of the multiple child record
pointers, the single sibling record pointer, or the single parent record pointer to get to the "next"
record.
Ease of understanding: The organization of the database parallels a corporate
organization chart or family tree. As such, it has a familiar "feel" to even nonprogrammers.
Moreover, it easily describes relationships where A is a part of B (as the case with the order
database we discussed, where each item was a part of an order).

Disadvantage of hierarchical databases
The main disadvantage of the hierarchical database is its rigid structure. If you want to add a
field to a table, the database management system must create a new table for the larger records.
Unlike an SQL database, the hierarchical model has no ALTER TABLE command. Moreover, if
you want to add a new relationship, you will have to build a new and possibly redundant
database structure.

Advantages & Disadvantages of a Relational Database Model

9|Page

The relational database organizes data in a series of tables. Each table has its own field’s specific
to the type of data being stored. The database management system (DBMS) designed around the
relationships between tables has continued to exist more than two decades because of its
flexibility. Once the user enters data into a table and saves it in the massive database, a query will
recall the information at any time.
Data Management Advantages
Microsoft SQL Server 2008 is a popular example of a relational database. The Microsoft
Corporation updated its scalable server system to make it easier for programmers to build,
manage and question their data warehouse. Some advantages of relational databases like SQL
Server 2008 are the ability to program a query to search all data tables for the exact information
you need; the ability to scale the database to the size of a very large organization; the ability to
access, update and share information among many user stations; and advanced capabilities for
analyzing and reporting. The query language relies on formulas to tell the database what kind of
data you want to pull from tables in the system. Finally, the relational database can interface with
many third-party tools.
Data Management Disadvantages
An alternative to the relational database is a database system using an object-oriented
programming language like Java. Tech Republic's Justin James highlighted several disadvantages
of the relational database system. Database developers have a tendency to add layers to the
database for new functions and use web services to couple layers of data. The disadvantages
arise from limitations of the language. According to James, the current relational database forces
developers to reconstruct logic, to find solutions to mismatches between applications and their
database system, to retrofit or debug the existing database because of time and money already
invested and to work with a very complex system.

Advantages and disadvantages of database network model
ADVANTAGES
10 | P a g e





Provide very efficient "High-speed" retrieval
Simplicity: The network model is conceptually simple and easy to design.
Ability to handle more relationship types

The network model can handle the one-to-many and many-to-many relationships.



Ease of data access

In the network database terminology, a relationship is a set. Each set comprises of two types of
records. - An owner record and a member record. In a network model an application can access
an owner record and all the member records within a set.



Data Integrity

In a network model, no member can exist without an owner. A user must therefore first define the
owner record and then the member record. This guarantees the integrity.

Data Independence
The network model draws a clear line of segregation between programs and the complex
physical storage details. The application programs work independently of the data. Any changes
made in the data characteristics do not affect the application program.

DISADVANTAGES



System complexity

11 | P a g e

In a network model, data are accessed one record at a time. This makes it essential for the
database designers, administrators, and programmers to be familiar with the internal data
structures to gain access to the data. Therefore, a user friendly database management system
cannot be created using the network model.



Lack of Structural independence.

Making structural modifications to the database is very difficult in the network database model
as the data access method is navigational. Any changes made to the database structure require the
application programs to be modified before they can access data. Though the network model
achieves data independence, it still fails to achieve structural independence.

Task 1.2
SAITM accommodation, data mining & data warehousing. Database
technologies and its Functions
12 | P a g e

Data Mining
Data Mining is an analytic process designed to explore data (usually large amounts of data business or market related) in search of consistent patterns and/or systematic relationships
between variables, and to validate the findings by applying the detected patterns to new subsets
of data. The ultimate goal of data mining is prediction - the predictive data mining is the most
common type of data mining and one that has the most direct business applications. The process
of data mining consists of three stages: (1) the initial exploration, (2) model building or
pattern identification with validation/verification, and (3) deployment



Exploration

This stage usually starts with data preparation which may involve cleaning data, data
transformations, and selecting subsets of records and - in case of data sets with large numbers of
variables (“fields”) performing some preliminary feature selection operations to bring the
number of variables to a manageable range.



Model building and validation

This stage involves considering various models and choosing the best one based on their
predictive performance (i.e., explaining the variability in question and producing stable results
across samples). This may sound like a simple operation, but in fact, it sometimes involves a
very complex process. There are a variety of techniques developed to achieve that goal - many of
which are based on so-called "competitive evaluation of models," that is, applying different
models to the same data set and then comparing their performance to choose the best.


Deployment

The final stage involves using the model selected as best in the previous stage and applying it to
new data in order to generate predictions or estimates of the expected outcome.

13 | P a g e

Ref No 3

Data Warehouse
A data warehouse is a place where data is stored for archival, analysis and security purposes.
Usually a data warehouse is either a single computer or many computers (servers) tied together
to create one massive computer system.

Data Warehousing Models
There are many different models of data warehouses. Online Transaction Processing, which is a
data warehouse model, is built for speed and ease of use. Another type of data warehouse model
is called Online Analytical processing, which is more difficult to use and adds an extra step of
analysis within the data. Usually it requires more steps which slows the process down and
requires much more data in order to analyze certain queries.

Types of Data Warehouses
With improvements in technology, as well as innovations in using data warehousing techniques,
data warehouses have changed from Offline Operational Databases to include an Online
Integrated data warehouse.
Offline Operational Data Warehouses are data warehouses where data is usually copied and
pasted from real time data networks into an offline system where it can be used. It is usually the
simplest and less technical type of data warehouse.
Offline Data Warehouses are data warehouses that are updated frequently, daily, weekly or
monthly and that data is then stored in an integrated structure, where others can access it and
perform reporting.

14 | P a g e

Real Time Data Warehouses are data warehouses where it is updated each moment with the
influx of new data. For instance, a Real Time Data Warehouse might incorporate data from a
Point of Sales system and is updated with each sale that is made.
Integrated Data Warehouses are data warehouses that can be used for other systems to access
them for operational systems. Some Integrated Data Warehouses are used by other data
warehouses, allowing them to access them to process reports, as well as look up current data.

Ref No 4

What is Database Technology?

The essential feature of database technology is that it provides an INTERNAL Representation
(model) of the EXTERNAL world of interest. Examples are the depiction of a particular
15 | P a g e

date/time/flight/aircraft in airline reservation or of item code/item description/quantity on
hand/reorder level/reorder quantity in a stock control system.
Business in much of world depends on database technology.
Finance: The UK clearing banks have calculated that if their database systems were removed, it
would take every person in UK working 24 hours per day 7 days per week to process all the
financial transactions manually. The London stock exchange relies on computer systems for
recording, buying and selling of stock which happens very quickly and in large capacity. The
amount of money involved in these transactions is enormous.
Transport: The airlines all use online seat reservation systems and have systems for scheduling
aircraft, building and maintaining timetables, handling the in-flight catering and for mechanical
servicing of the planes. Similar systems exist for rail, sea and road transport. They all use
database technology widely.
Utilities: The major utilities (water, electricity, gas) all have generation / distribution systems
based on database technology.
Tourism: Hotel systems and local tourist attractions information and booking facilities rely on
database systems, and the major package tour operators have widespread databases for holiday
planning and booking, together with financial systems for payment and invoicing.
Education: Courses, materials and assessments all rely heavily on database technology in all
sectors of education. Increasingly the linking of database technology with hypermedia delivery
system allows courseware to be maintained up-to-date and delivered to the consumer.

Relational DBMS is the modern base technology for many business applications. It offers
flexibility and easy-to-use tools at the expense of ultimate performance. More recently relational
systems have started to extend their facilities in the directions of information retrieval, objectorientation and deductive/active systems leading to the so-called 'Extended Relational Systems'.

16 | P a g e

Information Retrieval Systems started with handling library catalogues and extended to full freetext utilising inverted index technology with a lexicon or thesaurus. Modern systems utilise some
KBS (knowledge-based systems) techniques to improve retrieval.
Object-Oriented DBMS started for engineering applications where objects are difficult, have
versions and need to be treated as a complete entity. OODBMSs share many of the OOPL
features such as identity, inheritance, late binding, overloading and overriding. OODBMSs have
found favors in engineering and office systems but have not yet been successful in traditional
application areas.
Deductive / Active DBMS have surfaced over the last 20 years and combine logic programming
technology with database technology. This allows the database itself to react to external events
and to maintain dynamically its integrity with respect to the real world.

Multimedia Database
Conventional databases can handle only text and numerical values and they provide query
functions based on string matching and comparing numerical values. Recently, multimedia
databases were developed to handle images, video and sounds. They allow users to retrieve data
17 | P a g e

by using the feature of stored images and/or sounds. For example, users can retrieve image data
of ocean views, and/or image data with mountains.
Distributed Database
While a conventional database allows distribution of retrieval terminals that are connected to the
databases with computer networks, the database itself is centralized in one place. In recent years,
so-called distributed database was developed which enables integrated searching among
independent multiple databases distributed over computer networks. This approach is very
effective because central management of very large database is idealistic today in terms of data
capacity and intellectual rights of data contents. This provides a virtually integrated large
database by combining multiple small databases.
Full-text Retrieval Database
In conventional database, "schemas" are used in defining formats of data. For example; it defines
that the name field of the material data record should be strings less than forty characters and that
its identifier field should be a decimal number with eight digits. Basically pre-defined schemas
restrict all data record formats and irregular data formats are never allowed.
The most serious problem of this "schema-based” database is that in building a large database by
using existing digital data; it costs much to adjust data format of the existing data into the
database schema. For example; today there are a large amount of digital contents described in
HTML and/or XML, however conventional databases do not provide search functions for this
semi-formatted data.

To solve this problem, full-text retrieval databases were developed. This kind of databases can
search a text data including a specific string in a large collection of non-formatted plain texts or
HTML/XML texts. The main advantage of this database is that it requires no "schema" so that
data creators do not have to adjust data according to database schema.
Ref No 5

18 | P a g e

Functions of a DBMS











Indexing
Views
Security
Integrity
Concurrency
Backup/Recovery
Design
Documentation
Update/Query

Security
Components that limit access or actions to limit potential damage to data
Limit data access to properly authorized users or programs. Protect data against unintentional or
intentional damage.
Security Approaches






Views limit access and actions
Authorization Rules identify users and restrict actions
User Defined Procedures in addition to database security functions
Encryption encode stored data
Authentication positively identify users

Integrity
Components that preserve the relationship among different related records in the database
The relationship among records in the database




Referential Integrity
Non Key Integrity
Derived Conditions

Concurrency
19 | P a g e

Preventing two users from interfering with each other when they use the same information

Backup and Recovery
Processes to confirm and repeat transactions so that database can be restored to a valid state after
a problem


Backup Copies
Master
Transaction Log



Journalization
Forward Log
Backward Log



Checkpoints

Ref No 6

Task 1.3
Different approaches of the database
Databases are typified by three-schema architecture because there are three different ways to
look at them. Each schema is important to different groups in an organization. The graphic below
illustrates this architecture and the groups most involved with each schema.

20 | P a g e

Ref No 7

Logical Schema
A database’s logical schema is its overall logical plan. This schema is developed with diagrams
that define the content of database tables and describe how the tables are linked together for data
access.
Database designers are accountable for creating the logical schema. Application developers and
database administrators may find the logical schema useful for performing certain tasks.
Logical Design
Directly related to the logical schema? In fact, the most significant end-product of logical design
is the logical schema.

Physical schema
The physical schema of a database refers to how data is stored on the computer on which it
exists. Generally (but not always), physical storage is handled by the RDBMS. Neither users nor
database designers get involved in the physical schema. Storage manipulation is a task for the
systems programmer (if the RDBMS supports storage manipulation).

21 | P a g e

Physical design
Different from the physical schema. Physical design involves tweaking a database to optimize
performance, which does involve the designer.

Ref No 8

Task 2.1
Apply Data Analysis and Design Techniques

Type Name
22 | P a g e

Aliases

Description

bigint
bigserial
bit
bit varying(n)
boolean
box
bytea
character
varying(n)
character(n)
cidr
circle
date
double precision
inet
integer
interval(p)
line
lseg
macaddr
money
numeric [ (p, s) ]
path
point
polygon
real
smallint
serial
text
time [ (p) ]
[ without time
zone ]
time [ (p) ] with
time zone

int8

timetz

time of day, including time zone

timestamp
[ (p) ]
without time
zone

timestamp

date and time

serial8
varbit(n)
bool
varchar(n)
char(n)

float8
int, int4

decimal [ (p, s) ]

float4
int2
serial4

timestamp [ (p) ] [ timestamptz
with time zone ]

ER Diagram

23 | P a g e

signed eight-byte integer
autoincrementing eight-byte integer
fixed-length bit string
variable-length bit string
logical Boolean (true/false)
rectangular box in 2D plane
binary data
variable-length character string
fixed-length character string
IP network address
circle in 2D plane
calendar date (year, month, day)
double precision floating-point number
IP host address
signed four-byte integer
general-use time span
infinite line in 2D plane (not implemented)
line segment in 2D plane
MAC address
currency amount
exact numeric with selectable precision
open and closed geometric path in 2D plane
geometric point in 2D plane
closed geometric path in 2D plane
single precision floating-point number
signed two-byte integer
auto incrementing four-byte integer
variable-length character string
time of day

date and time, including time zone

Task 2.2
Justification of the database design

24 | P a g e

To Design a better Database system Developer should understand the environment of the System
and understand the scope of this system.
Initially we should identify the Key Entities and their attributes.
Before Design the database we should scratch the ERD and identify the relationships.
Good relationships lead to an accurate, efficient database.

Key Entities and Their Attributes








Employees
Waiting Students
Student
H-Room
F-Room
Flat
Hall of Residence

Entities and Their Attributes
Employe
e
Emp no
Name
Address
Position

Waiting Student
Date of birth
Address
waiting stud no
sex
Field
Student
Field
sex
25 | P a g e

Date of birth
Address
Stud no

Hall of Residence
number
name
address
Telephone no

Flat
number
name
Address
Telephone no

F Room
Rental
Place No
Room No

H Room
Room No
Place No
Rental

Relationships of SAITM Accommodation System
26 | P a g e

Employee
M

:

:

SAITM Accommodation

1

SAITM Accommodation System has many employees

SAITM Accommodation
1

:

:

Waiting Students

M

Students have to wait till Hall and Flats get free

SAITM Accommodation
1

:

:

Students

M

SAITM Student Accommodation System has Many Students

Student
1

:

H-Room

:

1

One Hall Room can contain only one Student

H-Room
M

Student

27 | P a g e

:

Hall Residence

:

1

:

F-Room

M

:

1

Many students can stay in one F-Room

F-Room
M

:

Flat

:

1

Many F-Rooms contain in a Flat

28 | P a g e

Task 2.3
Visual Tool Which Used to Design the ERD
E- Draw
E-draw Max is a versatile graphics program, with features that make it perfect not only for
professional-looking flowcharts, organizational charts, network diagrams and business charts,
but also building plans, mind maps, workflows, fashion designs, UML diagrams, electrical
engineering diagrams, directional maps, database model diagrams
By using E-draw Application I have design the Entity Diagram, Relationships and their
attributes.

Interface Of the Visual Tool (E-draw Main Menu)

E-Draw Database ER Diagram Tools and

Navigation Bar

29 | P a g e

30 | P a g e

Convert ER to physical implementation

Employee Entity and It’s Attributes Convert into MySQL Table

31 | P a g e

F-Room Entity and It’s Attributes Convert into MySQL Table

H-room Entity and its Attributes Convert into MySQL Table

Hall of Residence Entity and its Attributes Convert into MySQL Table

32 | P a g e

Student Entity and its Attributes Convert into MySQL Table

Waiting Student Entity and its Attributes Convert into MySQL Table

33 | P a g e

Task 3.1
Create Database, Table Creation with Suitable Attributes and Data Types
Employees Entity
CREATE TABLE employee (
`emp no` int NOT NULL,
name
char(20),
address varchar(20),
position char(20),
PRIMARY KEY (`emp no`)
) ENGINE = MyISAM;

F-Room
CREATE TABLE `f room` (
`room no` int NOT NULL,
`place no` int NOT NULL,
rental int NOT NULL,
PRIMARY KEY (`room no`, `place no`)
) ENGINE = MyISAM;

34 | P a g e

Flat
CREATE TABLE flat (
`flat no`
int NOT NULL,
name
char(20),
address
varchar(20),
`telephone no` int(17),
PRIMARY KEY (`flat no`)
) ENGINE = MyISAM;

H-Room
CREATE TABLE `h room` (
`room no` int NOT NULL,
`place no` int NOT NULL,
rental int,
PRIMARY KEY (`room no`, `place no`)
) ENGINE = MyISAM;

35 | P a g e

Hall Of Residence
CREATE TABLE `hall of resident` (
number
int NOT NULL,
name
char(20),
address
varchar(20),
`telephone no` int(16),
PRIMARY KEY (number)
) ENGINE = MyISAM;

Student
CREATE TABLE student (
`stu no`
int NOT NULL,
sex
char(20),
`date of birth` datetime,
address
varchar(20),
field
char(20),
PRIMARY KEY (`stu no`)
) ENGINE = MyISAM;

36 | P a g e

Waiting Student
CREATE TABLE `waiting student` (
`date of birth` datetime NOT NULL,
address
varchar(20),
`waiting stu no` int NOT NULL,
sex
char(20),
category
char(20),
PRIMARY KEY (`waiting stu no`)
) ENGINE = MyISAM;

37 | P a g e

Task 3.2
Visual Tools which use to create the database and Tables
I have used SQLMaestro for MySQL IDE to feed data and Change Data Types after creating the
SQL tables

SQL Maestro for MySQL is the premier MySQL admin tool for MySQL database management,
control and development.
The application also provides you with a powerful set of tools to edit and execute SQL scripts,
build visual diagrams for numeric data, compose OLAP cubes
Easy installation and intuitive interface in combination with support of all the MySQL latest
features make it an unique tool for MySQL on the web or at your local desktop.

38 | P a g e

Key Features of Visual tool










Support for all the MySQL server versions from 3.23
Easy database object management
Database Designer
Data management: editing, grouping, sorting and filtering abilities
Handy SQL Editor with code folding and multi-threading
Visual Query Builder with support for sub queries and UNIONS
Working with remote MySQL servers via SSH or HTTP tunnel
Data export/import to/from the most popular formats
Powerful BLOB Viewer/Editor

Ref No 9

39 | P a g e

Task 3.3
Use of Query tool to retrieve data from the database SAITM Database

SQL coins the term query as the name for its commands. Basically, all SQL code is written in the
form of a query statement and then executed against a database. All SQL queries perform some
type of data operation such as selecting data, inserting/updating data, or creating data objects
such as SQL databases and SQL tables. Each query statement begins with a clause such as
SELECT, UPDATE, CREATE or DELETE.

Figure 1 The Selector form lets the user pick records by selecting field names, operators, and
values.

SELECT rental, Room No, Place No
FROM f room
WHERE flat no = 1, 2, 3
ORDER BY room No, Place No, Rental

40 | P a g e

Task 4.1
Identify data requirements for Deferent users
SAITM Accommodation System, Management Level Data Requirements

Before we implement this system to SAITM Accommodation System we should identify
the deferent data requirements for deferent user categories.
Management Level is the Main User group of this SAITM accommodation system.
Management level should have the full access to SAITM Accommodation System and they have
all access authority

Data Requirements
Student Details
Employee Details
Flat Details
Hall of Residence details
Waiting Students’ details
Reports




Monthly rental
Waiting Student
Invoices

SAITM Accommodation System, Data Entry Level Data Requirements
41 | P a g e

Data entry operator is a level which operates the System but they don’t have full access
authority.

Data Requirements
Student details
Employee’s details
Hall of Residence details
Flat details

But Data entry operators don’t have Access to delete Management related data.

SAITM Accommodation System, Students’ Data Requirements

Student is a key component and this level doesn’t have large data requirements.

Requirements for the Students are
Flat Details


Flat Room details

Hall Details


Hall rooms details

Student Details

Data Modeling
42 | P a g e

Data modeling is a method used to define and analyze data requirements needed to support the
Business processes of an organization and by defining the data structures and the relationships
between data elements.
Data modeling techniques are used:


To manage data as a resource (migrate, merge, data quality…)



For designing computer databases



To better cope with change, by allowing making changes into the model, that will
automatically induce changes in the database and programs

The semantic model describes the semantics of a domain. define the meaning of data within the
context of its interrelationships and constraints with other data. It is an abstraction which defines
how the stored symbols relate to the real world. Thus, the semantic model must be a true
representation of the real world. A semantic model consists of entity classes, representing kinds
of things of significance in the domain, and relationships assertions about associations between
pairs of entity classes. A semantic model specifies the kinds of facts or propositions that can be
expressed using the model. In that sense, it defines the allowed expressions in an artificial
'language' with a scope that is limited by the scope of the model

The logical model illustrates the specific entities, attributes and relationships involved in a
business function. Serves as the basis for the creation of the physical data model

The physical model represents an application and database-specific implementation of a logical
data model.

Ref No 10

Data Dictionary

43 | P a g e

Database "muditha at localhost"
Tables (8)
Views (0)
Procedures (0)
Functions (0)
Indexes (8)
Triggers (0)
Table "employee"
Engine: MyISAM
Character set: latin1
Collation: latin1_swedish_ci

Definition:
CREATE TABLE employee (
`emp no` int NOT NULL,
name char(20),
address varchar(45),
position varchar(45),
/* Keys */
PRIMARY KEY (`emp no`)
) ENGINE = MyISAM;

Table "f room"
Engine: MyISAM
44 | P a g e

Character set: latin1
Collation: latin1_swedish_ci

Definition:
CREATE TABLE `f room` (
`room no` int NOT NULL,
`place no` int NOT NULL,
rental int NOT NULL,
/* Keys */
PRIMARY KEY (`room no`, `place no`)
) ENGINE = MyISAM;

Table "flat"
Engine: MyISAM
Character set: latin1
Collation: latin1_swedish_ci

Table "h room"
Engine: MyISAM
45 | P a g e

Character set: latin1
Collation: latin1_swedish_ci

Definition:
CREATE TABLE `h room` (
`room no` int NOT NULL,
`place no` int NOT NULL,
rental int,
/* Keys */
PRIMARY KEY (`room no`, `place no`)
) ENGINE = MyISAM;

Table "hall of resident"
Engine: MyISAM
Character set: latin1
Collation: latin1_swedish_ci

Table "student"
Engine: MyISAM
Character set: latin1
46 | P a g e

Collation: latin1_swedish_ci

Definition:
CREATE TABLE student (
`stu no` int NOT NULL,
sex char(20),
`date of birth` date,
address varchar(45),
field char(45),
name varchar(45),
/* Keys */
PRIMARY KEY (`stu no`)
) ENGINE = MyISAM;

Table "waiting student"
Engine: MyISAM
Character set: latin1
47 | P a g e

Collation: latin1_swedish_ci

Definition:
CREATE TABLE `waiting student` (
`date of birth` date NOT NULL,
address varchar(45),
`waiting stu no` int NOT NULL,
sex char(20),
category varchar(45),
name varchar(45),
/* Keys */
PRIMARY KEY (`waiting stu no`)
) ENGINE = MyISAM;

Supportive software
1.

E-Draw

48 | P a g e

It’s all-in-one graphics software that makes it simple to create professional-looking flowcharts,
organizational charts, network diagrams, business presentations, building plans, mind maps,
fashion designs, UML diagrams, workflows, program structures, web design diagrams, electrical
engineering diagrams, directional maps, database diagrams

2.

MySQL Maestro

MySQL Maestro is the premier MySQL admin tool for database management, control and
development. Key features include: - easy database object management; - database designer; data management

3.

MySQL

MySQL is a relational database management system (RDBMS) that runs as a server providing
multi-user access to a number of databases.

Task 4.2
49 | P a g e

Verification and Validation
Verification
When data is transcribed from one medium to another there is always a danger that errors will be
introduced. The copy will not then be the same as the original. This is particularly true if the
transcription is being done manually as when a human operator reads a source document and
uses a keyboard to transcribe the data to a computer readable format (key to disc or key to tape
systems).
Verification is used to check that data is entered correctly and that there are no transcription
errors
If data has been copied automatically from one format to another then the computer will
automatically compare the two versions and inform the user of are any differences
If a keyboard operator has done the transcription then this type of check is impossible. In this
situation the data is re-entered by a different operator with the computer system checking for
differences as the second copy is entered. Any differences must be the result of a transcription
error by one of the two operators. In this case the transcribed versions can be checked manually
against the source document and the error corrected.
You have probably come across another example of verification when setting a new password you are usually asked to key the password in a second time to ensure that you didn't make a
keying error the first time, as it is not echoed on the screen.
The main aim of verification is to trap transcription errors – errors in transferring the source data
into the computer database

Validation
Validation is about making sure that the data entered is sensible and possible and within
reasonable bounds.
50 | P a g e

Just because the data is reasonable and possible does NOT mean that it is CORRECT.
Validation is about making sure that the data entered is within reasonable bounds and sensible
NOT correct.
Validation can be performed at almost any stage of the data processing cycle, from data
collection to final output of information.
There are many different validation techniques that can be used, some more appropriate than
others depending on the particular data item.

Ref No 11

Task 4.3
51 | P a g e

Database Testing
Database testing is a process working with data that's stored in the database. Database testing,
basically, includes the following


Data Accuracy & Validity (Field size validation) 2.Data Integrity (Check constraints,
insert, delete, update)



Database Objects (Stored Procedures, Views, Tables)



Data Migration (Import, Export)



Data Transaction Consistency and Concurrency (States & Locks) 6.Performance related
to database (Indices, number of triggers and procedures)



Security related to database - Data Accessing ( unauthorized access)

There are many aspects to the correctness of a database system, including the following:






Does the application program behave as specified?
Does the database schema correctly reflect the organization of the real world data being
modeled?
Are security and privacy protected appropriately?
Are the data in the database accurate?
Does the DBMS perform all insertions, deletions, and updates of the data correctly?

Testing of Database applications requires various tasks





Database schema parsing for extracting information.
Test database generation.
Test cases generation.
Validation of state and output of test case

Most methods for generating test databases only consider the database schema or generate
random data for a given statistical distribution. However, these generated databases are not
enough to cover many critical execution paths of the application.
52 | P a g e

It is because these generated test databases never take the embedded SQL queries of the database
application into account. As a result, there is a gap between the generated test databases and the
queries of the application during test, this leads to the fact that many queries of the application
get no results from the generated databases and thus many execution paths of the application
cannot be tested.
In order to test the critical execution paths of a database application in a meaningful way, a test
database generator that considers both the database schema and the queries of the database
application during data generation should be used

Tools used for database testing
CompuWare DevPartnerDB
Scandiasoft DBValidator
DbUnit SourceForge (also has many db schema comparator tools)
Dtm-db- stress
IBM Rational Functional Tester 6.1
Open STA
MbUnit
DBMonster is a tool that generates random test data and puts it into SQL
Database. It helps to test how an application can deal with large database.
HTDGen – It generates meaningful test databases for database applications. This database
generator considers both the database schema and the queries of the database application during
data generation.
HTTrace – It executes database applications testing efficiently, run regression tests on database
applications.
HTPar – It run tests in parallel.
Agenda – A (test) Generator for Database Applications.
Dbfill and Data factory
Genie – database generation
53 | P a g e

Ref No 13

Reference
Ref No 1

54 | P a g e

http://unixspace.com/context/databases.html

http://t3.gstatic.com/images?q=tbn:ANd9GcRLuSjzvuHfGA6QK59BpracGtQULRlPjGgVf8KVxKBwxFIWqAC&t=1

Ref No 2

Ref No 3

http://unixspace.com/context/databases.html

Ref No 4

http://www.statsoft.com/textbook/data-mining-techniques/

Ref No 5

http://www.tech-faq.com/data-warehouse.html

Ref No 6

http://www.um.u-tokyo.ac.jp/publish_db/2000dm2k/english/01/01-04.html

Ref No 7

http://www.ou.edu/class/aschwarz/Tulsa/B11DBMSFunctions.ppt

http://www.relationaldbdesign.com/relational-databasedesign/module3/images/three-schema.gif

Ref No 8

http://www.relationaldbdesign.com/relational-database-design/module3/schemaarchitecture.php

Ref No 9

Ref No 10 http://www.sqlmaestro.com/products/mysql/maestro/
Ref No 11 http://searchdatamanagement.techtarget.com/definition/data-modeling
Ref No 12 http://www.teach-

ict.com/as_a2/topics/validation_verification/verification_validation/
Ref No 13 http://www.scribd.com/doc/37424158/Database-Testing-Basic-Concepts

55 | P a g e

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close