0% found this document useful (0 votes)
4K views69 pages

ICT501 Group3 Final Report

This document proposes a database management system for OceanCare Corporation. It includes entity relationship diagrams and relational schemas to model the company's projects, customers, employees, equipment, reports, and other entities. It also provides sample SQL commands for creating tables and manipulating data. Screenshots of the proposed interface are included, along with sample outputs from queries. The system is intended to help OceanCare manage project and customer information more efficiently.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4K views69 pages

ICT501 Group3 Final Report

This document proposes a database management system for OceanCare Corporation. It includes entity relationship diagrams and relational schemas to model the company's projects, customers, employees, equipment, reports, and other entities. It also provides sample SQL commands for creating tables and manipulating data. Screenshots of the proposed interface are included, along with sample outputs from queries. The system is intended to help OceanCare manage project and customer information more efficiently.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

FACULTY OF SCIENCE COMPUTER AND MATHEMATICAL SCIENCES

CS240 BACHELOR OF INFORMATION TECHNOLOGY (HONS.)

ICT501– DATABASE MANAGEMENT SYSTEMS


[MAC 2022 – JULY 2022]

PROPOSAL PROJECT
OCEANCARE CORPORATION
DATABASE MANAGEMENT SYSTEM

GROUP: CS2403C

NAME STUDENT ID
SHERMAN FARLY ANAK MULI 2022764733
AMY NAZEERA BINTI NAFRIZAN 2022971971
AMY NAZEERA BINTI NAFRIZAN 2022765125
ANIS NABIHAH BINTI MOHD JAIS 2022949507

SUBMITTED FOR:

DR. NOR AZIAH BINTI DAUD

1
GROUP MEMBER INTRODUCTION
GROUP NAME: GROUP 3
SYSTEM NAME: OCEANCARE MANAGEMENT SYSTEM

Name: Sherman Farly anak Muli


Student ID No.: 2022764733
Phone No.: 0195642414
Email: mfarlysherman@gmail.com
Role: Project Manager
Responsibilities: Managing the task for all the team and plan work activities.

Name: Muhammad Akmal bin Mohd Zahar


Student ID No.: 2022971971
Phone No.: 01160726724
Email: akmalkaka07@gmail.com
Role: Software Engineer
Responsibilities: Design the system interface as well as testing & troubleshooting.

2
Name: Amy Nazeera Binti Nafrizan
Student ID No.: 2022765125
Phone No.: 01165650978
Email: amynazeera18@gmail.com
Role: System Analyst
Responsibilities: Write requirements for new systems and implement them.

Name: Anis Nabihah binti Mohd Jais


Student ID No.: 2022949507
Phone No.: 0116276801
Email: 2022949507@isiswa.uitm.edu.my
Role: Database Administrator
Responsibilities: Ensure that the databases run efficiently and securely.

3
TABLE OF CONTENT
1. CASE STUDY .......................................................................................................... 7

COMPANY BACKGROUND .............................................................................................. 7


PROBLEM STATEMENT .................................................................................................. 9
OBJECTIVE ................................................................................................................... 9
BUSINESS RULES ........................................................................................................10

2. ENTITY RELATIONAL DIAGRAM (ERD) ...............................................................15

3. 3NF RELATIONAL SCHEMA .................................................................................16

4. ENTITIES AND DATA INTEGRITY .........................................................................17

5. ENTITY RELATIONAL DIAGRAM NARRATIVE ....................................................17

6. SQL COMMANDS ..................................................................................................27

DATA DEFINITION LANGUAGE (DDL) .............................................................................27


DATA MANIPULATION LANGUAGE (DML) .......................................................................35

7. DATABASE SYSTEM’S INTERFACE ....................................................................47

HOME ........................................................................................................................47
DASHBOARD ............................................................................................................51

8. QUERIES AND OUTPUTS......................................................................................57

9. CONCLUSION ........................................................................................................62

10. REFERENCES ....................................................................................................63

11. APPENDICES .....................................................................................................64

USER MANUAL CREATE APP.........................................................................................64

4
TABLE OF FIGURES
FIGURE 1 COMPANY ORGANIZATIONAL CHART........................................................ 8
FIGURE 2 ERD PROJECTS WITH SERVICES ............................................................. 10
FIGURE 3 ERD PROJECT WITH EMPLOYEE ............................................................. 10
FIGURE 4 ERD PROJECT WITH REPORTS ................................................................ 11
FIGURE 5 ERD PROJECTS WITH CUSTOMERS ........................................................ 11
FIGURE 6 ERD DEPARTMENT WITH EMPLOYEES .................................................. 12
FIGURE 7 ERD REPORT WITH ACCIDENT RECORDS ............................................. 12
FIGURE 8 ERD EMPLOYEES BRIDGE EQUIPMENTS ............................................... 12
FIGURE 9 ERD CUSTOMER WITH EQUIPMENT ....................................................... 13
FIGURE 10 ERD EQUIPMENTS WITH PROTECTIVE EQUIPMENT............................ 14
FIGURE 11 ERD EQUIPMENTS WITH GENERAL TOOLS .......................................... 14
FIGURE 12 ENTITY RELATIONAL DIAGRAM ............................................................. 15
FIGURE 13 ENTITIES AND DATA INTEGRITY ........................................................... 17
FIGURE 14 ENTITIES RELATIONAL DIAGRAM NARRATIVE .................................... 18
FIGURE 24 DATA DEFINITION LANGUAGE ................................................................ 27
FIGURE 25 DATA DEFINITION LANGUAGE DROP TABLE USING MENU ................. 27
FIGURE 26 DATA DEFINITION LANGUAGE DROP TABLE USING COMMAND ......... 28
FIGURE 27 DATA MANIPULATION LANGUAGE ......................................................... 35
FIGURE 28 DATA MANIPULATION LANGUAGE ......................................................... 35
FIGURE 29 HOME PAGE ............................................................................................. 47
FIGURE 30 EMPLOYEE PAGE..................................................................................... 47
FIGURE 31 SERVICES PAGE ...................................................................................... 48
FIGURE 32 DEPARTMENTS PAGE ............................................................................. 48
FIGURE 33 CUSTOMERS PAGE ................................................................................. 48
FIGURE 34 PROJECTS PAGE ..................................................................................... 49
FIGURE 35 REPORTS PAGE ....................................................................................... 49
FIGURE 36 EQUIPMENTS PAGE................................................................................. 49
FIGURE 37 PROTECTIVE EQUIPMENTS PAGE ......................................................... 50
FIGURE 38 GENERALS TOOLS PAGE ........................................................................ 50
FIGURE 39 ACCIDENT RECORDS PAGE ................................................................... 50
FIGURE 40 DASHBOARD OF ACCIDENT CASES BY CATEGORY ............................ 51
FIGURE 41 DASHBOARD OF CASE OF INJURY ........................................................ 52

5
FIGURE 42 DASHBOARD OF PROJECT STATUS ..................................................... 53
FIGURE 43 DASHBOARD EQUIPMENT ...................................................................... 53
FIGURE 44 DASHBOARD OF PROTECTIVE EQUIPMENT ......................................... 54
FIGURE 45 DASHBOARD OF GENERALS TOOLS ..................................................... 54
FIGURE 46 DASHBOARD OF PROJECT SERVICE COST (MYR) ............................... 55
FIGURE 47 DASHBOARD OF TOTAL REPORTS ........................................................ 56
FIGURE 48 OUTPUT QUESTION 1 .............................................................................. 57
FIGURE 49 OUTPUT QUESTION 2 .............................................................................. 57
FIGURE 50 OUTPUT QUESTION 3 .............................................................................. 58
FIGURE 51 OUTPUT QUESTION 4 .............................................................................. 58
FIGURE 52 OUTPUT QUESTION 5 .............................................................................. 59
FIGURE 53 OUTPUT QUESTION 6 .............................................................................. 59
FIGURE 54 OUTPUT QUESTION 7 .............................................................................. 60
FIGURE 55 OUTPUT QUESTION 8 .............................................................................. 60
FIGURE 56 OUTPUT QUESTION 9 .............................................................................. 61
FIGURE 57 OUTPUT QUESTION 10 ............................................................................ 61
FIGURE 58 USER MANUAL STEP 1 ............................................................................ 64
FIGURE 59 USER MANUAL STEP 2 ............................................................................ 64
FIGURE 60 USER MANUAL STEP 3 ............................................................................ 65
FIGURE 61 USER MANUAL STEP 4 ............................................................................ 65
FIGURE 62 USER MANUAL STEP 5 ............................................................................ 66
FIGURE 63 USER MANUAL STEP 6 ............................................................................ 66
FIGURE 64 USER MANUAL STEP 6 ............................................................................ 67
FIGURE 65 USER MANUAL STEP 7 ............................................................................ 67
FIGURE 66 USER MANUAL STEP 8 ............................................................................ 68
FIGURE 67 USER MANUAL STEP 9 ............................................................................ 68
FIGURE 68 USER MANUAL STEP 10 .......................................................................... 69
FIGURE 69 USER MANUAL STEP 11 .......................................................................... 69

6
1. CASE STUDY
Company Background

Company’s Logo

Company’s Name Oceancare Corporation Sdn. Bhd


2nd, 3rd & 5th Floor, Wisma Yong Lung, Lot 698, Pelita
Address Commercial Centre, P.O. Box 1355, 98000 Miri, Sarawak,
Malaysia.
To be a service provider of choice for PETRONAS and the Oil &
Vision
Gas industry in Malaysia and beyond the boundaries.
To exceed the expectations of all our stakeholders in delivering
quality Oil & Gas services and products in a responsible, efficient,
Mission
cost effective, sustainable, ethical manner and consistent safety
commitment at all times.
Oceancare is committed to the proactive and successful
implementation of its quality management system (QMS) in line
Goal
with ISO 9001:2015 at all levels and undertakes improvement
programs to continually enhance our management system.
i. Material, Corrosion & Inspection Services
ii. Electrical Engineering, Maintenance and Manufacturing
Services
iii. Instrumentation Maintenance Services
Service provided
iv. Production, Drilling, Workover Associated Services
v. Mechanical Engineering & Maintenance Services
vi. Civil Maintenance Services
vii. Pipeline Maintenance and Associated Services

7
viii. Offshore Facilities Construction, Transport & Installation
Services
ix. Underwater Services
x. Air Transportation Services
xi. Valves, Welded Pipes, Pipe Fittings & Instruments
xii. Consultancy Services
Engineering, Procurement and Construction of Reception
i. Building for Sarawak Production Operations
ii. Provision of Operation and Maintenance Support Services
iii. Provision to Upgrade SBGAST Power Generation System
Engineering Procurement, Construction and
Products Commissioning
delivered iv. (EPCC) of New Power Generation System for
PETRONAS Carigali Sdn. Bhd.
v. Protection Relay Testing and Calibration
vi. Provision of Inspection, Servicing and Calibration
vii. Provision of Underwater Inspection and Maintenance
Services

Organizational
chart

Figure 1 Company Organizational Chart

8
Problem Statement
Most departments in this company are currently using systems provided by the Information
Technology Department, despite several systems provided and built by the IT department, we
found that some departments are using both new systems and manual systems to manage
and record data. The data provided by another department is usually inconsistent and difficult
to audit which can affect the efficiency of the company to provide better services due to these
circumstances.

Objective
Information Technology is a department that handles all the technological issues that
arise. Although they perform these tasks from time to time, they're actually much more vital to
the success of a business plan; they complete many more tasks behind the scenes than
people are aware of. In an overall sense, the IT Department is responsible for providing the
infrastructure for automation. It implements the governance for the use of network and
operating systems, and it assists the operational units by providing them the functionality they
need.

The project is a web-based application that allows the company to organize customer’s
data and information. By developing the system, the company will have a good directory that
is convenient to the company organization. The objective of this system:

i. To ease the department with providing services and store data using a practical and
efficient method.
ii. To keep exact records or info of customers from various companies and their services
ordered details.
iii. To help the company in better management of customer’s data and reduce data loss.

9
Business Rules
1.Many projects can do many services
Many-to-Many relationship

Figure 2 ERD Projects with Services

2. Many projects can be done by many employees


Many-to-many relationship

Figure 3 ERD Project with Employees

10
3. One project can have many report
One-to-Many relationship

Figure 4 ERD Project with Reports

4. One project can have many customers


One-to-Many relationship

Figure 5 ERD Projects with Customer

11
5. One department can have many employees
One-to-Many relationship

Figure 6 ERD Department with Employees

6. One report can have zero or more accident records


One-to-Zero or Many relationship

Figure 7 ERD Report with Accident Records

12
7. One employee can have many equipment
One-to-Many relationship

Figure 8 ERD Employees bridge Equipments

8. One customer can have many equipment

One-to-Many relationship

Figure 9 ERD Customer with Equipment

13
9. One equipment can be one protective equipment
One-to-one relationship

Figure 10 ERD Equipments with Protective Equipment

10. One equipment can be one general tools

One-to-One relationship

Figure 11 ERD Equipments with General Tools

14
2. ENTITY RELATIONAL DIAGRAM (ERD)

Figure 12 ER Diagram

15
3. 3NF RELATIONAL SCHEMA
OCMS_EMPLOYEES (EMP_ID, EMP_FN, EMP_LN, SALARY, PHONE_NO, EMAIL,
HIRE_DATE, *DEP_ID)
OCMS_SERVICES (SERVICE_ID, SERVICE_NAME, SERVICE_COST, *PROJECT_ID)
OCMS_DEPARTMENTS (DEP_ID, DEP_NAME, MANAGER_ID)
OCMS_CUSTOMERS (REG_ID, COMPANY_NAME, COMPANY_PHONENO,
COMPANY_EMAIL, ADDRESS)
OCMS_PROJECTS (PROJECT_ID, PROJECT_NAME, PROJECT_DATE,
PROJECT_STATUS, *EMP_ID, *REG_ID)
OCMS_REPORTS (REPORT_ID, REPORT_TYPE, REPORT_CATEGORY,
REPORT_DESC, REPORT_DATE, *EMP_ID, *REG_ID)
OCMS_ACCIDENT_RECORDS (ACCIDENT_CATEGORY, ACCIDENT_DESC,
ACCIDENT_DATE, ACCIDENT_SEVERITY, *REPORT_ID)
OCMS_EQUIPMENTS (EQUIPMENT_ID, EQUIPMENT_TYPE, EQUIPMENT_NAME,
EQUIPMENT_STATUS, QUANTITY, *EMP_ID, *REG_ID)
OCMS_PROTECTIVE_EQUIPMENTS (EQUIPMENT_ID, EQUIPMENT_TYPE,
EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
OCMS_GENERAL_TOOLS (EQUIPMENT_ID, EQUIPMENT_TYPE,
EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)

16
4. ENTITIES AND DATA INTEGRITY

Figure 13 Entities and Data Integrity

17
5. ENTITY RELATIONAL DIAGRAM NARRATIVE

ENTITY NAME: OCMS_EMPLOYEES


ENTITY EXPLANATION: Record Data of Employees

Attribute’s Explanation or Data Type Format PK/FK FK Reference Nullable


Name Contents Table

EMP_ID Employee’s ID NUMBER(6, 0) 000 PK No

EMP_FN Employee’s First VARCHAR2(2 XXXX Yes


Name 0) XXXX

EMP_LN Employee’s Last VARCHAR2(2 XXXX No


Name 5) XXXX

EMAIL Employee’s E- VARCHAR2(2 XXXX No


mail 5) XXXX
XXXX

PHONE_NO Employee’s VARCHAR2(2 XXXXXXX Yes


Phone Number 0) XXX

SALARY Employee’s Salar NUMBER(8, 2) 00.00 Yes


y

HIRE_DATE Employee’s Date DATE MM No


Hired DD
YYYY

DEP_ID Department’s ID NUMBER(4, 0) XXXX FK OCMS_DEPART Yes


XXXX MENTS

Figure 14 Entities Relational Diagram Narrative

18
ENTITY NAME: OCMS_DEPARTMENTS
ENTITY EXPLANATION: Record Data of Departments

Attribute’s Explanation or Data Type Format PK/ FK Nullable


Name Contents FK Reference
Table

DEP_ID Department’s ID NUMBER (4, 0000 PK No


0)

DEP_NAME Department’s VARCHAR2(3 XXXX No


Name 0) XXXX

MANAGER_ Manager’s ID NUMBER(6, 0) 000 FK OCMS_EMPLOYEES Yes


ID
Figure 15 Entities Relational Diagram Narrative

ENTITY NAME: OCMS_SERVICES


ENTITY EXPLANATION: Record Data of Services

Attribute’s Explanation or Data Type Format PK/ FK Nullable


Name Contents FK Reference
Table

SERVICE_ID Service ID VARCHAR2(6) XXXXXX PK No

SERVICE_N Service Name VARCHAR2( XXXX No


AME 50) XXXX

SERVICE_CO Service Cost NUMBER(8, 0000 Yes


ST 2)

PROJECT_ID Project ID VARCHAR2( XXXXXX FK OCMS_PROJECTS Yes


6)
Figure 16 Entities Relational Diagram Narrative

19
ENTITY NAME: OCMS_CUSTOMERS
ENTITY EXPLANATION: Record Data of Customers

Attribute’s Explanation or Data Type Format PK/ FK Nullable


Name Contents FK Reference
Table

REG_ID Company’s NUMBER(6, 0) XXXXXX PK No


Registration ID

COMPANY_ Company’s VARCHAR2(30 XXXX No


NAME Name ) XXXX

COMPANY_ Company’s VARCHAR2( XXXX Yes


PHONENO Phone Number 25) XXXX

COMPANY_ Company’s E- VARCHAR2( XXXX No


EMAIL mail 30) XXXX

ADDRESS Company’s VARCHAR2( XXXXXX FK OCMS_PROJECT Yes


Address 40) S

CITY Company’s VARCHAR2( XXXX Yes


Location 30) XXXX

POSTAL_CO Company’s VARCHAR2( XXXXXX Yes


DE Location Postal 10)
Code
Figure 17 Entities Relational Diagram Narrative

20
ENTITY NAME: OCMS_PROJECTS
ENTITY EXPLANATION: Record Data of Projects

Attribute’s Explanation or Data Type Format PK/ FK Nullable


Name Contents FK Reference
Table

PROJECT_ID Project ID VARCHAR2(6) XXXXXX PK No

PROJECT_NA Project Name VARCHAR2(40 XXXX No


ME ) XXXX

PROJECT_DA Project Date DATE MM No


TE DD
YYY

PROJECT_ST Project Status VARCHAR2(1 XXXX Yes


ATUS 5) XXXX

EMP_ID Employee’s ID NUMBER(6, 0) 000 FK OCMS_EMPLOY Yes


EES

REG_ID Company’s NUMBER(6, 0) 0000 FK OCMS_CUSTOM Yes


Registration ID ERS
Figure 18 Entities Relational Diagram Narrative

21
ENTITY NAME: OCMS_REPORTS
ENTITY EXPLANATION: Record Data of Reports

Attribute’s Explanation or Data Type Format PK/ FK Nullable


Name Contents FK Reference
Table

REPORT_ID Report ID VARCHAR2(6) XXXXXX PK No

REPORT_TYP Report Type VARCHAR2(25 XXXX Yes


E ) XXXX

REPORT_CAT Report VARCHAR2(2 Yes


EGORY Category 5)

REPORT_DES Report VARCHAR2(2 XXXXX Yes


C Description 000) XXXX

REPORT_DAT Report Date DATE MM


E DD
YYY

EMP_ID Employee’s ID NUMBER(6, 0) 000 FK OCMS_EMPLOYEES Yes

REG_ID Company’s NUMBER(6, 0) 0000 FK OCMS_CUSTOMERS Yes


Registration ID
Figure 19 Entities Relational Diagram Narrative

22
ENTITY NAME: OCMS_ACCIDENT_RECORDS
ENTITY EXPLANATION: Record Data of Accident Records

Attribute’s Explanation or Data Type Format PK/ FK Nullable


Name Contents FK Reference
Table

ACCIDENT_C Accident VARCHAR2(25 XXXX Yes


ATEGORY Category )
XXXX

ACCIDENT_D Accident VARCHAR2(25 XXXX Yes


ESC Description 0) XXXX

ACCIDENT_D Accident Date DATE No


ATE

ACCIDENT_S Accident VARCHAR2(5 XXXX Yes


EVERITY Severity 0) XXXX

REPORT_ID Report ID VARCHAR2(6 XXXXXX FK OCMS_REPORTS Yes


)
Figure 20 Entities Relational Diagram Narrative

23
ENTITY NAME: OCMS_EQUIPMENTS (SUPERTYPE)
ENTITY EXPLANATION: Record Data of Equipment

Attribute’s Explanation or Data Type Format PK/ FK Nullable


Name Contents FK Reference
Table

EQUIPMENT Equipment ID VARCHAR2(6) XXXX PK No


_ID
XX

EQUIPMENT Equipment VARCHAR2(25 XXXX Yes


_TYPE Type ) XXXX

EQUIPMENT Equipment VARCHAR2( XXXX Yes


_NAME Name 50) XXXX

EQUIPMENT Equipment VARCHAR2( XXXX Yes


_STATUS Status 20) XXXX

QUANTITY Quantity of NUMBER


Equipment Yes

EMP_ID Employee’s ID NUMBER(6, 0) 000 FK OCMS_EMPLOYEES Yes

REG_ID Company’s NUMBER(6, 0) 0000 FK OCMS_CUSTOMERS


Registration ID Yes
Figure 21 Entities Relational Diagram Narrative

24
ENTITY NAME: OCMS_PROTECTIVE_EQUIPMENTS (SUBTYPE OCMS_EQUIPMENTS)
ENTITY EXPLANATION: Record Data of Protective Equipments

Attribute’s Explanation or Data Type Format PK/ FK Nullable


Name Contents FK Reference
Table

EQUIPMENT Equipment ID VARCHAR2(6) XXXX PK No


_ID XX

EQUIPMENT Equipment VARCHAR2(25 XXXX Yes


_TYPE Type ) XXXX

EQUIPMENT Equipment VARCHAR2( XXXX Yes


_NAME Name 50) XXXX

EQUIPMENT Equipment VARCHAR2( XXXX Yes


_STATUS Status 20) XXXX

QUANTITY Quantity of NUMBER Yes


Equipment
Figure 22 Entities Relational Diagram Narrative

25
ENTITY NAME: OCMS_GENERAL_TOOLS (SUBTYPE OCMS_EQUIPMENTS)
ENTITY EXPLANATION: Record Data of General Tools

Attribute’s Explanation or Data Type Format PK/ FK Nullable


Name Contents FK Reference
Table

EQUIPMENT Equipment ID VARCHAR2(6) XXXX PK No


_ID
XX

EQUIPMENT Equipment VARCHAR2(25 XXXX Yes


_TYPE Type ) XXXX

EQUIPMENT Equipment VARCHAR2( XXXX Yes


_NAME Name 50) XXXX

EQUIPMENT Equipment VARCHAR2( XXXX Yes


_STATUS Status 20) XXXX

QUANTITY Quantity of NUMBER


Equipment Yes
Figure 23 Entities Relational Diagram Narrative

26
6. SQL COMMANDS
Data Definition Language (DDL)
A data definition language (DDL) is a computer language that is used to design and alter
the structure of database items. Views, schemas, tables, and indexes are examples of database
objects. In certain circumstances, this phrase is also known as data description language since it
specifies the fields and records in a database table. DDL is now incorporated into every formal
language used to describe data in the database industry. However, it is regarded as a subset of
SQL (Structured Query Language). SQL frequently combines imperative verbs with conventional
English phrases to execute database changes. As a result, DDL does not appear as a separate
language in a SQL database but rather defines modifications to the database structure. It is used
to create and alter the structure of objects in a database by interacting with database schema
definitions. Unlike data manipulation language (DML) commands, which are used to modify data,
DDL commands are used to change the database structure, such as establishing new tables or
objects with all of their properties (data type, table name, etc.). CREATE, ALTER, DROP, and
TRUNCATE are often used DDL in SQL queries.
Click on the drop button

Figure 24 Data Definition Language

Then drop the table

Figure 25 Data Definition Language Drop Table using menu

27
The other way is to enter the command below in the SQL Commands

Figure 26 Data Definition Language Drop Table using command

CREATE TABLE

1. OCMS_EMPLOYEES TABLE
CREATE TABLE OCMS_EMPLOYEES(
EMP_ID NUMBER(6, 0),
EMP_FN VARCHAR2(20),
EMP_LN VARCHAR2(25) CONSTRAINT EMP_LN_NN NOT NULL,
EMAIL VARCHAR2(25) CONSTRAINT EMP_EMAIL_NN NOT NULL,
PHONE_NO VARCHAR2(20),
SALARY NUMBER(8, 2),
HIRE_DATE DATE CONSTRAINT EMP_HIRE_DATE_NN NOT NULL
);

2. OCMS_DEPARTMENTS TABLE
CREATE TABLE OCMS_DEPARTMENTS(
DEP_ID NUMBER(4, 0),
DEP_NAME VARCHAR2(30) CONSTRAINT DEP_NAME_NN NOT NULL
);

3. OCMS_SERVICES TABLE
CREATE TABLE OCMS_SERVICES(
SERVICE_ID VARCHAR2(6),
SERVICE_NAME VARCHAR2(50) CONSTRAINT SER_NAME_NN NOT NULL,
SERVICE_COST NUMBER(8, 2)
);

4. OCMS_CUSTOMERS TABLE
CREATE TABLE OCMS_CUSTOMERS(
REG_ID NUMBER(6, 0),
COMPANY_NAME VARCHAR2(30) CONSTRAINT CUST_NAME_NN NOT
NULL,
COMPANY_PHONENO VARCHAR2(25),
COMPANY_EMAIL VARCHAR2(30) CONSTRAINT CUST_EMAIL_NN NOT
NULL,
ADDRESS VARCHAR2(40),
CITY VARCHAR2(30),
POSTAL_CODE VARCHAR2(10)

28
);

5. OCMS_PROJECTS TABLE
CREATE TABLE OCMS_PROJECTS(
PROJECT_ID VARCHAR2(6),
PROJECT_NAME VARCHAR2(40) CONSTRAINT PR_NAME_NN NOT NULL,
PROJECT_DATE DATE CONSTRAINT PR_DATE_NN NOT NULL,
PROJECT_STATUS VARCHAR2(15)
);

6. OCMS_REPORTS TABLE
CREATE TABLE OCMS_REPORTS(
REPORT_ID VARCHAR2(6),
REPORT_TYPE VARCHAR2(25),
REPORT_CATEGORY VARCHAR2(25),
REPORT_DESC VARCHAR2(2000),
REPORT_DATE DATE CONSTRAINT REP_DATE_NN NOT NULL
);

7. OCMS_ACCIDENT_RECORDS TABLE
CREATE TABLE OCMS_ACCIDENT_RECORDS(
ACCIDENT_CATEGORY VARCHAR2(25),
ACCIDENT_DESC VARCHAR2(250),
ACCIDENT_DATE DATE CONSTRAINT REC_RECORD_DATE_NN NOT NULL,
ACCIDENT_SEVERITY VARCHAR(50)
);

8. OCMS_EQUIPMENTS TABLE
CREATE TABLE OCMS_EQUIPMENTS(
EQUIPMENT_ID VARCHAR(6),
EQUIPMENT_TYPE VARCHAR2(25),
EQUIPMENT_NAME VARCHAR2(50),
EQUIPMENT_STATUS VARCHAR2(20),
QUANTITY INT,
);
9. OCMS_PROTECTIVE_EQUIPMENTS TABLE
CREATE TABLE OCMS_PROTECTIVE_EQUIPMENTS(
EQUIPMENT_ID VARCHAR(6),
EQUIPMENT_TYPE VARCHAR2(25),
EQUIPMENT_NAME VARCHAR2(50),
EQUIPMENT_STATUS VARCHAR2(20),
QUANTITY INT

29
);
10. OCMS_GENERAL_TOOLS TABLE
CREATE TABLE OCMS_GENERAL_TOOLS(
EQUIPMENT_ID VARCHAR(6),
EQUIPMENT_TYPE VARCHAR2(25),
EQUIPMENT_NAME VARCHAR2(50),
EQUIPMENT_STATUS VARCHAR2(20),
QUANTITY INT
);
ALTER TABLE

1. ALTER OCMS_EMPLOYEES TABLE


ALTER TABLE OCMS_EMPLOYEES
ADD CONSTRAINT EMP_SALARY_MIN CHECK (salary > 0)

ALTER TABLE OCMS_EMPLOYEES


ADD CONSTRAINT EMP_EMAIL_UK UNIQUE (EMAIL)

ALTER TABLE OCMS_EMPLOYEES


ADD CONSTRAINT EMP_PK_EMP_ID PRIMARY KEY (EMP_ID)

ALTER TABLE OCMS_EMPLOYEES


ADD DEP_ID NUMBER(4, 0)

ALTER TABLE OCMS_EMPLOYEES


ADD CONSTRAINT EMP_FK_EMPDEP FOREIGN KEY (DEP_ID)
REFERENCES OCMS_DEPARTMENTS(DEP_ID)
2. ALTER OCMS_DEPARTMENTS TABLE
ALTER TABLE OCMS_DEPARTMENTS
ADD CONSTRAINT DEP_PK_DEP_ID PRIMARY KEY (DEP_ID),

ALTER TABLE OCMS_DEPARTMENTS


ADD MANAGER_ID NUMBER(6, 0)

30
ALTER TABLE OCMS_DEPARTMENTS
ADD CONSTRAINT DEP_FK_DEPEMP FOREIGN KEY (MANAGER_ID)
REFERENCES OCMS_EMPLOYEES(EMP_ID)

3. ALTER OCMS_SERVICES TABLE


ALTER TABLE OCMS_SERVICES
ADD CONSTRAINT SER_COST_MIN CHECK (SERVICE_COST > 0)

ALTER TABLE OCMS_SERVICES


ADD CONSTRAINT SER_PK_SER_ID PRIMARY KEY (SERVICE_ID)

ALTER TABLE OCMS_SERVICES


ADD PROJECT_ID VARCHAR2(6)

ALTER TABLE OCMS_SERVICES


ADD CONSTRAINT SER_FK_SERPR FOREIGN KEY (PROJECT_ID)
REFERENCES OCMS_PROJECTS(PROJECT_ID)

4. ALTER OCMS_CUSTOMERS TABLE


ALTER TABLE OCMS_CUSTOMERS
ADD CONSTRAINT CUST_PK_REG_ID PRIMARY KEY (REG_ID)

5. ALTER OCMS_PROJECTS TABLE


ALTER TABLE OCMS_PROJECTS
ADD CONSTRAINT PR_STATUS_CK CHECK (PROJECT_STATUS IN
('Completed', 'In Progress'))

ALTER TABLE OCMS_PROJECTS


ADD CONSTRAINT PR_PK_PROJECT_ID PRIMARY KEY (PROJECT_ID)

ALTER TABLE OCMS_PROJECTS


ADD EMP_ID NUMBER(6, 0)

ALTER TABLE OCMS_PROJECTS

31
ADD REG_ID NUMBER(6, 0)

ALTER TABLE OCMS_PROJECTS


ADD CONSTRAINT FK_PREMP FOREIGN KEY (EMP_ID)
REFERENCES OCMS_EMPLOYEES(EMP_ID)

ALTER TABLE OCMS_PROJECTS


ADD CONSTRAINT FK_PRCUST FOREIGN KEY (REG_ID)
REFERENCES OCMS_CUSTOMERS(REG_ID)

6. ALTER OCMS_REPORTS TABLE


ALTER TABLE OCMS_REPORTS
ADD CONSTRAINT REP_TYPE_CK CHECK (REPORT_TYPE IN ('Projects',
'Services', 'Emergency'))

ALTER TABLE OCMS_REPORTS


ADD CONSTRAINT REP_CAT_CK CHECK (REPORT_CATEGORY IN ('Maintenance',
'Installation', 'Fault Equipments', 'Damaged Equipments', 'Inspection', 'Accident',
'Finance'))

ALTER TABLE OCMS_REPORTS


ADD CONSTRAINT REP_PK_REP_ID PRIMARY KEY (REPORT_ID)

ALTER TABLE OCMS_REPORTS


ADD EMP_ID NUMBER(6, 0)

ALTER TABLE OCMS_REPORTS


ADD CONSTRAINT FK_REPORTSEMPLOYEES FOREIGN KEY (EMP_ID)
REFERENCES OCMS_EMPLOYEES(EMP_ID)

ALTER TABLE OCMS_REPORTS


ADD REG_ID NUMBER(6, 0)

32
ALTER TABLE OCMS_REPORTS
ADD CONSTRAINT FK_REPORTSCUSTOMERS FOREIGN KEY (REG_ID)
REFERENCES OCMS_CUSTOMERS(REG_ID)

7. ALTER OCMS_ACCIDENT_RECORDS
ALTER TABLE OCMS_ACCIDENT_RECORDS
ADD CONSTRAINT REC_CAT_CK CHECK (ACCIDENT_CATEGORY IN ('Accidents at
Work', 'Vehicle Accidents', 'Slips', 'Negligence', 'Other'))

ALTER TABLE OCMS_ACCIDENT_RECORDS


ADD CONSTRAINT REC_SEVERITY_CK CHECK (ACCIDENT_SEVERITY IN ('No
injury', 'Minor', 'Moderate', 'Severe', 'Critical', 'Fatal'))

ALTER TABLE OCMS_ACCIDENT_RECORDS


ADD REPORT_ID VARCHAR2(6)

ALTER TABLE OCMS_ACCIDENT_RECORDS


ADD CONSTRAINT REC_FK_RECREP FOREIGN KEY (REPORT_ID)
REFERENCES OCMS_REPORTS(REPORT_ID)

8. ALTER OCMS_EQUIPMENTS TABLE


ALTER TABLE OCMS_EQUIPMENTS
ADD CONSTRAINT EQ_STATUS_CK CHECK (EQUIPMENT_STATUS IN ('In use',
'New', 'Faulty', 'Expired', 'Used'))

ALTER TABLE OCMS_EQUIPMENTS


ADD CONSTRAINT EQ_PK_EQ_ID PRIMARY KEY (EQUIPMENT_ID)
ALTER TABLE OCMS_EQUIPMENTS
ADD EMP_ID NUMBER(6, 0)

ALTER TABLE OCMS_EQUIPMENTS


ADD CONSTRAINT FK_EQUIPMENTSEMPLOYEES FOREIGN KEY (EMP_ID)
REFERENCES OCMS_EMPLOYEES(EMP_ID)

33
ALTER TABLE OCMS_EQUIPMENTS
ADD REG_ID NUMBER(6, 0)

ALTER TABLE OCMS_EQUIPMENTS


ADD CONSTRAINT FK_EQUIPMENTSCUSTOMERS FOREIGN KEY (REG_ID)
REFERENCES OCMS_CUSTOMERS(REG_ID)

9. ALTER OCMS_PROTECTIVE_EQUIPMENTS TABLE


ALTER TABLE OCMS_PROTECTIVE_EQUIPMENTS
ADD CONSTRAINT PE_PK_PE_ID PRIMARY KEY (EQUIPMENT_ID)

10. ALTER OCMS_GENERAL_TOOLS TABLE


ALTER TABLE OCMS_GENERAL_TOOLS
ADD CONSTRAINT GT_PK_GT_ID PRIMARY KEY (EQUIPMENT_ID)

UPDATE TABLE

1. UPDATE OCMS_EMPLOYEES TABLE


UPDATE OCMS_EMPLOYEES
SET EMP_LN = ‘Yeop’
WHERE EMP_ID = ‘402’

2. UPDATE OCMS_PROTECTIVE_EQUIPMENTS TABLE


UPDATE OCMS_PROTECTIVE_EQUIPMENTS
SET EQUIPMENT_NAME = ‘Webbing gear’
WHERE EQUIPMENT_ID = ‘SW0010’

DROP TABLE
1. DROP OCMS_COMPANIES TABLE
DROP OCMS_COMPANIES;

TRUNCATE TABLE
1. TRUNCATE OCMS_COMPANIES TABLE
TRUNCATE TABLE OCMS_COMPANIES;

34
Data Manipulation Language (DML)
A data manipulation language (DML) is a type of computer programming language that is
used to add (insert), delete, and alter (update) data in a database. A DML is frequently a
sublanguage of a larger database language, such as SQL, with the DML containing some of the
language's operators. Read-only data selection is often characterized as a separate data query
language (DQL), but it is closely connected to and sometimes regarded a component of a DML;
some operators may do both selecting (reading) and writing. Structured Query Language (SQL)
is a common data manipulation language that is used to obtain and manipulate data in a relational
database. Other types of DML are used by IMS/DLI, CODASYL databases like IDMS, and others.

Click on the button insert row

Figure 27 Data Manipulation Language

Then insert the data

Figure 28 Data Manipulation Language

35
Or the other way is to go to SQL Commands, and put in the command like the one below.
The result shows that 1 row has been inserted.

Figure 29 Data Manipulation Language

INSERT DATA INTO TABLE


1. OCMS_EMPLOYEES
INSERT INTO OCMS_EMPLOYEES(EMP_ID, EMP_FN, EMP_LN, EMAIL,
PHONE_NO, SALARY, HIRE_DATE, DEP_ID)
VALUES (402, 'Annie', 'Yeop', 'annie@gmail.com', '1126289501', 3500, '06/25/2015',
685);

INSERT INTO OCMS_EMPLOYEES(EMP_ID, EMP_FN, EMP_LN, EMAIL,


PHONE_NO, SALARY, HIRE_DATE, DEP_ID)
VALUES (412, 'Alan', 'Bajin', 'alanwalker@gmail.com', '015-566 8891', 3500,
'06/21/2015', 312);

INSERT INTO OCMS_EMPLOYEES(EMP_ID, EMP_FN, EMP_LN, EMAIL,


PHONE_NO, SALARY, HIRE_DATE, DEP_ID)
VALUES (301, 'Wong Chai', 'Ling', 'chailing@gmail.com', '133698544', 6300,
'08/15/2017', 415);

INSERT INTO OCMS_EMPLOYEES(EMP_ID, EMP_FN, EMP_LN, EMAIL,


PHONE_NO, SALARY, HIRE_DATE, DEP_ID)
VALUES (501, 'Jonathan', 'Loh', 'jonathanloh@gmail.com', '1798526413', 4500,
'07/25/2016', 457);

INSERT INTO OCMS_EMPLOYEES(EMP_ID, EMP_FN, EMP_LN, EMAIL,


PHONE_NO, SALARY, HIRE_DATE, DEP_ID)
VALUES (601, 'Jamie', 'Han', 'hanmulan@gmail.com', '133954225', 10500, '05/12/2014',
784);

36
INSERT INTO OCMS_EMPLOYEES(EMP_ID, EMP_FN, EMP_LN, EMAIL,
PHONE_NO, SALARY, HIRE_DATE, DEP_ID)
VALUES (701, 'Mei', 'Zheng', 'meilizheng@gmail.com', '175489622', 11250,
'12/06/2016', 225);

INSERT INTO OCMS_EMPLOYEES(EMP_ID, EMP_FN, EMP_LN, EMAIL,


PHONE_NO, SALARY, HIRE_DATE, DEP_ID)
VALUES (121, 'Adenan', 'Rudin', 'adenanrudin@gmail.com', '1126276801', 5300,
'06/26/2015', 334);

INSERT INTO OCMS_EMPLOYEES(EMP_ID, EMP_FN, EMP_LN, EMAIL,


PHONE_NO, SALARY, HIRE_DATE, DEP_ID)
VALUES (401, 'Julaihi', 'Zakarya', 'zakarya@gmail.com', '125648997', 4600,
'04/21/2016', 784);

INSERT INTO OCMS_EMPLOYEES(EMP_ID, EMP_FN, EMP_LN, EMAIL,


PHONE_NO, SALARY, HIRE_DATE, DEP_ID)
VALUES (652, 'Frank', 'Bani', 'harunpanjang@gmail.com', '173654489', 10000,
'05/12/2014', 445);

INSERT INTO OCMS_EMPLOYEES(EMP_ID, EMP_FN, EMP_LN, EMAIL,


PHONE_NO, SALARY, HIRE_DATE, DEP_ID)
VALUES (305, 'Anne', 'James', 'channe@gmail.com', '178542110', 6300, '05/12/2016',
511);

INSERT INTO OCMS_EMPLOYEES(EMP_ID, EMP_FN, EMP_LN, EMAIL,


PHONE_NO, SALARY, HIRE_DATE, DEP_ID)
VALUES (405, 'Haris', 'Alfred', 'adamharis@gmail.com', '1126275620', 7200,
'12/15/2018', 876);

2. OCMS_DEPARTMENTS
INSERT INTO OCMS_DEPARTMENTS(DEP_ID, DEP_NAME, MANAGER_ID)
VALUES (445, 'Pressure Vessel Inspector', 652);

INSERT INTO OCMS_DEPARTMENTS(DEP_ID, DEP_NAME, MANAGER_ID)


VALUES (876, 'Project Engineer', NULL);

INSERT INTO OCMS_DEPARTMENTS(DEP_ID, DEP_NAME, MANAGER_ID)


VALUES (334, 'Piping Authorized Inspector', NULL);

INSERT INTO OCMS_DEPARTMENTS(DEP_ID, DEP_NAME, MANAGER_ID)


VALUES (685, 'Tender Executive', NULL);

37
INSERT INTO OCMS_DEPARTMENTS(DEP_ID, DEP_NAME, MANAGER_ID)
VALUES (784, 'General Inspector', 601);

INSERT INTO OCMS_DEPARTMENTS(DEP_ID, DEP_NAME, MANAGER_ID)


VALUES (457, 'Inspection Engineer', NULL);

INSERT INTO OCMS_DEPARTMENTS(DEP_ID, DEP_NAME, MANAGER_ID)


VALUES (511, 'IT', NULL);

INSERT INTO OCMS_DEPARTMENTS(DEP_ID, DEP_NAME, MANAGER_ID)


VALUES (415, 'HR', NULL);

INSERT INTO OCMS_DEPARTMENTS(DEP_ID, DEP_NAME, MANAGER_ID)


VALUES (225, 'Instrument Team Lead', 701);

INSERT INTO OCMS_DEPARTMENTS(DEP_ID, DEP_NAME, MANAGER_ID)


VALUES (312, 'Electrical Engineer', NULL);

3. OCMS_SERVICES
INSERT INTO OCMS_SERVICES(SERVICE_ID, SERVICE_NAME, SERVICE_COST,
PROJECT_ID)
VALUES ('CMS003', 'Civil Maintenance Services', 20000, 'PM0035');

INSERT INTO OCMS_SERVICES(SERVICE_ID, SERVICE_NAME, SERVICE_COST,


PROJECT_ID)
VALUES ('HE5656', 'Heat Exchanger Advanced Service', 3500, 'PI9654');

INSERT INTO OCMS_SERVICES(SERVICE_ID, SERVICE_NAME, SERVICE_COST,


PROJECT_ID)
VALUES ('MCI001', 'Material, Corrosion & Inspection', 14000, 'PM9002');

INSERT INTO OCMS_SERVICES(SERVICE_ID, SERVICE_NAME, SERVICE_COST,


PROJECT_ID)
VALUES ('IM2121', 'Instrumentation Maintenance Services', 12000, 'PC2231');

INSERT INTO OCMS_SERVICES(SERVICE_ID, SERVICE_NAME, SERVICE_COST,


PROJECT_ID)
VALUES ('ME4213', 'Mechanical Engineering & Maintenance', 40000, 'PW0987');

INSERT INTO OCMS_SERVICES(SERVICE_ID, SERVICE_NAME, SERVICE_COST,


PROJECT_ID)
VALUES ('PM5678', 'Pipeline Maintenance and Associated', 77000, 'PM1004');

INSERT INTO OCMS_SERVICES(SERVICE_ID, SERVICE_NAME, SERVICE_COST,


PROJECT_ID)
VALUES ('PD0067', 'Production, Drilling, Workover Associated', 75000, 'PC6654');

INSERT INTO OCMS_SERVICES(SERVICE_ID, SERVICE_NAME, SERVICE_COST,


PROJECT_ID)
VALUES ('MM8878', 'Mechanical Engineering & Maintenance', 40000, 'PE0035');

38
INSERT INTO OCMS_SERVICES(SERVICE_ID, SERVICE_NAME, SERVICE_COST,
PROJECT_ID)
VALUES ('UDS002', 'Underwater Services', 50000, 'PR0021');

INSERT INTO OCMS_SERVICES(SERVICE_ID, SERVICE_NAME, SERVICE_COST,


PROJECT_ID)
VALUES ('EE0909', 'Electrical Eng, Maintenance and Manufacturing', 85000, 'PR0025');

4. OCMS_CUSTOMERS
INSERT INTO OCMS_CUSTOMERS(REG_ID, COMPANY_NAME,
COMPANY_PHONENO, COMPANY_EMAIL, ADDRESS, CITY, POSTAL_CODE)
VALUES (69105, 'KEMENTERIAN KEWANGAN MALAYSIA', '03-8695 4215',
'KKM@kementerian.my', 'Bandar Miri', 'Miri', 98000);

INSERT INTO OCMS_CUSTOMERS(REG_ID, COMPANY_NAME,


COMPANY_PHONENO, COMPANY_EMAIL, ADDRESS, CITY, POSTAL_CODE)
VALUES (56585, 'BOUSTEAD HEAVY IND CORP', '03-9564 8754',
'bousthead@gmail.com', 'Lutong', 'Miri', 98000);

INSERT INTO OCMS_CUSTOMERS(REG_ID, COMPANY_NAME,


COMPANY_PHONENO, COMPANY_EMAIL, ADDRESS, CITY, POSTAL_CODE)
VALUES (30554, 'LEMBAGA PERLESENAN TENAGA ATOM', '03-7562 3034',
'aelb_lpta@gmail.com', 'Miri Port', 'Miri', 98000);

INSERT INTO OCMS_CUSTOMERS(REG_ID, COMPANY_NAME,


COMPANY_PHONENO, COMPANY_EMAIL, ADDRESS, CITY, POSTAL_CODE)
VALUES (30348, 'IRATA INTERNATIONAL', '03-8924 8552',
'irata_Interope@gmail.com', 'Kuala Baram', 'Miri', 98000);

INSERT INTO OCMS_CUSTOMERS(REG_ID, COMPANY_NAME,


COMPANY_PHONENO, COMPANY_EMAIL, ADDRESS, CITY, POSTAL_CODE)
VALUES (30895, 'SEACAD GROUP', '03-9564 8754', 'seacad@gmail.com', 'Kuala
Baram', 'Miri', 98000);

INSERT INTO OCMS_CUSTOMERS(REG_ID, COMPANY_NAME,


COMPANY_PHONENO, COMPANY_EMAIL, ADDRESS, CITY, POSTAL_CODE)
VALUES (80636, 'CIDB MALAYSIA', '03-9546 2158', 'cidb_SPKK@gmail.com', 'Piasau',
'Miri', 98000);

INSERT INTO OCMS_CUSTOMERS(REG_ID, COMPANY_NAME,


COMPANY_PHONENO, COMPANY_EMAIL, ADDRESS, CITY, POSTAL_CODE)
VALUES (85004, 'MALAYSIA SHIPOWNER ASSC', '03-9854 6235',
'masaship@gmail.com', 'Jalan Tun Jugah', 'Miri', 98000);

INSERT INTO OCMS_CUSTOMERS(REG_ID, COMPANY_NAME,


COMPANY_PHONENO, COMPANY_EMAIL, ADDRESS, CITY, POSTAL_CODE)
VALUES (12345, 'PETRONAS', '03-7777 5445', 'petronas@gmail.com', 'Lutong', 'Miri',
98000);

39
5. OCMS_PROJECTS
INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,
PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PI9654', 'Third-party Inspection', '05/16/2022', 'Completed', 412, 85004);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PR0021', 'Protection Relay Testing and Calibration', '06/30/2018', 'In
Progress', 412, 12345);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PM9002', 'Pipeline Maintenance', '08/09/2017', 'In Progress', 412, 12345);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PM0035', 'Maintenance', '02/18/2019', 'Completed', 601, 80636);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PW0987', 'Supply of Manpower', '08/08/2021', 'Completed', 121, 80636);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PF0542', 'Drilling Fluids and Associated', '04/30/2022', 'In Progress', 601,
30554);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PM1004', 'Inspection and Maintenance', '08/12/2019', 'Completed', 121,
30348);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PW0115', 'Supply of Manpower', '09/11/2022', 'In Progress', 405, 69105);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PC6654', 'Cementing Equipment', '06/25/2022', 'In Progress', 601, 85004);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PE0035', 'Electrical Equipment Maintenance', '06/12/2020', 'Completed', 121,
56585);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PC2231', 'Corrosion Monitoring', '12/10/2020', 'Completed', 401, 30554);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)

40
VALUES ('PO6687', 'Onshore Mechanical and Electrical', '03/16/2022', 'In Progress',
652, 30895);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PD8901', 'Non-Destructive Inspection', '12/25/2021', 'In Progress', 301,
30348);

INSERT INTO OCMS_PROJECTS(PROJECT_ID, PROJECT_NAME,


PROJECT_DATE, PROJECT_STATUS, EMP_ID, REG_ID)
VALUES ('PR0025', 'Inspection', '11/18/2021', 'In Progress', 301, 30348);

6. OCMS_REPORTS
INSERT INTO OCMS_REPORTS(REPORT_ID, REPORT_TYPE,
REPORT_CATEGORY, REPORT_DESC, REPORT_DATE, EMP_ID, REG_ID)
VALUES ('SM0003', 'Services', 'Maintenance', 'Maintaining Alarm System', '06/24/2021',
301, 56585);

INSERT INTO OCMS_REPORTS(REPORT_ID, REPORT_TYPE,


REPORT_CATEGORY, REPORT_DESC, REPORT_DATE, EMP_ID, REG_ID)
VALUES ('SM0006', 'Services', 'Maintenance', 'replacing Emergency Light', '04/03/2021',
701, 69105);

INSERT INTO OCMS_REPORTS(REPORT_ID, REPORT_TYPE,


REPORT_CATEGORY, REPORT_DESC, REPORT_DATE, EMP_ID, REG_ID)
VALUES ('SM0009', 'Services', 'Maintenance', 'Inspecting Pipeline', '06/18/2021', 701,
12345);

INSERT INTO OCMS_REPORTS(REPORT_ID, REPORT_TYPE,


REPORT_CATEGORY, REPORT_DESC, REPORT_DATE, EMP_ID, REG_ID)
VALUES ('SM0001', 'Services', 'Maintenance', 'Faulty Emergency Siren', '06/23/2021',
412, 12345);

INSERT INTO OCMS_REPORTS(REPORT_ID, REPORT_TYPE,


REPORT_CATEGORY, REPORT_DESC, REPORT_DATE, EMP_ID, REG_ID)
VALUES ('SM0007', 'Services', 'Maintenance', 'replacing Faulty Equiments',
'06/30/2021', 701, 30348);

INSERT INTO OCMS_REPORTS(REPORT_ID, REPORT_TYPE,


REPORT_CATEGORY, REPORT_DESC, REPORT_DATE, EMP_ID, REG_ID)
VALUES ('SI0002', 'Services', 'Installation', 'Installing Industrial Lamp', '04/04/2022', 701,
30554);

INSERT INTO OCMS_REPORTS(REPORT_ID, REPORT_TYPE,


REPORT_CATEGORY, REPORT_DESC, REPORT_DATE, EMP_ID, REG_ID)
VALUES ('SI0004', 'Services', 'Installation', 'Installing Alarm', '03/24/2021', 401, 85004);

INSERT INTO OCMS_REPORTS(REPORT_ID, REPORT_TYPE,


REPORT_CATEGORY, REPORT_DESC, REPORT_DATE, EMP_ID, REG_ID)
VALUES ('SF0005', 'Services', 'Finance', 'Checking Tender', '02/15/2021', 601, 80636);

41
INSERT INTO OCMS_REPORTS(REPORT_ID, REPORT_TYPE,
REPORT_CATEGORY, REPORT_DESC, REPORT_DATE, EMP_ID, REG_ID)
VALUES ('SI0008', 'Services', 'Installation', 'Suit rack stand', '07/18/2021', 401, 12345);

INSERT INTO OCMS_REPORTS(REPORT_ID, REPORT_TYPE,


REPORT_CATEGORY, REPORT_DESC, REPORT_DATE, EMP_ID, REG_ID)
VALUES ('SI0010', 'Services', 'Installation', 'Installing Emergency Light', '03/03/2021',
601, 30554);

7. OCMS_ACCIDENT_RECORDS
INSERT INTO OCMS_ACCIDENT_RECORDS(ACCIDENT_CATEGORY,
ACCIDENT_DESC, ACCIDENT_DATE, ACCIDENT_SEVERITY, REPORT_ID)
VALUES ('Vehicle Accidents', 'Forklift ram into storages room at Warehouse.',
'09/11/2020', 'No injury', NULL);

INSERT INTO OCMS_ACCIDENT_RECORDS(ACCIDENT_CATEGORY,


ACCIDENT_DESC, ACCIDENT_DATE, ACCIDENT_SEVERITY, REPORT_ID)
VALUES ('Vehicle Accidents', 'A truck run over a nearby worker caused by blind spot.
The worker not wearing a proper reflective PPE.', '06/01/2022', 'Fatal', NULL);

INSERT INTO OCMS_ACCIDENT_RECORDS(ACCIDENT_CATEGORY,


ACCIDENT_DESC, ACCIDENT_DATE, ACCIDENT_SEVERITY, REPORT_ID)
VALUES ('Accidents at Work', 'Machine malfunction causing a worker suffered a severe
injury.', '08/01/2020', 'Severe', NULL);

INSERT INTO OCMS_ACCIDENT_RECORDS(ACCIDENT_CATEGORY,


ACCIDENT_DESC, ACCIDENT_DATE, ACCIDENT_SEVERITY, REPORT_ID)
VALUES ('Other', 'A wild boar attacking one personnel. The worker suffered with minor
injury.', '02/07/2022', 'Minor', NULL);

INSERT INTO OCMS_ACCIDENT_RECORDS(ACCIDENT_CATEGORY,


ACCIDENT_DESC, ACCIDENT_DATE, ACCIDENT_SEVERITY, REPORT_ID)
VALUES ('Accidents at Work', 'Leaking pipeline released a strong air pressure, some
workers suffering burn.', '04/23/2022', 'Moderate', 'SM0003');

INSERT INTO OCMS_ACCIDENT_RECORDS(ACCIDENT_CATEGORY,


ACCIDENT_DESC, ACCIDENT_DATE, ACCIDENT_SEVERITY, REPORT_ID)
VALUES ('Negligence', 'A worker fall to his death after. Lack of PPE provided.',
'08/06/2019', 'Fatal', NULL);

INSERT INTO OCMS_ACCIDENT_RECORDS(ACCIDENT_CATEGORY,


ACCIDENT_DESC, ACCIDENT_DATE, ACCIDENT_SEVERITY, REPORT_ID)
VALUES ('Accidents at Work', 'An exploding processing machine caused several
workers to suffer critical injuries.', '10/19/2021', 'Critical', 'SM0009');

INSERT INTO OCMS_ACCIDENT_RECORDS(ACCIDENT_CATEGORY,


ACCIDENT_DESC, ACCIDENT_DATE, ACCIDENT_SEVERITY, REPORT_ID)
VALUES ('Slips', 'A worker wearing a casual shoes slips and fall from building. The
worker suffers a severe injury.', '01/13/2022', 'Severe', NULL);

42
INSERT INTO OCMS_ACCIDENT_RECORDS(ACCIDENT_CATEGORY,
ACCIDENT_DESC, ACCIDENT_DATE, ACCIDENT_SEVERITY, REPORT_ID)
VALUES ('Negligence', 'A worker wearing an in-proper PPE glove during maintenance.',
'08/21/2021', 'Moderate', NULL);

INSERT INTO OCMS_ACCIDENT_RECORDS(ACCIDENT_CATEGORY,


ACCIDENT_DESC, ACCIDENT_DATE, ACCIDENT_SEVERITY, REPORT_ID)
VALUES ('Accidents at Work', 'Building roof collapsed, crushing several workers and
visitors.', '11/03/2020', 'Severe', 'SM0007');

8. OCMS_EQUIPMENTS
INSERT INTO OCMS_EQUIPMENTS(EQUIPMENT_ID, EQUIPMENT_TYPE,
EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY, EMP_ID, REG_ID)
VALUES ('G03', 'General', 'Helmet - Yellow', 'New', 33, 401, 12345);

INSERT INTO OCMS_EQUIPMENTS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY, EMP_ID, REG_ID)
VALUES ('P22', 'Protective', 'Safety Glasses', 'In use', 77, 401, 12345);

INSERT INTO OCMS_EQUIPMENTS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY, EMP_ID, REG_ID)
VALUES ('G11', 'General', 'Cordless Drill', 'In use', 10, 121, 12345);

INSERT INTO OCMS_EQUIPMENTS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY, EMP_ID, REG_ID)
VALUES ('P39', 'Protective', 'Coverall Suit', 'New', 45, 121, 12345);

INSERT INTO OCMS_EQUIPMENTS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY, EMP_ID, REG_ID)
VALUES ('P23', 'Protective', 'Helmet - White', 'In use', 15, 652, 12345);

INSERT INTO OCMS_EQUIPMENTS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY, EMP_ID, REG_ID)
VALUES ('P76', 'Protective', 'FR Gloves', 'In use', 22, 412, 12345);

INSERT INTO OCMS_EQUIPMENTS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY, EMP_ID, REG_ID)
VALUES ('G67', 'General', 'Radiator', 'Faulty', 15, 412, 12345);

INSERT INTO OCMS_EQUIPMENTS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY, EMP_ID, REG_ID)
VALUES ('P07', 'Protective', 'Impact Glove', 'In use', 87, 121, 12345);

INSERT INTO OCMS_EQUIPMENTS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY, EMP_ID, REG_ID)
VALUES ('P10', 'Protective', 'Ear Cover', 'In use', 76, 701, 12345);

INSERT INTO OCMS_EQUIPMENTS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY, EMP_ID, REG_ID)
VALUES ('G55', 'General', 'Chainsaw', 'New', 34, 701, 12345);

43
INSERT INTO OCMS_EQUIPMENTS(EQUIPMENT_ID, EQUIPMENT_TYPE,
EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY, EMP_ID, REG_ID)
VALUES ('G62', 'General', 'Hedge Trimmer', 'In use', 32, 501, 12345);

9. OCMS_PROTECTIVE_EQUIPMENTS
INSERT INTO OCMS_PROTECTIVE_EQUIPMENTS(EQUIPMENT_ID,
EQUIPMENT_TYPE, EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('SH0008', 'Protective', 'Scuba tank', 'New', 78);

INSERT INTO OCMS_PROTECTIVE_EQUIPMENTS(EQUIPMENT_ID,


EQUIPMENT_TYPE, EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('SW0010', 'Protective', 'Webbing gear', 'Used', 45);

INSERT INTO OCMS_PROTECTIVE_EQUIPMENTS(EQUIPMENT_ID,


EQUIPMENT_TYPE, EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('SD0007', 'Protective', 'Scuba diving suit', 'Used', 65);

INSERT INTO OCMS_PROTECTIVE_EQUIPMENTS(EQUIPMENT_ID,


EQUIPMENT_TYPE, EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('SF0009', 'Protective', 'Flipper', 'Used', 98);

INSERT INTO OCMS_PROTECTIVE_EQUIPMENTS(EQUIPMENT_ID,


EQUIPMENT_TYPE, EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('SR0011', 'Protective', 'Reflective Jacket', 'Used', 200);

INSERT INTO OCMS_PROTECTIVE_EQUIPMENTS(EQUIPMENT_ID,


EQUIPMENT_TYPE, EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('SC0003', 'Protective', 'Coverall suit', 'New', 87);

INSERT INTO OCMS_PROTECTIVE_EQUIPMENTS(EQUIPMENT_ID,


EQUIPMENT_TYPE, EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('SG0004', 'Protective', 'Gloves', 'Used', 77);

INSERT INTO OCMS_PROTECTIVE_EQUIPMENTS(EQUIPMENT_ID,


EQUIPMENT_TYPE, EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('SS0005', 'Protective', 'Safety glasses', 'Used', 67);

INSERT INTO OCMS_PROTECTIVE_EQUIPMENTS(EQUIPMENT_ID,


EQUIPMENT_TYPE, EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('SB0006', 'Protective', 'Boots', 'New', 50);

INSERT INTO OCMS_PROTECTIVE_EQUIPMENTS(EQUIPMENT_ID,


EQUIPMENT_TYPE, EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('SO0012', 'Protective', 'Emergency Strobe', 'New', 50);

10. OCMS_GENERAL_TOOLS
INSERT INTO OCMS_GENERAL_TOOLS(EQUIPMENT_ID, EQUIPMENT_TYPE,
EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('G04', 'General', 'Drill', 'In use', 24);

44
INSERT INTO OCMS_GENERAL_TOOLS(EQUIPMENT_ID, EQUIPMENT_TYPE,
EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('G55', 'General', 'Chainsaw', 'New', 44);

INSERT INTO OCMS_GENERAL_TOOLS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('G78', 'General', 'Industrial Lamp', 'Used', 32);

INSERT INTO OCMS_GENERAL_TOOLS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('G48', 'General', 'Emergency light', 'New', 43);

INSERT INTO OCMS_GENERAL_TOOLS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('G12', 'General', 'Headlamp', 'In use', 66);

INSERT INTO OCMS_GENERAL_TOOLS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('G76', 'General', 'Valve', 'New', 45);

INSERT INTO OCMS_GENERAL_TOOLS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('G90', 'General', 'Spanner', 'Used', 33);
INSERT INTO OCMS_GENERAL_TOOLS(EQUIPMENT_ID, EQUIPMENT_TYPE,
EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('G45', 'General', 'Wrench', 'In use', 43);

INSERT INTO OCMS_GENERAL_TOOLS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)
VALUES ('G61', 'General', 'Flashlight', 'Expired', 21);

INSERT INTO OCMS_GENERAL_TOOLS(EQUIPMENT_ID, EQUIPMENT_TYPE,


EQUIPMENT_NAME, EQUIPMENT_STATUS, QUANTITY)

45
VALUES ('G10', 'General', 'Caution Sign', 'New', 54);

46
7. DATABASE SYSTEM’S INTERFACE
HOME

Figure 29 Home Page

Figure 30 Employee Page

47
Figure 31 Services Page

Figure 32 Departments Page

Figure 33 Customers Page

48
Figure 34 Projects Page

Figure 35 Reports Page

Figure 36 Equipments Page

49
Figure 37 Protective Equipments Page

Figure 38 Generals Tools Page

Figure 39 Accident Records Page

50
DASHBOARD

Figure 40 Dashboard of Accident Cases by Category provided by Oceancare

Based on Figure 40, we can conclude that most workplace accidents occur due to
faulty equipment, an old workplace structure, and overexertion while working on a project.
Accidents have also occurred as a result of vehicle accidents, unintentional slips and trips

51
on equipment, a negligence of work safety ethics, and other factors caused by wild animal
interruption.

Figure 41 Dashboard of Case of Injury provided by Oceancare

From Figure 41, we can see that most workers suffer from severe injury, followed
by moderate injury, fatal or death, no injury, minor injury and critical injury.

52
Figure 42 Dashboard of Project Status provided by Oceancare

Figure 42 shows the amount of works that has already been completed and the
one that are still in progress. From the graph we can see that the number of projects that
are still in progress are greater than number of projects that has already been completed.
Mostly the project that was started from two years ago and above are already completed.

Figure 43 Dashboard Equipment by Oceancare

53
Figure 44 Dashboard of Protective Equipment by Oceancare

Figure 45 Dashboard of Generals Tools by Oceancare

Figure 44 and Figure 45 shows the data of protective equipment available and
general tools to use for employee to work on projects and services. For protective
equipment, the equipment with the highest number is the reflective jacket, and follow with
flipper, coverall suit, scuba tank, gloves, safety glasses, scuba diving suit, boots and
emergency strobe, and lastly webbing gear. For general tools, we can see that headlamp
is the highest number among any others general tools followed by caution sign.

54
Figure 46 Dashboard of Project Service Cost in MYR provided by Oceancare

Figure 46 shows the service cost provided by Oceancare Corporation for their
clients. From the graph we can see that the common Inspection service is the highest cost
in comparison to other services. Mostly the project constantly requires a daily inspection
making that specific service is highly profitable.

55
Figure 47 Dashboard of Total Reports by Oceancare

Figure 47 represents the reports for each type of report: maintenance report,
damaged equipment report, finance report, and installation report. According to the graph,
maintenance projects and installation services have a higher count than damaged equipment
reports and finance reports because finance reports are written yearly while damaged
equipment reports are written on an as-needed basis.

56
8. QUERIES AND OUTPUTS
QUESTION 1
The company wants the list of protective equipment label as "EQUIPMENT" and the
quantity of the equipment, but only the one that has quantity over 50.
SELECT EQUIPMENT_NAME AS "EQUIPMENT”, QUANTITY
FROM OCMS_PROTECTIVE_EQUIPMENTS
WHERE QUANTITY>50
UNION ALL
SELECT EQUIPMENT_NAME AS "EQUIPMENT”, QUANTITY
FROM OCMS_PROTECTIVE_EQUIPMENTS
WHERE QUANTITY>50
ORDER BY QUANTITY;

Figure 48 Output Question 1

QUESTION 2
Display the ID, first and last name display as "FIRST NAME and "LASTNAME", and Hire
date of employees who enter the company from 2016 until recently.
SELECT EMP_ID, EMP_FN AS "FIRST NAME",
EMP_LN AS "LAST NAME”, HIRE_DATE
FROM OCMS_EMPLOYEES
WHERE HIRE_DATE > to_date('01/01/2020', 'DD-MM-RR');

Figure 49 Output Question 2

57
QUESTION 3
Create a report that produces the following for each record<accident category> earns
<accident date>. Where <accident description> There was/were <accident severity> '
case(s) caused by accident. Label the column Records.

SELECT ACCIDENT_CATEGORY ||' occurred on '|| ACCIDENT_DATE ||'. Where '


|| LOWER(ACCIDENT_DESC) || ' There was/were ' || LOWER(ACCIDENT_SEVERITY)
|| ' case(s) caused by accident.' AS "Records"
FROM OCMS_ACCIDENT_RECORDS;

Figure 50 Output Question 3

QUESTION 4
Manager need a list of employees who have completed their projects and work for the
company more than 5 years. Display their last name, salary and add on bonus of 10% for
yearly salary.
SELECT EMP_LN, SALARY, (SALARY*12) *0.01+(SALARY*12) AS BONUS
, TO_CHAR (HIRE_DATE, 'DD-MONTH-YY') HIRE_DATE
FROM OCMS_EMPLOYEES
INNER JOIN OCMS_PROJECTS ON
OCMS_PROJECTS.EMP_ID=OCMS_EMPLOYEES.EMP_ID
WHERE PROJECT_STATUS LIKE 'Completed'
AND HIRE_DATE<TO_DATE ('12/31/2016');

Figure 51 Output Question 4

58
QUESTION 5
Display the client company as CLIENT that have gotten a maintenance service from the
company with the project name and the project status.

SELECT COMPANY_NAME AS "CLIENT", PROJECT_NAME, PROJECT_STATUS


FROM OCMS_PROJECTS
INNER JOIN OCMS_CUSTOMERS ON
OCMS_CUSTOMERS.REG_ID=OCMS_PROJECTS.REG_ID
WHERE PROJECT_NAME LIKE '%Maintenance%';

Figure 52 Output Question 5

QUESTION 6
Display the report id, report category and report date. Label the column as day and order
the results by the day of the week, starting with Monday.
SELECT REPORT_ID, REPORT_CATEGORY, REPORT_DATE,
TO_CHAR (REPORT_DATE, 'DAY') AS DAY
FROM OCMS_REPORTS
ORDER BY TO_CHAR (REPORT_DATE, 'D');

Figure 53 Output Question 6

59
QUESTION 7
Display employee name who are from IT and marketing department.
SELECT CONCAT (EMP_FN, EMP_LN) AS EMPLOYEE, DEP_NAME DEPARTMENT
FROM OCMS_EMPLOYEES E
JOIN OCMS_DEPARTMENTS D
ON E.DEP_ID = D.DEP_ID
WHERE DEP_NAME LIKE '%IT%' OR
DEP_NAME LIKE '%HR%';

Figure 54 Output Question 7

QUESTION 8
Write a query that displays the employee's name, department name and the salary more
than RM 5000.
SELECT CONCAT (EMP_FN, EMP_LN) AS EMPLOYEE, DEP_NAME, SALARY
FROM OCMS_EMPLOYEES JOIN OCMS_DEPARTMENTS
USING (DEP_ID)
WHERE SALARY > 5000;

Figure 55 Output Question 8

60
QUESTION 9
A query to keep track on status of all the projects. Use the OCMS_PROJECTS and
OCMS_CUSTOMERS tables. Show the PROJECT_ID, PROJECT_NAME,
PROJECT_DATE, PROJECT_STATUS and COMPANY_NAME in the output. Use a
NATURAL JOIN to produce the results.
SELECT PROJECT_ID, PROJECT_NAME, PROJECT_DATE, PROJECT_STATUS,
COMPANY_NAME
FROM OCMS_PROJECTS
NATURAL JOIN OCMS_CUSTOMERS;

Figure 56 Output Question 9

QUESTION 10
Create a report and assume rows with NULL report id as "unreported cases" else
"confirmed reported cases". Count number of accidents using UNION ALL.
SELECT COUNT(*) || ' are unreported cases.' AS "Number of accidents"
FROM OCMS_ACCIDENT_RECORDS
WHERE REPORT_ID IS NULL
UNION ALL
SELECT COUNT(*) || ' are confirmed reported cases.'
FROM OCMS_ACCIDENT_RECORDS
WHERE REPORT_ID IS NOT NULL

Figure 57 Output Question 10

61
9. CONCLUSION
Overall, developing a database management system can improve a company's efficiency
as the company continues business expansion to handle more information as well as keeping
track of records effectively in the current year since the fourth industrial revolution. This project
also improves the integrity of information shared in the provided system. The system offers
several useful features that can help to eliminate data redundancy.

In our case we have created the database according to one of our group member
experiences during his industrial training. We hope that the client is able to use the system and
get all the work done easier and much faster rather than managing all information on paper.

By using this system that we created, we hope that the company exceeds all of its
stakeholders in delivering quality Oil and Gas services and products in a responsible, efficient,
cost effective, sustainable, ethical manner and consistent safety commitment at all times. It is a
policy of OCEANCARE to ensure all work activities are carried out safely, and with all possible
measures taken to minimize or reduce risks to Occupational Health and Safety (OHS) of its
employees, contractors, visitors and anyone else who may be affected by its operations.

Lastly, this project gave us the opportunity to try our new skills to build a database system
using Oracle Apex. Despite its limitations, we also gained a deeper understanding on database
design and how it can be implemented in real life situations. We believe that we can use our
database designing skills in other projects as part of our Program to become a Database
Administrator one day hopefully.

62
10. REFERENCES
Oceancare Corporation Sdn Bhd. (2022). About Us (No. 561916-T).
https://www.oceancare.com.my/ohs-policy-objectives.php
Oceancare Corporation Sdn Bhd. (2022). Career Opportunities (No. 561916-T).
https://www.oceancare.com.my/career.php

63
11. APPENDICES
User Manual Create App

System Link : https://apex.oracle.com/pls/apex/r/sf1_cs2403c_ict501/oceancare/login?se


ssion=22126575928576
Username : 2022764733@STUDENT.UITM.EDU.MY
Password : 99pws2552_F47eNkda

STEP 1:
After you login into Oracle Apex, click on App Builder to begin the program.

Figure 58 User Manual Step 1

STEP 2:
Click on create to create the application.

Figure 59 User Manual Step 2

64
STEP 3:
Click on new application.

Figure 60 User Manual Step 3

STEP 4:
Insert your project name (Oceancare). After that, click on the add page.

Figure 61 User Manual Step 4

65
STEP 5:
You will see a lot of choices from ‘Add Page’. Choose Interactive Report.

Figure 62 User Manual Step 5

STEP 6:
Based on the diagram below, follow the steps in the numbered order.
1-Insert page name
2-Set suitable icon for the page 3-Click on Interactive Report.
4-Click on the checklist, refer to the diagram (xx) and click on the table that is related.
5-Tick on include form
6-Add page

Figure 63 User Manual Step 6

66
Figure 64 User Manual Step 6

STEP 7:
Repeat Step 6 until all pages have been added based on the table created. After that, click on
create application on bottom right. It will show the loading and building it up.

Figure 65 User Manual Step 7

67
STEP 8:
Your application page will appear. And then, click on Run Application

Figure 66 User Manual Step 8

STEP 9:
Login page will appear, so insert email and password to sign in.

Figure 67 User Manual Step 9

68
STEP 10:
After successfully sign in, you will see the home page interface. There are a few menus.

Figure 68 User Manual Step 10

STEP 11:
To see the dashboard, on the left bar, click the STATISTICS button and the dashboard will be
displayed.

Figure 69 User Manual Step 11

69

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy