1 | Ioan Tuns-HNDCSD-DAD-06/05/2014 Assignment Front Cover Sheet PART 1 – To be completed by the student Student Name Ioan Tuns Student ID Number LON291101243 Module Name (e.g.: Business Environment) Data Analysis and Design Course (e.g. HND Business ) HND in COMP & SD (Year 2, Semester A) Assignment Title Design a database for a banking institution Module Lecturer George K. Lekeas, Mohammed Awais Number of Words 3460 Assignment Due Date 06/05/2014 Submission Date 06/05/2014 First submission Resubmission (as per lecturer’s instruction) No cheating, dishonesty or plagiarism will be accepted from any learner who enrols for a qualification/course. All sources must be properly referenced using the Harvard Referencing System. Failure to properly reference any source constitutes plagiarism whereby the learner will be subject to disciplinary action, and will likely refer (fail) a unit. All assignments must be submitted in electronic format through http://moodle.lsbm.org.uk . This allows the College to check for plagiarism. PART 2 – Student declaration By submitting this work to LSBM, I confirm that I have read and understood the Dishonesty and Plagiarism Policy that is applicable to all assessments and assignments submitted by me. I also confirm further that the work submitted here is my own work, save for where indicated by proper referencing. Should I not abide by the policy and be found guilty of plagiarism by my course lecturer or any other LSBM or appointed staff member I shall be
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Assignment Front Cover SheetPART 1 – To be completed by the student
Student Name Ioan Tuns
Student ID Number LON291101243
Module Name(e.g.: Business Environment)
Data Analysis and Design
Course (e.g. HND Business ) HND in COMP & SD (Year 2, Semester A)
Assignment Title Design a database for a banking institution
Module Lecturer George K. Lekeas, Mohammed Awais
Number of Words 3460
Assignment Due Date 06/05/2014
Submission Date 06/05/2014
First submission Resubmission (as per lecturer’s instruction)
No cheating, dishonesty or plagiarism will be accepted from any learner who enrols for a qualification/course. All sources must be properly referenced using the Harvard Referencing System. Failure to properly reference any source constitutes plagiarism whereby the learner will be subject to disciplinary action, and will likely refer (fail) a unit. All assignments must be submitted in electronic format through http://moodle.lsbm.org.uk. This allows the College to check for plagiarism.
PART 2 – Student declaration
By submitting this work to LSBM, I confirm that I have read and understood the Dishonesty and Plagiarism Policy that is applicable to all assessments and assignments submitted by me. I also confirm further that the work submitted here is my own work, save for where indicated by proper referencing. Should I not abide by the policy and be found guilty of plagiarism by my course lecturer or any other LSBM or appointed staff member I shall be bound by the decision of that lecturer and/or staff member as well as the terms of the Dishonesty and Plagiarism Policy.
Please save your document in the following format before submitting through Moodle:First name- Surname–Course–Unit–Assignment-date.docE.g.: Rubin Gurung-APDMS-BO-Assignment-3 Dec 09.doc
This page must be page 1 of your assignment. Start your work on page
2 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Design database for London Student Bank
(LSB)
3 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Table of Contents0. Introduction..........................................................................................................4
1. Database Design for London Student Bank (LSB)...............................................4
a) Assumptions about system............................................................................4
b) ERD for LSB..................................................................................................6
a) LSB Database..............................................................................................41
4 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
5 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
0. Introduction
“To run a successful business, a company must have a good understanding of its
customers, its employees, market competition, product performance, and the
research of new products. … Reliable information is often based on data collected
from a business process. The type of data from a business process may include text,
charts, sound, image, and other multimedia data types.” (Chao, 2006)
1. Database Design for London Student Bank (LSB)
a) Assumptions about systemA university runs more than one course; this is why having a table called university. The same course, with the same degree, and duration can run to more than one university and can be assigned to more than one student and course details are stored in course table.
Connections between student, university, and course are made in student_details table. Has choose this option because enable the system to trace the student by university or course faster, without server overloading.
For each account, account table, must to have an account number, account_no field like primary key, account holder, provided from student_details table like foreign key, account type, standard or premium, provided by account_type table like foreign key which enable overdraft attribute and decide the interest rate, stored in interest_rate field.
In card table stores card details. Card no is stored in card_no field like primary key. Other details about card are provided by account_no, foreign key, from account table, and card holder details provided by card_holder field, foreign key, from person table because a card holder can be anyone, not just a student.
Web users are stores in web_user table. This table contain a user ID, primary key, username, current password provided by password history table via password_id, than foreign key, and card_no field, foreign key, to provide associated card no and card holder.
Password table contain on ID, primary key, password value stored in password field, setup date and time, and employee_id, foreign key to provide details about the how change the password.
To access an account each users is connect thru a session table. Here are stored the connection ID, unique for each connection, remote card details, card_no field as foreign key, details of user how intend to connect by web_user_id as foreign key,
6 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
IP’s of devices used to connect in ip field, date and time of starting connection, also session length.
The application is processed by application_file table. This table contain: value of provided services on amount field, application status, in process, accepted and rejected presented by status_id, foreign key from status table, the employee how processed the application, foreign key from employee table, the guarantor for applications, guarantor_id is an foreign key from guarantor table, kind of services what is application for, student account, loan or mortgage, provided by service_type_id which is foreign key from services_type table, student details provided by student_details_id, as well foreign key from student_details table, also each application is connected to an account by account_no from account table.
System_transaction table store all transactions initiated inside of the system. Table contain an ID field which is a primary key, transaction_nature_id field, foreign key, used to provide details about transaction like pay interest, account fee, monthly amount, loan, mortgage or card fare, transaction_type_id, foreign key, field store the kind of transactions, paying ore receiving because inside of the system can find boat of them, payment value is store on amount field, and the transactions date on date field, predecessor field, foreign key inside of table, is used in case of mortgages and loans to show up the value of contract paid to the student at the beginning, reference_id, like foreign key from application file to provide tracking of application and account_no, foreign key, to associate transaction to an account. When a transaction is initiated by system_transaction the transaction is made in behalf of LSB, showed automatically on the system.
Income table store all received transactions out of the system.
Outcome table store all sent payments out of the system.
I have considered treating mortgage and loan like an attribute to allow them easier to trace like income and outcome of account.
Has decide to split transactions on more than one table to make them easier to trace and to reduce server overloading in case of interrogation intended to create reports about transactions inside of LSB.
At this time LSB do not provide support for any kind of services like direct debit ore standing order.
7 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
b) ERD for LSB
8 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
2. Database development
All database source code can be finding in appendix.
a) Creting Table Person table syntax:
Course table syntax:
Student table syntax
create table person(
id int not null,
name varchar(40) not null,
address varchar(40) not null,
mobile_phone varchar(11) not null,
email varchar(40) not null,
primary key (id)
);
create table course(
id int not null,
type varchar(40) not null,
degree varchar(40) not null,
duration real,
start_date date not null,
end_date date not null,
primaty key (id)
);
9 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Guarantor table syntax:
create table student(
id int not null auto_increment,
student_id int not null,
university_id int not null,
course_id int not null,
primary key (id),
foreign key (student_id) references person (id),
foreign key (university_id) references university (id),
foreign key (course_id) references course (id)
);
create table guarantor(
id int not null,
person_id int not null,
primary key (id),
foreign key (person_id) references person (id)
);
10 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
b) Database structure
Table comments: account
Column Type Null Default Links to Comments MIME
account_no int(11) No
account_type_id int(11) No account_type -> id
student_details_id
int(11) No student_details -> id
11 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
interest_rate double Yes NULL
overdraft int(11) Yes NULL
Indexes
Keyname Type Unique Packed Column Cardinality Collation Null Comment
PRIMARY BTREE Yes No account_no 0 A No
account_type_account BTREE No No account_type_id 0 A No
student_details_account
BTREE No Nostudent_details_id
0 A No
Table comments: account_type
Column Type Null Default Comments MIME
id int(11) No
type varchar(40) No
Indexes
Keyname Type Unique Packed Column Cardinality Collation Null Comment
PRIMARY
BTREE Yes No id 0 A No
Table comments: application_file
Column Type Null Default Links to Comments MIME
id int(11) No
amount decimal(10,0) No
status_id int(11) No status -> id
employee_id int(11) No employee -> id
guarantor_id int(11) No guarantor -> id
service_type_id int(11) No services_type -> id
student_details_id
int(11) No student_details -> id
12 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
account_no int(11) No account -> account_no
Indexes
Keyname Type Unique
Packed Column Cardin
alityCollation
Null
Comment
PRIMARYBTREE
Yes No id 0 A No
employee_application_file
BTREE
No No employee_id 0 A No
guarantor_application_file
BTREE
No No guarantor_id 0 A No
services_type_application_file
BTREE
No Noservice_type_id
0 A No
student_details_application_file
BTREE
No Nostudent_details_id
0 A No
account_application_file
BTREE
No No account_no 0 A No
status_application_fileBTREE
No No status_id 0 A No
Table comments: branch
Column Type Null Default Comments MIME
id int(11) No
namevarchar(40)
No
Indexes
13 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Keyname Type Unique Packed
Column
Cardinality
Collation
Null
Comment
PRIMARY
BTREE Yes No id 0 A No
Table comments: card
Column Type Null Default Links to Comments MIME
card_no int(11) No
account_no int(11) No account -> account_no
card_holder
int(11) No person -> id
Indexes
Keyname Type Unique
Packed Column Cardinalit
yCollation
Null
Comment
PRIMARYBTREE
Yes No card_no 0 A No
account_card
BTREE
No Noaccount_no
0 A No
person_card
BTREE
No Nocard_holder
0 A No
Table comments: course
Column Type Null Default Comments MIME
id int(11) No
typevarchar(40)
No
degreevarchar(40)
No
14 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
duration double Yes NULL
start_date
date No
end_date date No
Indexes
Keyname Type Unique Packed
Column
Cardinality
Collation
Null
Comment
PRIMARY
BTREE Yes No id 0 A No
Table comments: customer
Column Type Null Default Comments MIME
id int(11) No
namevarchar(40)
No
Indexes
Keyname Type Unique Packed
Column
Cardinality
Collation
Null
Comment
PRIMARY
BTREE Yes No id 0 A No
Table comments: employee
Column Type Null Default Links to Comments MIME
id int(11) No
employee_name
varchar(40)
No
branch_id int(11) No branch -> id
15 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Indexes
Keyname Type Unique
Packed Column Cardinalit
yCollation
Null
Comment
PRIMARYBTREE
Yes No id 0 A No
branch_employee
BTREE
No Nobranch_id
0 A No
Table comments: guarantor
Column Type Null Default Links to Comments MIME
id int(11) No
person_id
int(11) No person -> id
Indexes
Keyname Type Unique
Packed Column Cardinalit
yCollation
Null
Comment
PRIMARYBTREE
Yes No id 0 A No
person_guarantor
BTREE
No Noperson_id
0 A No
Table comments: income
Column Type Null Default Links to Comments
MIME
id int(11) No
amountdecimal(10,0)
No
date date No
16 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
customer_id
int(11) No customer -> id
account_no int(11) Noaccount -> account_no
Indexes
Keyname Type Unique
Packed Column Cardinali
tyCollation
Null
Comment
PRIMARYBTREE
Yes No id 0 A No
account_income
BTREE
No Noaccount_no
0 A No
customer_income
BTREE
No Nocustomer_id
0 A No
Table comments: outcome
Column Type Null Default Links to Comments
MIME
id int(11) No
amountdecimal(10,0)
No
date date No
customer_id
int(11) No customer -> id
account_no int(11) Noaccount -> account_no
Indexes
17 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Keyname Type Unique
Packed Column Cardinali
tyCollation
Null
Comment
PRIMARYBTREE
Yes No id 0 A No
account_outcome
BTREE
No Noaccount_no
0 A No
customer_outcome
BTREE
No Nocustomer_id
0 A No
Table comments: password
Column Type Null Default Links to Comments MIME
id int(11) No
passwordvarchar(40)
No
setup_date date No
setup_time time No
employee_id
int(11) No employee -> id
Indexes
Keyname Type Unique
Packed Column Cardinali
tyCollation
Null
Comment
PRIMARYBTREE
Yes No id 0 A No
employee_password
BTREE
No Noemployee_id
0 A No
Table comments: person
Column Type Null Default Comments MIME
18 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
id int(11) No
namevarchar(40)
No
addressvarchar(40)
No
mobile_phone
varchar(11)
No
emailvarchar(40)
No
Indexes
Keyname Type Unique Packed
Column
Cardinality
Collation
Null
Comment
PRIMARY
BTREE Yes No id 0 A No
Table comments: services_type
Column Type Null Default Comments MIME
id int(11) No
typevarchar(40)
No
Indexes
Keyname Type Unique Packed
Column
Cardinality
Collation
Null
Comment
PRIMARY
BTREE Yes No id 0 A No
Table comments: session
Column Type Null Default Links to Comments MIME
19 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
id int(11) No
ipvarchar(15)
No
accessing_date
datetime No
accessing_time
time No
card_no int(11) No card -> card_no
web_user_id int(11) No web_user -> id
Indexes
Keyname Type Unique
Packed Column Cardinali
tyCollation
Null
Comment
PRIMARYBTREE
Yes No id 0 A No
card_sessionBTREE
No No card_no 0 A No
web_user_session
BTREE
No Noweb_user_id
0 A No
Table comments: status
Column Type Null Default Comments MIME
id int(11) No
statusvarchar(40)
No
Indexes
20 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Keyname Type Unique Packed
Column
Cardinality
Collation
Null
Comment
PRIMARY
BTREE Yes No id 0 A No
Table comments: student_details
Column Type Null Default Links to Comments MIME
id int(11) No
student_id int(11) No person -> id
university_id
int(11) No university -> id
course_id int(11) No course -> id
Indexes
Keyname TypeUnique
Packed Column Cardina
lityCollation Null Comm
ent
PRIMARY BTREEYes
No id 0 A No
university_student_details
BTREE No Nouniversity_id
0 A No
course_student_details
BTREE No No course_id 0 A No
person_student_details
BTREE No Nostudent_id
0 A No
Table comments: system_transaction
Column Type Null Default Links to Comments
MIME
id int(11) No
21 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
amount double No
date date No
transaction_nature_id
int(11) Notransaction_nature -> id
transactions_type_id int(11) Notransaction_type -> id
predecessor int(11) Yes NULL system_transaction -> id
reference_id int(11) Yes NULL application_file -> id
account_no int(11) Noaccount -> account_no
Indexes
Keyname Type
Unique
Packed Column Cardin
alityCollation
Null
Comment
PRIMARYBTREE
Yes No id 0 ANo
account_system_transaction
BTREE
No No account_no 0 ANo
transaction_nature_system_transaction
BTREE
No Notransaction_nature_id
0 ANo
transaction_type_system_transaction
BTREE
No Notransactions_type_id
0 ANo
system_transaction_system_transaction
BTREE
No No predecessor 0 AYes
application_file_system_transaction
BTREE
No No reference_id 0 AYes
Table comments: test
22 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Column Type Null Default Comments MIME
iddecimal(10,0)
No
Indexes
Keyname Type Unique Packed
Column
Cardinality
Collation
Null
Comment
PRIMARY
BTREE Yes No id 0 A No
Table comments: transaction_nature
Column Type Null Default Comments MIME
id int(11) No
description
varchar(40)
Yes NULL
Indexes
Keyname Type Unique Packed
Column
Cardinality
Collation
Null
Comment
PRIMARY
BTREE Yes No id 0 A No
Table comments: transaction_type
Column Type Null Default Comments MIME
id int(11) No
namevarchar(40)
Yes NULL
Indexes
23 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Keyname Type Unique Packed
Column
Cardinality
Collation
Null
Comment
PRIMARY
BTREE Yes No id 0 A No
Table comments: university
Column Type Null Default Comments MIME
id int(11) No
namevarchar(40)
Yes NULL
Indexes
Keyname Type Unique Packed
Column
Cardinality
Collation
Null
Comment
PRIMARY
BTREE Yes No id 0 A No
Table comments: web_user
Column Type Null Default Links to Comments MIME
id int(11) No
user_namevarchar(40)
No
password_id
int(11) No password -> id
card_no int(11) No card -> card_no
Indexes
24 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Keyname Type Unique
Packed Column Cardinali
tyCollation
Null
Comment
PRIMARYBTREE
Yes No id 0 A No
password_web_user
BTREE
No Nopassword_id
0 A No
card_web_userBTREE
No No card_no 0 A No
c) Database populatingPerson table
Course table
25 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
University table
Student_details table
26 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Application file
Account file
27 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
d) Database Queries
AggregationLike aggregation example have closed COUNT (*) function. At this example are presented all applications associated to an account. COUNT (*) function count and return a total value of each line of WHERE statement true.
Sub queryA sub query is a nested query. In this example WHERE statement uses more condition to be true, one of them is other function aimed to determinate average amount of all applications and displays all applications over average together with student id, student name, and account no.
SELECT account.account_no, COUNT( * )
FROM account, application_file
WHERE application_file.account_no = account.account_no
FROM student_details, person, account, application_file
WHERE application_file.account_no = account.account_no
AND student_details.id = account.student_details_id
AND person.id = student_details.student_id
AND application_file.amount > ( SELECT AVG( application_file.amount )
FROM application_file );
28 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
JoinThe JOIN clause is a combination of rows from more than one table, using common fields between them. In SQL can find different kinds of JOIN clause with different functions, these are: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN.
INNER JOINThis query example is aimed to presents all students along with student id, extract from database all rows with WHERE statement true.
select student_details.id, person.name
from student_details
INNER JOIN person
where person.id = student_details.student_id
order by student_details.id;
equivalent of
select student_details.id, person.name
from student_details, person
where person.id = student_details.student_id
order by student_details.id;
29 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
RIGHT JOINThis example present all rows from the person table associated to student id, where student id is not associated is display null.
Self-JoinIt is a reference to join a table to itself. Tis example present associated file id which preceded them.
select student_details.id, person.name
from student_details
right JOIN person
on person.id = student_details.student_id
order by student_details.id;
equivalent of
select student_details.id, person.name
from person
left outer JOIN student_details
on person.id = student_details.student_id
order by student_details.id;
30 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
e) Create viewsA view is a virtual table based on query results of one or more tables. To create a view in MySQL call CREARE VIEW statement. Process involves to provide a name for view followed by the AS and SELECT statement.
Account DetailsTables used to create this view are student_details, person, account, account_type, card.
where student_details.student_id = person.id and university.id = student_details.university_id and student_details.course_id = course.id
order by student_details.id;
33 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Database testing is an important part of life cycle development. It is aimed to check database rules or right business rules implementation, data integrity, data accessing, code correctness, data validity, performance, and security of the software under development.
Database testing is running over ODBC helping by the following functions: SQLOpen, SQLClose, SQLError, SQLRetrieve, SQLRetrieveToFile, SQLExecQuery, SQLGetSchema and SQLRequest.
For relevant testing results, for each test is important to develop a test plan.
f) Test planEach test plan must to contain required steps. Before to start it is important to know what will be tested, how will be tasted and which kind of data are used in testing process.
Elements of the system under testingAccording to TTCN-3 standards was decide to test:
1. Databasea. Database nameb. Database allocation space
2. Tables, columns, column types and rulesa. The name of all tablesb. Column names of each tablec. Data type of each columnd. If a column allows NULL or note. Rule definitions
3. Keys and indexesa. Primary fey of each tableb. Foreign keysc. Foreign key data types and associated column
4. Data integrity and consistencya. Data validation before insertion, updating and deletionb. Tray to insert a child data before inserting its parent’s datac. Try to delete a record that is still referenced by data in other tabled. Try to insert different data type then what was defined
Type of testingLike tests have more concepts, depending by area which supposed to be used has more testing methods. Like database tests can find black-box, with-box and WHODATE approaches.
This test will use With-box testing and assume to evaluate:
34 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Referential integrity Database consistency
Tools used on testing process: TSQLUnit and LiquiBase.
Data usedCan use three different types of test data values that shoul be used to fully test a database system:
- Normal values- Extreme values- Exceptional values
Each value of test data it is selected to determinate if the system process them correctly. The developer must to know, before to proceed to test, what is expecting to return to can compare against of data testing output. It is required to store boat of them in idea to identify when processing errors have occurred.
Just when the testing data and expected output are clear selected can proceed to test.
account table
Column Database data Type case 1 case 2 case 3 expected
resultsaccount_no int(11) 1.5 a ‘’ erroraccount_type_id int(11) 1.5 a ‘’ errorstudent_details_id int(11) 1.5 a ‘’ errorinterest_rate double a a ‘’ erroroverdraft int(11) 1.5 a ‘’ error
person table
Column Database data Type case 1 case 2 case 3 expected
resultsid int(11) a 2.2 null errorname varchar(40) a 2.2 null erroraddress varchar(40) a 2.2 null errormobile_phone varchar(11) a 2.2 null erroremail varchar(40) a 2.2 null error
g) Review and testStartups test result was found:
Account table tests
Case 1
insert into account
values (1.5,1.5,1.5, 'a', 1.5 );
35 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Results:
Case 2
Results:
Case 3
insert into account
values ('a','a','a', 'a', 'a' );
36 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Results:
Person table tests
Case 1
Results:
insert into account
values ('','','', '', '' );
insert into person
values ('a','a','a', 'a', 'a' );
37 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Case 2
Results:
Case 3
Results:
insert into person
values ('2.2','2.2','2.2', '2.2', '2.2' );
insert into person
values ( null ,null ,null ,null ,null );
38 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
Review
Database accept meet the testing requirements at test 1- Database, test 2 - Tables, columns, column types and rules, test 3 - Keys and indexes, and partial test 4 - Data integrity and consistency.
Fail result are: test 4.a - Data validation before insertion, updating and deletion, test 4.d - Try to insert different data type then what was defined
h) Verification and validationOne of the biggest problem with database system is that is very easy to insert wrong data into them. If wrong data are inserted will produce incorrect outputs, garbage in garbage out (GIGO).
Have to main techniques to avoid these problems.
Verification
Verification process ensures that the data inserted into a database system are accurate. It can be made in two ways, on-screen prompt, when after each inserted row system return a massage to confirm if data are correctly inserted or not. The second way use to different operators to insert data, into two different databases which are compared, in case of any inconsistency process is repeated. This process is called Dual Input.
Validation
It is a process of checking data sensitivity. Can be care out by software without data correctness concerns. Like validations method are identified: presence check, type check, length check, range check, format check, check digit, and parity check.
Developed database misses to pass the verification and validation test.
i) Control mechanismLike control mechanism in this development was decide to use the optimistic concurrency control, rather than pessimistic control, because of less conflicts possibilities. Pessimistic Control looks more appropriate for a banking institution was chose to not use this kind of control mechanism for that to allow users to change data as it is built only for students and the data inserted for students is unsure
39 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
because as a student the address can be changed often, mobile number, type of account and many other things.
j) User documentationEnd user documentation is a success key of any database development. The quality of end-user documentation can alter the implementation assessment of the new system.
In our case, end-user documentation is equivalent with code documentation. It is very important that the user documentations to be very well organized, to not be confusing and to hold an elaborate index. In documentation proses are three approaches of documentation organizing. Tutorial approach, most useful for a new user, is a guideline step-by-step of accomplishing a particular task. Thematic approach, each chapter cover a particular area of interest, presents a general using concepts and is addressed to intermediate users. Referencing list approach, where commands or tasks are listed alphabetically, is aimed to be used by advanced users who know exactly what kind of information they are looking for.
End user documentations can be presented in forms of online documents, PDFs files, videos ore printed manuals.
End User Manualaccount Store and provide all account details
account_details Extract from database all account holders, card number, card type and associated card no
account_typeprovide attributes for account, like standard or premium, and enable overdraft attribute and decide the interest rate
application_file Keep and provide application trackingbranch Store and provide branch details
card Store and provide all cards detailscourse Store and provide course details
customer Here are all customer detailsemployee All employee details are find here
guarantorMake connections between person table and application file aimed to provide guarantor attribute for a person and allow to trace them
income All incoming operations out of the systemoutcome All outgoing operations outside of the systempassword store password and password history
person store all details for a human
services_type provide kind of services, like student account, loan, mortgage, for a transaction
session Store webs session details
40 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
status Store and provide attributes for application process, such as Accepted or Rejected
student_detailsFor a person to become a student must to have associated some details, like university and course. This association is made hear
student_enrol Extract from database all student detailssystem_transacti
onStore and provide all transactions details which insoles the LSB system
transaction_nature
Provide details about transaction like pay interest, account fee, monthly amount, loan, mortgage or card fare
transaction_typefield store the kind of transactions, paying ore receiving because inside of the system can find boat of them
university Store and provide universities details
web_user Store all username details along with associated cards and accounts
4. Improvements
Like improvement of LSB database is recommend to reevaluate all design to enforce data integrity and consistency.
5. Conclusion
A relational database is a wonderful tool aimed to storing and organising large amounts of data efficiently. This piece of work is aimed to present stages of development and implementations, from conceptual design to preparing end-user documentation.
41 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
6. Bibliography
Chao, L., 2006. Database Development and Management.. Auerbach Publications ed. s.l.:Boca Raton.
Connolly, T. M. and Begg, C. E., 2005. Database systems. A proactical approch to design, implementation, and management. 4-th ed. London: Pearson Education Limited.
Elmasri, R. and Navathe, S., 2009. Grundlagen von Datenbanksystemen. 3-th ed. s.l.:Pearson Deutschland.
Fortier, P. J. and Michel, H. E., 2003. Computer Systems Performance Evaluation and Prediction. Burlington: Digital Press.
Hoffer, J. A. and Prescott, B. M. and McFadden, R. F., 2006. Modern Databace Management. 8-th ed. s.l.:Pearson Education.
Kendall, K. E. and Kendall, J. E., 2010. Systems analysis and design. 8th ed. s.l.:Prentice Hall.
Kroenke, D. M. and Auer, D. J., 2013. Database Concepts. 6-th ed. s.l.:Pearson.
Microsoft, n.d. Description of the database normalization basics. [Online] Available at: http://support.microsoft.com/[Accessed 08 08 2013].
Özsu, M. T. and Valduriez, P., 2011. Principles of Distributed Database Systems. 3rd ed. New York: Springer Science + Business Media.
42 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
APPENDIX
43 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
a) LSB Database-- phpMyAdmin SQL Dump-- version 4.0.4.1-- http://www.phpmyadmin.net---- Host: 127.0.0.1-- Generation Time: May 06, 2014 at 03:40 AM-- Server version: 5.5.32-- PHP Version: 5.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;/*!40101 SET NAMES utf8 */;
---- Database: `dad`--CREATE DATABASE IF NOT EXISTS `dad` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;USE `dad`;
CREATE TABLE IF NOT EXISTS `course` ( `id` int(11) NOT NULL, `type` varchar(40) NOT NULL, `degree` varchar(40) NOT NULL, `duration` double DEFAULT NULL, `start_date` date NOT NULL, `end_date` date NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
47 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
CREATE TABLE IF NOT EXISTS `outcome` ( `id` int(11) NOT NULL, `amount` decimal(10,0) NOT NULL, `date` date NOT NULL, `customer_id` int(11) NOT NULL, `account_no` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `account_outcome` (`account_no`), KEY `customer_outcome` (`customer_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
50 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
---- Table structure for table `password`--
CREATE TABLE IF NOT EXISTS `password` ( `id` int(11) NOT NULL, `password` varchar(40) NOT NULL, `setup_date` date NOT NULL, `setup_time` time NOT NULL, `employee_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `employee_password` (`employee_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `session` ( `id` int(11) NOT NULL, `ip` varchar(15) NOT NULL, `accessing_date` datetime NOT NULL, `accessing_time` time NOT NULL, `card_no` int(11) NOT NULL, `web_user_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `card_session` (`card_no`), KEY `web_user_session` (`web_user_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
52 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
CREATE TABLE IF NOT EXISTS `web_user` ( `id` int(11) NOT NULL, `user_name` varchar(40) NOT NULL, `password_id` int(11) NOT NULL, `card_no` int(11) NOT NULL, PRIMARY KEY (`id`),
56 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
---- Structure for view `account_details`--DROP TABLE IF EXISTS `account_details`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `account_details` AS select `student_details`.`id` AS `id`,`person`.`name` AS `name`,`account`.`account_no` AS `account_no`,`account_type`.`type` AS `type`,`card`.`card_no` AS `card_no` from ((((`student_details` join `person`) join `account`) join `account_type`) join `card`) where ((`student_details`.`student_id` = `person`.`id`) and (`student_details`.`id` = `account`.`student_details_id`) and (`account`.`account_no` = `card`.`account_no`) and (`account`.`account_type_id` = `account_type`.`id`)) order by `student_details`.`id`;
---- Structure for view `student_enrol`--DROP TABLE IF EXISTS `student_enrol`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `student_enrol` AS select `student_details`.`id` AS `id`,`person`.`name` AS `name`,`course`.`type` AS `type`,`course`.`degree` AS `degree`,`course`.`duration` AS `duration`,`course`.`start_date` AS `start_date`,`course`.`end_date` AS `end_date`,`university`.`u_name` AS `u_name` from (((`student_details` join `person`) join `course`) join `university`) where ((`student_details`.`student_id` = `person`.`id`) and (`university`.`id` = `student_details`.`university_id`) and (`student_details`.`course_id` = `course`.`id`)) order by `student_details`.`id`;
--
57 | I o a n T u n s - H N D C S D - D A D - 0 6 / 0 5 / 2 0 1 4
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;