Sei sulla pagina 1di 53

Group Assignment Helpdesk Case Study

Acknowledgement

First we would like to thank Dr. Damith Mudugamuwa for the guidance given to us for
this subject.

As a group all of us worked very hard and many of our colleagues also assisted us when
doing the development of the system, and special thank you goes out to all of them.

Next we would like to thank APIIT administration, library and computer lab staff who
has helped us in many different ways to complete this assignment.

CM30067-M Enterprise Database System Page 1 of 53


Group Assignment Helpdesk Case Study

Table of Content
Acknowledgement...............................................................................................................1
Table of Figures...................................................................................................................2
1.0Introduction.....................................................................................................................2
2.0 Scenario..........................................................................................................................3
3.0 Analysis..........................................................................................................................4
4.0 Design............................................................................................................................5
4.1 Entity Relationship Diagram......................................................................................5
4.2 Normalisation.............................................................................................................8
4.3 Table Structures........................................................................................................11
.......................................................................................................................................11
4.4 SQL Statements........................................................................................................12
5.0 Implementation............................................................................................................12
5.1 System Development Details...................................................................................12
5.2 System requirements................................................................................................12
5.3 Deployment..............................................................................................................12
6.0 Proposed System Features...........................................................................................13
7.0 Testing..........................................................................................................................34
7.1 System Functional Testing.......................................................................................34
7.2 Front-end Testing.....................................................................................................34
7. 3 Database Testing.....................................................................................................34
8.0 Reports.........................................................................................................................35
9.0 Conclusion...................................................................................................................43
10.0 Work Load Matrix......................................................................................................44
...........................................................................................................................................44
Bibliography .....................................................................................................................45
...........................................................................................................................................45
Appendix A .......................................................................................................................46
.........................................................................................................................................48

Table of Figures
Figure 1: Entity Relationships Diagram with M:N relationships…………………………6
Figure 2: Entity Relationships Diagram with resolved M:N relationship………………...7

1.0 Introduction
The purpose of this assignment is to create a computer system to log and track the all
helpdesk queries. The system development of the group was based on this requirement.

CM30067-M Enterprise Database System Page 2 of 53


Group Assignment Helpdesk Case Study

The developed system is readily capable of managing all queries as required by the
company, provide security to the data by allowing only authorized users to access the
system and is also able to generate 5 important reports which are listed below, for the
purpose of assisting the analysis of the helpdesk operations.

1. All previous issues of a particular type to see if the same issue has occurred
before and if so how it was solved
2. All previous issues with the same caller to identify if there were other related
issues that may give some clue as to how the current issue can be solved
3. Each Engineers workload
4. All outstanding/unsolved issues within a issue type
5. All outstanding/unsolved issues currently assigned to a specialist

The development of the system comprised of many important stages as listed below
1. Analysing the case study
2. Identifying important entities and preparation of the ER diagram
3. Preparation of the Relational schema and Normalization
4. Preparation of DDLs
5. Data insertion
6. System Interface design
7. Coding
8. Testing

The report submitted contains the outputs of many of the stages listed above. Based on
the above scenario we decided to develop a web based system as in our opinion the most
suitable. We refer to the system as “Issue Manager”

Note: All “Problems” mentioned in the case study is referred to as “Issue” in the system.

2.0 Scenario
It is a Malaysian company with a large IT function who is trying to set up an IT Helpdesk
to hardware and software issues concerning its IT system. A computer system is needed

CM30067-M Enterprise Database System Page 3 of 53


Group Assignment Helpdesk Case Study

to log and track all helpdesk queries, which will help analysis to determine how the
equipment is performing overall. Whenever anyone within the company has a problem
they can contact the helpdesk. One of the helpdesk operators will deal with the enquiry
him or herself if possible, and if not will be passed on to a one of a number of specialists
who specialises in different areas. All information regarded to the above process is
recorded in the system. Following sections outline the steps which were followed in
eventually designing an overall system which records all IT issues.

3.0 Analysis
System analysis was mainly carried out based on the details given in the case study. Apart
from that other relevant facts and assumptions made based on the general experiences
and points came out in the team discussions.
Assumptions
- Due to time restrictions did not implement interfaces to assign employee issue
specialisation. Therefore we assume that administrator will assign it through
the table EMPLOYEE_ISSUE_TYPE
- Does not keep the history of particular issue’s responsibility transfer from one
engineer to the other but by adding comments this purpose can be
accomplished.
- All H/W has a serial number pasted on them for easy reference to the caller.
- When an Issue is solved a comment is always added by the specialist or
operator which will record the issue solved date and time
- Issues are always closed by the assigned person.
- Problems will be referred to as Issues and Problem Areas as Issue Types

CM30067-M Enterprise Database System Page 4 of 53


Group Assignment Helpdesk Case Study

4.0 Design

4.1 Entity Relationship Diagram

Figure 1: Entity Relationships Diagram with M: N relationships

Figure 2: Entity Relationships Diagram with resolved M: N relationship

CM30067-M Enterprise Database System Page 5 of 53


Group Assignment Helpdesk Case Study

CM30067-M Enterprise Database System Page 6 of 53


Group Assignment Helpdesk Case Study

CM30067-M Enterprise Database System Page 7 of 53


Group Assignment Helpdesk Case Study

4.2 Normalisation
UN-NORMALIZED SCHEMA

EMPLOYEE (EMPLOYEE_ID, JOB_TITLE, FIRST_NAME, LAST_NAME,


DEPARTMENT_ID, DEVISION)

DEPARTMENT (DEPARTMENT_ID, NAME, DESCRIPTION)

HARDWARE (HARDWARE_ID, SERIAL_NO, DESCRIPTION, PART1, PART2, PART3)

SOFTWARE (SOFTWARE_ID, NAME, DESCRIPTION, VERSION, SERIAL_NO,


LICENSED)

ISSUE (ISSUE_ID, ISSUE_TYPE_ID, ISSUE_SUMMARY, DESCRIPTION,


DATE_OF_CALL, TIME_OF_CALL, OPERATOR_ID, CALLER_ID,
SOFTWARE_ID_HARDWARE_ID, SEVERITY, RESPONSE_DATE,
STATUS, ASSIGNED_TO, COMMENT1, COMMENT2, COMMENT3)

ISSUE_TYPE (ISSUE_TYPE_ID, ISSUE_TYPE, DESCRIPTION)

EMPLOYEE_ISSUE_TYPE (EMPLOYEE_ID, ISSUE_TYPE_ID)

SOLUTION (SOLUTION_ID, SUMMARY, STEPS)

USER (EMPLOYEE_ID, USER_NAME, PASSWORD)

FIRST NORMAL FORM – No Repeating Groups


EMPLOYEE (EMPLOYEE_ID, JOB_TITLE, FIRST_NAME, LAST_NAME,
DEPARTMENT_ID, DEVISION)

DEPARTMENT (DEPARTMENT_ID, NAME, DESCRIPTION)

SOFTWARE (SOFTWARE_ID, NAME, DESCRIPTION, VERSION, SERIAL_NO,


LICENSED)

ISSUE_TYPE (ISSUE_TYPE_ID, ISSUE_TYPE, DESCRIPTION)

EMPLOYEE_ISSUE_TYPE (EMPLOYEE_ID, ISSUE_TYPE_ID)

SOLUTION (SOLUTION_ID, SUMMARY, STEPS)

USER (EMPLOYEE_ID, USER_NAME, PASSWORD)

HARDWARE (HARDWARE_ID, SERIAL_NO, DESCRIPTION, PART)


ISSUE (ISSUE_ID, ISSUE_TYPE_ID, ISSUE_SUMMARY, DESCRIPTION,
DATE_OF_CALL, TIME_OF_CALL, OPERATOR_ID, CALLER_ID,

CM30067-M Enterprise Database System Page 8 of 53


Group Assignment Helpdesk Case Study

PRODUCT_ID, SEVERITY, RESPONSE _DATE, STATUS, ASSIGNED_TO,


COMMENT)

SECOND NORMAL FORM – Eliminating Redundant Data

EMPLOYEE (EMPLOYEE_ID, JOB_TITLE, FIRST_NAME, LAST_NAME,


DEPARTMENT_ID, DEVISION)

DEPARTMENT (DEPARTMENT_ID, NAME, DESCRIPTION)

SOFTWARE (SOFTWARE_ID, NAME, DESCRIPTION, VERSION, SERIAL_NO,


LICENSED)

ISSUE_TYPE (ISSUE_TYPE_ID, ISSUE_TYPE, DESCRIPTION)

EMPLOYEE_ISSUE_TYPE (EMPLOYEE_ID, ISSUE_TYPE_ID)

SOLUTION (SOLUTION_ID, SUMMARY, STEPS)

USER (EMPLOYEE_ID, USER_NAME, PASSWORD)

HARDWARE (HARDWARE_ID, SERIAL_NO, DESCRIPTION, PART_ID)


HARDWARE_PART (HARDWARE_ID, PART_ID, SERIAL_NO, DESCRIPTION)
ISSUE (ISSUE_ID, ISSUE_TYPE_ID, ISSUE_SUMMARY, DESCRIPTION,
DATE_OF_CALL, TIME_OF_CALL, OPERATOR_ID, CALLER_ID,
PRODUCT_ID, SEVERITY, RESPONSE_DATE, STATUS, ASSIGNED_TO¸
COMMENT_ID)
ISSUE_COMMENT (ISSUE_ID, COMMENT_ID, COMMENT, DATE, COMMENTED_BY)

THIRD NORMAL FORM – Eliminate Data Not Dependent On Key

EMPLOYEE (EMPLOYEE_ID, JOB_TITLE, FIRST_NAME, LAST_NAME,


DEPARTMENT_ID, DEVISION)

DEPARTMENT (DEPARTMENT_ID, NAME, DESCRIPTION)

SOFTWARE (SOFTWARE_ID, NAME, DESCRIPTION, VERSION, SERIAL_NO,


LICENSED)

ISSUE_TYPE (ISSUE_TYPE_ID, ISSUE_TYPE, DESCRIPTION)

EMPLOYEE_ISSUE_TYPE (EMPLOYEE_ID, ISSUE_TYPE_ID)

SOLUTION (SOLUTION_ID, SUMMARY, STEPS)

USER (EMPLOYEE_ID, USER_NAME, PASSWORD)

HARDWARE (HARDWARE_ID, SERIAL_NO, DESCRIPTION, PART_ID)

CM30067-M Enterprise Database System Page 9 of 53


Group Assignment Helpdesk Case Study

HARDWARE_PART (HARDWARE_ID, PART_ID, SERIAL_NO, DESCRIPTION)


ISSUE_COMMENT (ISSUE_ID, COMMENT_ID, COMMENT, DATE, COMMENTED_BY)
ISSUE (ISSUE_ID, ISSUE_TYPE_ID, ISSUE_SUMMARY, DESCRIPTION,
DATE_OF_CALL, TIME_OF_CALL, OPERATOR_ID, CALLER_ID,
PRODUCT_ID, SEVERITY, STATUS, COMMENT_ID)
ISSUE_TASK (ISSUE_TYPE_ID, RESPONSE_DATE, ASSIGNED_TO, ASSIGNED_BY)

CM30067-M Enterprise Database System Page 10 of 53


Group Assignment Helpdesk Case Study

4.3 Table Structures

CM30067-M Enterprise Database System Page 11 of 53


Group Assignment Helpdesk Case Study

4.4 SQL Statements


SQL statements of all Table creations, Views, Functions, Primary and Foreign Key creations are
included in Appendix A.

5.0 Implementation

5.1 System Development Details

Environment Windows
Programming Technology ASP.NET, C#
DBMS SQL Server 2000

5.2 System requirements


• IIS Web Server is required to deploy and run the Web Based System
• .NET Framework Components are required in the Server where IIS Web Server
runs.
• SQL Server 2000 DBMS

5.3 Deployment
• Deploy the IssueManager system in IIS
• Attach the IssueManager database
• If the deployment is successful system can be accessed through
http://<servername>:<port>/IssueManager/Login.aspx

Note: - ApplicationMessage file under ..\IssueManager\App_GlobalResources directory


following tag consists of database connection string. Please change the server, uid and
pwd accordingly.

<data name="CONNECTION_STRING" xml:space="preserve">


<value>server=.;database=IssueManager;uid=sa; pwd =sasql</value>
<comment>connectionString</comment>
</data>

CM30067-M Enterprise Database System Page 12 of 53


Group Assignment Helpdesk Case Study

6.0 Proposed System Features


Below is a guideline on how to Record and Edit Issues to show the progress

 Login Page – Enter User Name and Password of the person login and click on
“Login” Ex: - User Name: Vindya Password: password123

 If successfully logged in Issue Summary Page will be displayed

CM30067-M Enterprise Database System Page 13 of 53


Group Assignment Helpdesk Case Study

 To Create an Issue Click on “Create Issue” and the following page will be
displayed

 Enter all relevant information as shown below and click on the “Assign” button

CM30067-M Enterprise Database System Page 14 of 53


Group Assignment Helpdesk Case Study

 All Engineers that are available are shown for the operator to select the relevant
engineer to assign the issue to

 Skills which each engineer specialise in can be viewed by clicking on the “Select”
link for each specialist under “Show Skills”

CM30067-M Enterprise Database System Page 15 of 53


Group Assignment Helpdesk Case Study

CM30067-M Enterprise Database System Page 16 of 53


Group Assignment Helpdesk Case Study

 Select the appropriate Engineer and Click on “Save”

CM30067-M Enterprise Database System Page 17 of 53


Group Assignment Helpdesk Case Study

 Once the issue is recorded successfully it will return to the Issue Summary page
where you can view the issue just recorded. In the issue summary table it will
record the Issue ID, Issue Summary, Reported Date and Time, Caller Name
(Reported By), Specialist Name (Assigned To), Operator Name (Recorded By),
Severity and Status (Created, In Progress, Close)

CM30067-M Enterprise Database System Page 18 of 53


Group Assignment Helpdesk Case Study

 Once the specialist logins to the system he/she can select the relevant issues
assigned to them. To update the progress of the issue click on “Select” under
“Edit”

 When a specialist needs to update a particular issue with the progress made the
create issue screen will be displayed again for editing

CM30067-M Enterprise Database System Page 19 of 53


Group Assignment Helpdesk Case Study

 Specialist can change the status of the issue to “In Progress” and add a comment
with the progress done and save the record as then it can be used in follow up
calls to give the progress to the caller

 Once the comment is successfully added it will return to the Issue Summary page
and the relevant issue can be selected again to view the comment just added. It

CM30067-M Enterprise Database System Page 20 of 53


Group Assignment Helpdesk Case Study

will record the Name of the person who added the comment. (Login user name of
the specialist)

 Follow up calls can also be accommodated in the same way. Commented by


person will be the operator in this case

CM30067-M Enterprise Database System Page 21 of 53


Group Assignment Helpdesk Case Study

 When an issue can be solved by the operator itself the flow of events will be as
follows. When the issue is created the status can be straight away changed to
“Close”

CM30067-M Enterprise Database System Page 22 of 53


Group Assignment Helpdesk Case Study

 Once the status is changed to “Close” the “Assign” button will automatically
change to “Save” and the issue can be saved

 Once the issue is saved successfully the below shown screen will be displayed

CM30067-M Enterprise Database System Page 23 of 53


Group Assignment Helpdesk Case Study

 Issue Summary page will be as below. Status of relevant issue is shown as closed

CM30067-M Enterprise Database System Page 24 of 53


Group Assignment Helpdesk Case Study

Data Entering Forms

 Entering Data to the Issue Type table. Click on “Add” Enter the relevant data and
click on “Save”

CM30067-M Enterprise Database System Page 25 of 53


Group Assignment Helpdesk Case Study

 Entering Data to the Solutions table. Click on “Add” and enter the relevant data
and then click on “Save”

CM30067-M Enterprise Database System Page 26 of 53


Group Assignment Helpdesk Case Study

 Enterting Data to the Hardware table. Click on “Add” Enter the relevant data and
click on “Save”

CM30067-M Enterprise Database System Page 27 of 53


Group Assignment Helpdesk Case Study

 Entering Data to the Software table. Click on “Add” Enter the relevant data and
click on “Save”

CM30067-M Enterprise Database System Page 28 of 53


Group Assignment Helpdesk Case Study

 Entering data to the Employee table. Click on “Add” Enter relevant data and click
on “Save”

CM30067-M Enterprise Database System Page 29 of 53


Group Assignment Helpdesk Case Study

 Editing Data in the Solutions table. Select the appropriate Solution to Edit

CM30067-M Enterprise Database System Page 30 of 53


Group Assignment Helpdesk Case Study

 Click on the “Edit” Button and make the necessary changes

 Once the changes are done click on the “Save” button

CM30067-M Enterprise Database System Page 31 of 53


Group Assignment Helpdesk Case Study

 Deleting a particular record in the Solutions table. Select the record to be deleted
and click on “Delete”

 Click on “Confirm Delete” if the record is to be deleted from the Database.

CM30067-M Enterprise Database System Page 32 of 53


Group Assignment Helpdesk Case Study

 Once the record is successfully deleted below shown screen will be displayed

 Due to time constraints the Edit, Delete and Reset functions were implemented
only in the Solutions data entry form. Similar implementation needs to be applied
in other master data setup forms.

CM30067-M Enterprise Database System Page 33 of 53


Group Assignment Helpdesk Case Study

7.0 Testing

7.1 System Functional Testing


During the development module testing and system integration testing was done in the
developer level.

7.2 Front-end Testing


Application Testing was done to identify if error messages were displayed when
validations such as below were violated. In the Create Issue page Issue Summary,
Description, Issue reported time, Issue reported date, Software or Hardware serial number
cannot be blank else it will not allow for an issue to be assigned to an engineer. In the
Assign Issue to Engineer page an engineer has to be selected if not it will not allow for
the record to be saves successfully.

7. 3 Database Testing
Database Design testing was done to determine if Referential Integrity was enforced and
to ensure that any violations to it was not allowed. Testing done is as follows.
1. A record in the Issue Type table cannot be deleted when there is a referencing
record in the Issue table.
2. A record in the department table cannot be deleted when there are referencing
records in the Employee table
3. A record in the Software table cannot be deleted when there are referencing
records in the Issue table
4. A record in the Hardware table cannot be deleted when there are referencing
records in the Issue table
5. A record from the Employee table cannot be deleted when there are referencing
records in the Issue table under Operator_ID, Caller_ID and Assigned_To fields
6. A record in the Solution table cannot be deleted when there are referencing
records in the Issue table

CM30067-M Enterprise Database System Page 34 of 53


Group Assignment Helpdesk Case Study

Testing was also done to ensure that no Primary Key violation was done by not entering a
Primary Key or by trying to duplicate an already existing record.

8.0 Reports
03 reports were developed to assist in the analysis of the Helpdesk operations
 All previous issues of a particular type to see if the same issue has occurred before
and if so how it was solved

 Click on the link Issues and Solutions

 Select the relevant Issue Type for which the report is required

CM30067-M Enterprise Database System Page 35 of 53


Group Assignment Helpdesk Case Study

 As a result the following report will be displayed

 All previous issues with the same caller to identify if there were other related issues
that may give some clue as to how the current issue can be solved

 Click on the link “Issues By Caller”

CM30067-M Enterprise Database System Page 36 of 53


Group Assignment Helpdesk Case Study

 Select the name of the caller

 Report displayed will be as follows

CM30067-M Enterprise Database System Page 37 of 53


Group Assignment Helpdesk Case Study

 Each Engineers workload

 Click on the link “Engineers Workload”

CM30067-M Enterprise Database System Page 38 of 53


Group Assignment Helpdesk Case Study

 The following report will be displayed with the number of issues assigned to
each specialist

Following 02 reports were also developed to display upon request

 All outstanding/unsolved problems within a problem area/issue type

 Click on the link “By Issue Type”

CM30067-M Enterprise Database System Page 39 of 53


Group Assignment Helpdesk Case Study

 In the following page displayed select the relevant problem area which require
analysis

 As a result below report will be displayed in another window

CM30067-M Enterprise Database System Page 40 of 53


Group Assignment Helpdesk Case Study

 All outstanding/unsolved problems currently assigned to a specialist

 Click on the link “By Specialist”

 Select the relevant specialist from the drop down list

CM30067-M Enterprise Database System Page 41 of 53


Group Assignment Helpdesk Case Study

 As a result the below report will be displayed in a new window

CM30067-M Enterprise Database System Page 42 of 53


Group Assignment Helpdesk Case Study

9.0 Conclusion
After analysing the case study we were able to design and develop a SQL server database
to cater to the proposed solutions. At the end we designed and implemented a proper and
efficient database by following proper database design techniques such as Entity
Relationship Diagrams and Normalization.

To allow users to interact with the developed database, web based interfaces were crated
using ASP .NET and C#. This helps the users to easily enter, update, delete and retrieve
data from and into the database. Data integrity, consistency and redundancy were handled
by the DBMS properly since it was designed and implemented properly.

Further more this application can be improved in many ways in terms of features,
functionality and analysis/management reports. The current application developed is not
sufficient to utilise the full potential of the designed database scheme.

CM30067-M Enterprise Database System Page 43 of 53


Group Assignment Helpdesk Case Study

10.0 Work Load Matrix


ID Task Resource
1 Case Study Analysis Vindya, Leshani, Iroshini
System Design
2 System Design Vindya, Leshani
3 Front-end Design Vindya, Leshani, Iroshini
Database Design
4 Identify Entity, Attributes, Relationships Vindya, Leshani, Iroshini
5 Draw ER Diagram Leshani
6 Write Database Scheme Leshani, Vindya
7 Normalization Leshani, Vindya
Database Development
8 Create Table, View, Functions Vindya
9 Create Constraints Vindya
System Development
10 Front-end Development Leshani
11 Backend Development Leshani
System Testing
12 Front-end Testing Leshani, Vindya
13 Functional Testing Leshani, Vindya
Documentation
14 Documentation Vindya, Leshani, Iroshini

I hereby agree that the above mentioned workload matrix is correct

........................................... ........................................... ............................................


Leshani De Silva Vindya Withana Iroshini Amarapathy

CM30067-M Enterprise Database System Page 44 of 53


Group Assignment Helpdesk Case Study

Bibliography
1. Korth and Silberschatz et. al., Database Systems Concepts, 2006, Osbourne
McGraw Hill, ISBN: 007124476

2. Date, C. J., An Introduction to Database Systems, 2006, Pearson Education Asia

3. Database Normalisation Techniques. [Online]


Available at: http://support.microsoft.com/kb/100139
[Accessed on: 25th February 2008]

4. Tutorial on Entity-Relationship Diagrams, February 2, 2007. [Online]


Available at: http://www.ugrad.cs.ubc.ca/~cs304/2006W2/tutorials/er/answer.pdf
[Accessed on: 25th February 2008]

5. Class and Entity-Relationship Diagrams. [Online]


Available at:
http://www.cdf.toronto.edu/~csc340h/summer/tutorials/TutorialClassERD.pdf
[Accessed on: 25th February 2008]

6. Microsoft - MSDN [Online]


Available at: http://msdn2.microsoft.com/en-us/default.aspx
[Accessed on: 01st March 2008]

7. ASP.NET [Online]
Available at: http://www.asp.net/
[Accessed on: 01st March 2008]

CM30067-M Enterprise Database System Page 45 of 53


Group Assignment Helpdesk Case Study

Appendix A
All DDL statements of Tables, View and Functions creation and all Primary and Foreign
Key creations are shown below

1. Tables
CREATE TABLE [dbo].[DEPARTMENT]
([DEPARTMENT_ID] [int] IDENTITY (1, 1) NOT NULL,
[NAME] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DESCRIPTION] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[EMPLOYEE]


([EMPLOYEE_ID] [int] IDENTITY (1, 1) NOT NULL ,
[FIRST_NAME] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[LAST_NAME] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[JOB_TITLE] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[DEPARTMENT_ID] [int] NOT NULL,
[DEVISION] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[EMPLOYEE_ISSUE_TYPE]


([EMPLOYEE_ID] [int] NOT NULL,
[ISSUE_TYPE_ID] [int] NOT NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[HARDWARE]


([HARDWARE_ID] [int] IDENTITY (1, 1) NOT NULL,
[SERIAL_NO] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[NAME] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[HARDWARE_PART]


([PART_ID] [int] IDENTITY (1, 1) NOT NULL,
[PART_NAME] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[SERIAL_NO] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[HARDWARE_ID] [int] NOT NULL
) ON [PRIMARY]

CM30067-M Enterprise Database System Page 46 of 53


Group Assignment Helpdesk Case Study

CREATE TABLE [dbo].[ISSUE]


([ISSUE_ID] [int] IDENTITY (1, 1) NOT NULL,
[ISSUE_TYPE_ID] [int] NOT NULL,
[ISSUE_SUMMARY] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[DESCRIPTION] [varchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[DATE_OF_CALL] [datetime] NOT NULL,
[TIME_OF_CALL] [datetime] NOT NULL,
[OPERATOR_ID] [int] NOT NUL ,
[CALLER_ID] [int] NOT NULL,
[ASSIGNED_TO] [int] NOT NULL,
[SEVERITY] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[STATUS] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SOFTWARE_ID] [int] NOT NULL,
[HARDWARE_ID] [int] NOT NULL,
[COMMENT_ID] [int] NOT NULL,
[SOLUTION_ID] [int] NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[ISSUE_COMMENT]


([ISSUE_ID] [int] NOT NULL,
[COMMENT_ID] [int] IDENTITY (1, 1) NOT NULL,
[COMMENT] [varchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[COMMENT_DATE] [datetime] NOT NULL,
[COMMENTED_BY] [int] NOT NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[ISSUE_TASK]


([ISSUE_TYPE_ID] [int] NOT NULL,
[RESPONSE_DATE] [datetime] NOT NULL,
[ASSIGNED_TO] [int] NOT NULL,
[ASSIGNED_BY] [int] NOT NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[ISSUE_TYPE]


([ISSUE_TYPE_ID] [int] IDENTITY (1, 1) NOT NULL,
[ISSUE_TYPE] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[DESCRIPTION] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

CM30067-M Enterprise Database System Page 47 of 53


Group Assignment Helpdesk Case Study

CREATE TABLE [dbo].[SOFTWARE]


([SOFTWARE_ID] [int] IDENTITY (1, 1) NOT NULL,
[NAME] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DESCRIPTION] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[VERSION] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SERIAL_NO] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[LICENSED] [bit] NOT NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[SOLUTION]


([SOLUTION_ID] [int] IDENTITY (1, 1) NOT NULL,
[SUMMARY] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[STEPS] [varchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[USER] (


[EMPLOYEE_ID] [int] NOT NULL,
[USER_NAME] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL,
[PASSWORD] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL
) ON [PRIMARY]

2. Primary Keys

ALTER TABLE [dbo].[EMPLOYEE_ISSUE_TYPE] WITH NOCHECK ADD


CONSTRAINT [PK_EMPLOYEE_ISSUE_TYPE] PRIMARY KEY CLUSTERED
([EMPLOYEE_ID], [ISSUE_TYPE_ID]) ON [PRIMARY]

ALTER TABLE [dbo].[DEPARTMENT] WITH NOCHECK ADD


CONSTRAINT [PK_DEPARTMENT] PRIMARY KEY CLUSTERED
([DEPARTMENT_ID]) ON [PRIMARY]

ALTER TABLE [dbo].[EMPLOYEE] WITH NOCHECK ADD


CONSTRAINT [PK_EMPLOYEE] PRIMARY KEY CLUSTERED
([EMPLOYEE_ID]) ON [PRIMARY]

ALTER TABLE [dbo].[HARDWARE] WITH NOCHECK ADD


CONSTRAINT [PK_HARDWARE] PRIMARY KEY CLUSTERED
([HARDWARE_ID]) ON [PRIMARY]

CM30067-M Enterprise Database System Page 48 of 53


Group Assignment Helpdesk Case Study

ALTER TABLE [dbo].[HARDWARE_PART] WITH NOCHECK ADD


CONSTRAINT [PK_HARDWARE_PART] PRIMARY KEY CLUSTERED
([PART_ID]) ON [PRIMARY]

ALTER TABLE [dbo].[ISSUE] WITH NOCHECK ADD


CONSTRAINT [PK_ISSUE] PRIMARY KEY CLUSTERED
([ISSUE_ID]) ON [PRIMARY]

ALTER TABLE [dbo].[ISSUE_COMMENT] WITH NOCHECK ADD


CONSTRAINT [PK_ISSUE_COMMENT] PRIMARY KEY CLUSTERED
([COMMENT_ID]) ON [PRIMARY]

ALTER TABLE [dbo].[ISSUE_TASK] WITH NOCHECK ADD


CONSTRAINT [PK_ISSUE_TASK] PRIMARY KEY CLUSTERED
([ISSUE_TYPE_ID]) ON [PRIMARY]

ALTER TABLE [dbo].[ISSUE_TYPE] WITH NOCHECK ADD


CONSTRAINT [PK_ISSUE_TYPE] PRIMARY KEY CLUSTERED
([ISSUE_TYPE_ID]) ON [PRIMARY]

ALTER TABLE [dbo].[SOFTWARE] WITH NOCHECK ADD


CONSTRAINT [PK_SOFTWARE] PRIMARY KEY CLUSTERED
([SOFTWARE_ID]) ON [PRIMARY]

ALTER TABLE [dbo].[SOLUTION] WITH NOCHECK ADD


CONSTRAINT [PK_SOLUTION] PRIMARY KEY CLUSTERED
([SOLUTION_ID]) ON [PRIMARY]

3.0 Foreign Keys

ALTER TABLE [dbo].[EMPLOYEE] ADD


CONSTRAINT [FK_EMPLOYEE_DEPARTMENT] FOREIGN KEY
([DEPARTMENT_ID]) REFERENCES [dbo].[DEPARTMENT]
([DEPARTMENT_ID])

ALTER TABLE [dbo].[EMPLOYEE_ISSUE_TYPE] ADD


CONSTRAINT [FK_EMPLOYEE_ISSUE_TYPE_EMPLOYEE] FOREIGN KEY
([EMPLOYEE_ID]) REFERENCES [dbo].[EMPLOYEE]
([EMPLOYEE_ID]),
CONSTRAINT [FK_EMPLOYEE_ISSUE_TYPE_ISSUE_TYPE] FOREIGN KEY
([ISSUE_TYPE_ID]) REFERENCES [dbo].[ISSUE_TYPE]
([ISSUE_TYPE_ID])

ALTER TABLE [dbo].[HARDWARE_PART] ADD


CONSTRAINT [FK_HARDWARE_PART_HARDWARE] FOREIGN KEY
([HARDWARE_ID]) REFERENCES [dbo].[HARDWARE]
([HARDWARE_ID])

CM30067-M Enterprise Database System Page 49 of 53


Group Assignment Helpdesk Case Study

ALTER TABLE [dbo].[ISSUE] ADD


CONSTRAINT [FK_ISSUE_EMPLOYEE_CALLER] FOREIGN KEY
([CALLER_ID] ) REFERENCES [dbo].[EMPLOYEE]
([EMPLOYEE_ID]),
CONSTRAINT [FK_ISSUE_EMPLOYEE_OPERATOR] FOREIGN KEY
([OPERATOR_ID]) REFERENCES [dbo].[EMPLOYEE]
([EMPLOYEE_ID]),
CONSTRAINT [FK_ISSUE_HARDWARE] FOREIGN KEY
([HARDWARE_ID]) REFERENCES [dbo].[HARDWARE]
([HARDWARE_ID]),
CONSTRAINT [FK_ISSUE_ISSUE_COMMENT] FOREIGN KEY
([COMMENT_ID]) REFERENCES [dbo].[ISSUE_COMMENT]
([COMMENT_ID]),
CONSTRAINT [FK_ISSUE_ISSUE_TYPE] FOREIGN KEY
([ISSUE_TYPE_ID]) REFERENCES [dbo].[ISSUE_TYPE]
([ISSUE_TYPE_ID]),
CONSTRAINT [FK_ISSUE_SOFTWARE] FOREIGN KEY
([SOFTWARE_ID]) REFERENCES [dbo].[SOFTWARE]
([SOFTWARE_ID]),
CONSTRAINT [FK_ISSUE_SOLUTION] FOREIGN KEY
([SOLUTION_ID]) REFERENCES [dbo].[SOLUTION]
([SOLUTION_ID])

ALTER TABLE [dbo].[ISSUE] nocheck constraint [FK_ISSUE_ISSUE_COMMENT]

ALTER TABLE [dbo].[USER] ADD


CONSTRAINT [FK_USER_EMPLOYEE] FOREIGN KEY
([EMPLOYEE_ID]) REFERENCES [dbo].[EMPLOYEE]
([EMPLOYEE_ID])

4. Views

CREATE VIEW dbo.VIEW_EMPLOYEE_SPECIALIZATION


AS SELECT
E.EMPLOYEE_ID,
EIT.ISSUE_TYPE_ID,
IT.ISSUE_TYPE,
IT.DESCRIPTION
FROM dbo.EMPLOYEE E INNER JOIN dbo.EMPLOYEE_ISSUE_TYPE EIT ON
E.EMPLOYEE_ID = EIT.EMPLOYEE_ID
INNER JOIN dbo.ISSUE_TYPE IT ON EIT.ISSUE_TYPE_ID = IT.ISSUE_TYPE_ID

CM30067-M Enterprise Database System Page 50 of 53


Group Assignment Helpdesk Case Study

CREATE VIEW dbo.VIEW_ENGINEER_WORK_LOAD


AS SELECT
dbo.EMPLOYEE.EMPLOYEE_ID,
dbo.EMPLOYEE.FIRST_NAME,
dbo.EMPLOYEE.LAST_NAME,
dbo.EMPLOYEE.JOB_TITLE,
COUNT (dbo.ISSUE.ASSIGNED_TO) AS NO_OF_ISSUES_ASSIGNED
FROM dbo.EMPLOYEE LEFT OUTER JOIN dbo.ISSUE ON
dbo.EMPLOYEE.EMPLOYEE_ID = dbo.ISSUE.ASSIGNED_TO
GROUP BY dbo.ISSUE.ASSIGNED_TO, dbo.EMPLOYEE.EMPLOYEE_ID,
dbo.EMPLOYEE.FIRST_NAME,
dbo.EMPLOYEE.LAST_NAME,
dbo.EMPLOYEE.JOB_TITLE

CREATE VIEW dbo.VIEW_ISSUE_SUMMARY


AS SELECT
ISSUE_ID,
ISSUE_SUMMARY,
DATE_OF_CALL,
dbo.FN_GET_EMPLOYEE_NAME_BY_ID (CALLER_ID) AS CALLER_NAME,
dbo.FN_GET_EMPLOYEE_NAME_BY_ID (ASSIGNED_TO) AS ASSIGNED_TO,
dbo.FN_GET_EMPLOYEE_NAME_BY_ID(OPERATOR_ID) AS OPERATOR_ID,
SEVERITY,
STATUS
FROM dbo.ISSUE I
CREATE VIEW dbo.VIEW_OUTSTANDING_ISSUES
AS SELECT
ISSUE_ID,
ISSUE_TYPE_ID,
dbo.FN_GET_ISSUE_TYPE_BY_ID (ISSUE_TYPE_ID) AS ISSUE_TYPE,
ISSUE_SUMMARY,
DESCRIPTION,
DATE_OF_CALL,
TIME_OF_CALL,
dbo.FN_GET_EMPLOYEE_NAME_BY_ID(CALLER_ID) AS CALLER_NAME,
dbo.FN_GET_EMPLOYEE_NAME_BY_ID(ASSIGNED_TO) AS ASSIGNED_TO,
dbo.FN_GET_EMPLOYEE_NAME_BY_ID(OPERATOR_ID) AS OPERATOR_ID,
SEVERITY,
STATUS,
dbo.FN_GET_SERIAL_NO_BY_ID(SOFTWARE_ID,HARDWARE_ID) AS SERIAL_NO
FROM dbo.ISSUE I
WHERE (STATUS <> 'Close')

CM30067-M Enterprise Database System Page 51 of 53


Group Assignment Helpdesk Case Study

CREATE VIEW dbo.VIEW_SOLUTIONS_BY_ISSUE_TYPE


AS SELECT
ISSUE_ID,
ISSUE_TYPE_ID,
dbo.FN_GET_ISSUE_TYPE_BY_ID(ISSUE_TYPE_ID) AS ISSUE_TYPE,
ISSUE_SUMMARY,
DESCRIPTION,
DATE_OF_CALL,
TIME_OF_CALL,
dbo.FN_GET_EMPLOYEE_NAME_BY_ID(CALLER_ID) AS CALLER_NAME,
dbo.FN_GET_EMPLOYEE_NAME_BY_ID(ASSIGNED_TO) AS ASSIGNED_TO,
dbo.FN_GET_EMPLOYEE_NAME_BY_ID(OPERATOR_ID) AS OPERATOR_ID,
dbo.FN_GET_SOLUTION_STEPS_BY_ID(SOLUTION_ID) AS SOLUTION_STEPS,
STATUS,
dbo.FN_GET_SERIAL_NO_BY_ID(SOFTWARE_ID,
HARDWARE_ID) AS SERIAL_NO
FROM dbo.ISSUE I

3.0 Functions

CREATE FUNCTION FN_GET_EMPLOYEE_NAME_BY_ID(@EmployeeId int)


RETURNS Varchar(40) AS
BEGIN
DECLARE @EMPLOYEE_ID Varchar(20)
SET @EMPLOYEE_ID = (SELECT FIRST_NAME FROM EMPLOYEE WHERE
EMPLOYEE_ID = @EmployeeId)
RETURN @EMPLOYEE_ID
END

CREATE FUNCTION FN_GET_ISSUE_TYPE_BY_ID(@IssueTypeId int)


RETURNS Varchar(40) AS
BEGIN
DECLARE @ISSUE_TYPE Varchar(20)
SET @ISSUE_TYPE = (SELECT ISSUE_TYPE FROM ISSUE_TYPE WHERE
ISSUE_TYPE_ID = @IssueTypeId)
RETURN @ISSUE_TYPE
END

CREATE FUNCTION FN_GET_SERIAL_NO_BY_ID(@SW_ID int, @HW_ID int)


RETURNS Varchar(40) AS
BEGIN
DECLARE @SERIAL_NO_SW Varchar(20)
DECLARE @SERIAL_NO_HW Varchar(20)
DECLARE @SERIAL_NO Varchar(20)
SET @SERIAL_NO_SW = (SELECT SERIAL_NO FROM SOFTWARE WHERE
SOFTWARE_ID = @SW_ID)
SET @SERIAL_NO_HW = (SELECT SERIAL_NO FROM HARDWARE WHERE
HARDWARE_ID = @HW_ID)
IF @SERIAL_NO_SW <> 'N/A'

CM30067-M Enterprise Database System Page 52 of 53


Group Assignment Helpdesk Case Study

SET @SERIAL_NO = @SERIAL_NO_SW


IF @SERIAL_NO_HW <> 'N/A'
SET @SERIAL_NO = @SERIAL_NO_HW
RETURN @SERIAL_NO
END

CREATE FUNCTION FN_GET_SOLUTION_STEPS_BY_ID(@Solution_ID int)


RETURNS Varchar(200) AS
BEGIN
DECLARE @STEPS Varchar(200)
SET @STEPS = (SELECT STEPS FROM SOLUTION WHERE SOLUTION_ID =
@Solution_ID)
RETURN @STEPS
END

CM30067-M Enterprise Database System Page 53 of 53

Potrebbero piacerti anche