Database - NCC - June2009 - Assingment - Iadcs
Database - NCC - June2009 - Assingment - Iadcs
Introduction
A have prepare this assignment to demonstrate an understanding of applying data modeling
and analysis techniques to the design and development of database solutions.
I am as a sub-contracted to design the database system supporting the Academic Human
Resources (AHR) department for the “We Are The Best - WATB” college. The college has 5
departments:
Computer Science,
Arts,
Business,
Physics and
Mathematics.
Each department has a maximum of one Head of Department and a maximum of two Associate
Heads of Department. An academic cannot occupy the roles of Head of Department and
Associate Head of Department at the same time.
The initial analysis of the WATB College’s AHR Department has shown the following:
WATB AHR department (we are) is responsible only for academic posts. Only academics that
hold senior posts can occupy the roles of Head of Department and Associate Head of
Department. Senior posts are: Principal Lecturer, Reader, and Professor. The rest of the roles
can be occupied by any academic irrespective of the post they hold. Academics might hold the
same role more than one time.
I am “The “WATB College’s” -AHR department” will keep information for every academic who
has ever been employed:
Personal information: full name, age, address, nationality, qualifications,
Work related information: current post name and grade, starting date, previous posts, dates
of every post held, and current salary.
The rules of the my (“WATB College’s” -AHR) department state that an academic might hold
only one post per time but they might occupy more than one role;
The Posts that can be fulfilled by an academic are: Lecturer, Senior Lecturer, Principal
Lecturer, Reader, and Professor.
The Roles that can be fulfilled by an academic are: Research Leader, Program Director,
Course Leader, Head of Department, Associate Head of Department, Quality Leader, Learning
and Teaching Leader, Recruitment Officer, and Examinations Officer.
My (AHR) department holds information on who occupies these roles in each department of the
college.
Aim: Draw an Entity Relationship Data Model which describes the content and structure of the
data held by the Academic Human Resources Department.
Entity relationship Model: a data model originally proposed by P.P.S. Chen. Which utilities
three primary constructs: entity, relationship and attributes.
There are three primary constructs in ER models:
• Entities are the "things" about which we seek information.
• Attributes are the data we collect about the entities.
• Relationships provide the structure needed to draw information from multiple entities.
Academic Job
Academic Job
Figure: entity relationship diagram showing primary key and foreign key
The diagrams in this figure specify the different set of data requirements, namely...
An academic contains a number of job.
The relation ship Between the academic and job entity there is an 1:M
The relation ship Between the job and role history entity there is an 1:M
The relation ship Between the role and Role history entity there is an 1:M
Academic job
Attribute
Attribute
Academic ID: Job code:
DOB: Current post name:
Address: Post Grade :
Nationality: Previous post:
Qualification: Post starting date
Awarding body: Ending of contact:
Awarding date Job duration:
Current Salary:
Attribute
Aim: Produce the resulting tables clearly indicating the primary and foreign keys.
Primary key: a key or identifier is an attribute which uniquely identifies a single row within the
relation. This key often called the primary key. The key should be always be the minimum set of
attributes required to identified uniquely a row of the relation.
Candidate Name: NCC Candidate ID: Examination Cycle: Page 5 of 31
Md. Ibrahim Amin 00097697 June 2009
International Advances Diploma in Computer Studies Database Design & Development
Foreign key: An attribute which is the primary key of one relation but appears as an attributes
in another relation is called a foreign key.
Foreign key is identified by *
Academic job
Job code
Academic ID
Academic ID*
Academic name
Current post name
DOB
Post Grade
Address
Starting date
Nationality
Previous post
Qualification
Ending of contact
Awarding body
Job duration
Awarding date
Post Salary
Department Name
Role history
Role ID*
Job Code*
Role name Resulting Role
Previous role table of Role Code
Role starting date my Role Name
Role ending date created
Extra payment for Role data base:
Academic table:
Academic
Academic BOB Academic Nationality Address Qualification
Awarding Awarding
ID name body date
101 03-03- Rahman Riaz Bangladeshi SYLHET M.Sc in LondonMet 06-06-1987
1960 Mathematics
102 02-01- Mustafa ali Bangladeshi SYLHET M.Sc in IT DHAKA uni 02-02-2002
1975
103 04-02- abidal Bangladeshi SYLHET M.Sc in SUST 07-06-1982
1955 Mathematics
104 03-01- mahmuda Bangladeshi DHAKA M.Sc in DHAKA uni 06-06-2007
Candidate Name: NCC Candidate ID: Examination Cycle: Page 6 of 31
Md. Ibrahim Amin 00097697 June 2009
International Advances Diploma in Computer Studies Database Design & Development
1975 Mathematics
105 08-07- sadik Bangladeshi SYLHET M.Sc in DHAKA uni '06-06-2007'
19801 Mathematics
Job table:
Job
Academ Job Current Post Previo Post starting Job Current Ending of Department
ic ID*
code post name grade us post date duration salary contact
101 1 lecturer A 10-08-1988 1000 12-03-2010 mathematics
Role History
Job code* Role id* Previous role Role starting date Role ending date Extra payment for role
Role table:
Role
Role ID* Role name
1 Head of department
2 Associate Head of department
3 Quality leader
4 Research leader
5 Program Director
Aim: Normalize these tables to ensure that are all pa BCNF (3NF)
Normalization:
Normalization is the process of identifying the logical association between data-items and
designed a database which will represent such associations but without suffering from file
maintenance anomalies.
Stages of normalization.
Normalization carried out in the flowing stapes:
Collect the data – the set of data items.
Transform the un-normalized data set into tables in first normal form.
Transform first normal form tables to second normal form.
Transform second normal form table to third normal form..
The attributes, Job code , Current post name, Post Grade ,Starting date, Previous post, Ending
of contact , Post Salary, department name, Role ID, Role name, Previous role, Role starting
date, Role ending date, Extra payment for Role are clearly not functionally dependent on my
chosen primary key “Department Code” . The attributes Department Name, Academic ID,
Academic name, DOB, Address, Nationality, Qualification, Awarding body, Awarding date
clearly are. This means that we form tow table: one for the functionally dependent attribute,
and one for the non –dependent attributes. I declare a compound of Department Code and post
code to the primary of this second table.
Academic ID
Job code
Current post name
Post Grade
First normal form:
Starting date
Previous post
Ending of contact
Post Salary
department name
Role ID
Role name
Previous role
Role starting date
Candidate Name: NCC Candidate ID: Examination Cycle: Page 11 of 31
Md. Ibrahim Amin Role ending date
00097697 June 2009
Extra payment for Role
International Advances Diploma in Computer Studies Database Design & Development
Academic ID
Job code
Current post name
Post Grade
Starting date
Previous post
Ending of contact
Post Salary
Department name
Role ID
Job Code
Role name
Previous role
Role starting date
Role ending date
Extra payment for Role
Academic ID*
Job code
Current post name
Post Grade
Starting date
Previous post
Ending of contact
Post Salary
Department name
Job Code*
Role ID *
Role name
Previous role
Role starting date
Role ending date
Extra payment for Role
Third normal form:
Candidate Name: NCC Candidate ID: Examination Cycle: Page 14 of 31
Md. Ibrahim Amin Role00097697
ID June 2009
Role name
International Advances Diploma in Computer Studies Database Design & Development
Academic
JOB
Role history
ROLE
A use full mnemonic for remembering the relation for normalization is the distortion of the legal
Oath presented below:
No repeating group
The data items depended upon the key.
The while key And nothing but the key
So help me code.
Aim: Using a Data Base Management System (DBMS) of your choice, set-up all the above
normalized tables, and populates them with well-designed test data (minimum 5 records per
table). Provide printouts of all tables.
Using SQL (DBMS) I have create table by flowing above normalization there are below:
Academic table:
Step 1: create table academic
select*from academic ;
JOB table:
Step 2: write codes to SQL for show job column in below figure.
Describe job;
Step 4: write SQL code (select*from job ;) to SQL for show academic information
select*from Job ;
Role_History table:
Step 1: create table Role_History.
Describe role_history
select*from role_history ;
Role table:
Step 1: create table Role.
create table role(
roleid number(2),
Candidate Name: NCC Candidate ID: Examination Cycle: Page 24 of 31
Md. Ibrahim Amin 00097697 June 2009
International Advances Diploma in Computer Studies Database Design & Development
rolename varchar2(30),
primary key(roleid));
Step 2: write codes to SQL for show Role colum.
Describe role;
select*from Rol ;
Aim: Set-up and test all of the following queries using Structured Query Language (SQL).
Please provide printouts of SQL code for each query and the output produced when you run
the query in the database you have developed:
● Display the name of all the heads of departments together with information on any other
Roles they might occupy and the current post they hold.
● Display the name of all the current Senior Lecturers along with the name of the
Department that they belong to and their final salary (the final salary should include the
Salary paid for the post plus any additional payments that an employee might receive
for
Roles they might occupy).
● Display all the heads of the Mathematics department from 2000 to date. The result
should
Return their name, current post and qualifications.
A)
Name of all the heads of departments together with information on any other Roles they
might occupy and the current post they hold
b)
Name of all the current Senior Lecturers along with the name of the Department that they
belong to and their final salary
select academic.academicname , job.dept,job.csalary from academic, job, role ,
C)
All the heads of the Mathematics department from 2000 to date. The result shouldReturn
their name, current post and qualifications:
Learning outcome
During doing this assignment I had to acquire enough knowledge and experience from
various sources. In Task 1, I have drawn an Entity Relationship Data Model which
describes the content and structure of the data held by the Academic Human Resources
Department.
II have Produce the resulting tables clearly indicating the primary and foreign keys.
I have Normalized the my created tables to ensure that are all in BCNF (3NF)depend on all
attribute which described in content and structure of the data who held by the Academic Human
Resources Department.
Ii have created a Data Base Management System (DBMS) by using SQL, set-up all the above
normalized tables, and populate them with well-designed test data and I have provided
printouts of all tables.
I have Set-up and test all of the following queries using Structured Query Language (SQL). And
I have provided provide printouts of SQL code for each query and the output produced when
you run the query in the database you have developed:
• Display the name of all the heads of departments together with information on any other
roles they might occupy and the current post they hold.
• Display the name of all the current Senior Lecturers along with the name of the
department that they belong to and their final salary (the final salary should include the
salary paid for the post plus any additional payments that an employee might receive for
roles they might occupy).
• Display all the heads of the Mathematics department from 2000 to date. The result
should return their name, current post and qualifications.
After completing I have acquired enough knowledge about how to use SQL in terms of
database, and I am now familiar with new version of ORACLE, 10g .
Reference
Serial No URL Date Type of reference
1 http://www.tonymarston.net 20/04/2009 Html
2 http://www.radicore.org 02/05/2009 Html
3 www.school.com/sql/ 03/05/2009 Html
4 www.wikipedia.com 12/04/2009 Html