0% found this document useful (0 votes)
41 views48 pages

(Contoh) KLEZCAR RENTAL MANAGEMENT SYSTEM

The document is a final report for a car rental management system created by a group of students. It includes an introduction describing the background and objectives of the project. It also includes an entity relationship diagram and relational schema describing the database tables. It provides SQL commands to define and manipulate the database. Screenshots of the user interface are included along with sample queries and outputs.

Uploaded by

Ilham Hilmi
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)
41 views48 pages

(Contoh) KLEZCAR RENTAL MANAGEMENT SYSTEM

The document is a final report for a car rental management system created by a group of students. It includes an introduction describing the background and objectives of the project. It also includes an entity relationship diagram and relational schema describing the database tables. It provides SQL commands to define and manipulate the database. Screenshots of the user interface are included along with sample queries and outputs.

Uploaded by

Ilham Hilmi
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/ 48

Faculty of Computer and Mathematical Sciences

Universiti Teknologi MARA


Shah Alam

ICT501 – DATABASE MANAGEMENT


SYSTEM
FINAL REPORT CAR RENTAL MANAGEMENT SYSTEM

NAME STUDENT ID
NUR FAZLINA BT PAUZI 2020961133
NUR AISYAH BT MOHD RAHIMAN 2020970763
NOR AIN SYAFIQAH BT REMALI 2020980343
MOHAMMAD MUAZ BIN ROSHIDI 2020973951

LECTURER’S NAME:
DR. NOR AZIAH BT DAUD

GROUP:
CS2593A
Table of Content
NO CONTENT PAGE
1. Introduction
1.1 Company Background 3
1.2 Problem Statement 3
1.3 Objective 3
2. Entity Relationship diagram 4
3. 3NF Relational Scheme 6
4. Entity Relationship Diagram narrative 6-9
5. SQL Commands
5.1 Data definition language 10 - 14
5.2 Data manipulation language 15 - 24
6. Screenshots of database systems (Menu, Reports, Forms)
6.1 Sign-in administration 25
6.2 Home 25
6.3 Dashboard 26 - 29
6.4 List table
6.4.1 Customer 30
6.4.2 Vehicle 30
6.4.3 Rental 31
6.4.4 Office 31
6.4.5 Employee 32
6.5 Administration page and control 32
6.6 Forms 33 - 36
7. Queries and outputs 37- 46
8. References 47
9. Stakeholder 48

2
1. INTRODUCTION
1.1. Company Background

Klezcar Car Rental is a car rental company and it is one of the companies with car rental service
in Malaysia. The company has been established in 2014 and it has been operating till today.
Klezcar is a trusted company which provides car rental services with variety of choices to choose
from, having a fleet of over 1800 of cars. The fleets consist of sedan cars, multi-purpose (MPV)
cars and 4X4 cars. Their fleet can cater for the need of any client, from the budget car seeker to
upscale business folk looking to propel around the area. The company have 134 branches
currently, covering most of the major city in Malaysia and still expanding day by day. It gains
customers satisfaction by providing excellent services to their customers. The company provides
services 24 hours a day and 7 days a week. Klezcar CEO, Ahmad Fuad Zainal Abidin places a
heavy emphasis on the performance of the company and has clear lines of communication
between management and support staff. Klezcar system consists of two options which is online
and walk-in. The vision of the company is to be the number one car rental company in Malaysia
and the mission of the company is to give customer satisfaction from their service. The
headquarter of the company is located at Kelana Jaya, Selangor.

1.2. Problem Statement

Currently, Klezcar Car Rental keeping records of their customers, staffs and vehicles using
manual written method that can be problematic for now. They usually have data redundancy and
inconsistency by using that method. There is loss of data, same data written more than once and
hard to find the records back if they needed to read the records again.

1.3. Objective

With the help of technology, the database system can help Klezcar achieve these objectives:

 To record the customers, staff, office, rental, vehicle, and vehicle classes data.
 To eliminate data redundancy in the database
 To easily find any record from the database

3
2. ENTITY RELATIONSHIP DIAGRAM

Figure 2.1 Entity Relational Diagram

4
3. 3NF RELATIONAL SCHEME

CUSTOMER(custIC, custName, custPhoneNo, custAddress, bookingMode, OfficeID*, StaffID*)

OFFICE(OfficeID, OfficeLocations)

STAFF(StaffID, StaffName, StaffIC, StaffPhoneNo, StaffEmail, StaffSalary, OfficeID*)

RENTAL(RentalID, RentalStartDate, RentalReturnDate, PickUpTime, ReturnTime, RentalPrice,


CustID*, OfficeID*)

VEHICLE(VehicleID, VehicleAvaiability, VehicleClassID*, RentalID*)

VEHICLECLASSES(VehicleClassID, VehicleClassName)

5
4. ENTITY RELATIONSHIP DIAGRAM NARRATIVE

DATA DICTIONARY

Entity’s Name : OFFICE

Entity’s Description : Records data of Office of Klezcar Rental

Attribute’s Name Contents Data Type Format Required PK Reference


(not null) or Table
FK

OfficeID Office’s ID Varchar2(5) Xxxxxxx Yes PK

OfficeLocations Office’s Varchar2(30) Xxxxxxx


Location

Entity’s Name : STAFF

Entity’s Description : Records data of Staff from Klezcar Rental

Attribute’s Name Contents Data Type Format Required PK Reference


(not null) or Table
FK

StaffID Staff’s ID Varchar2(10) Xxxxxxx Yes PK

StaffName Staff’s name Varchar2(20) Xxxxxxx

StaffIC Staff’s IC Varchar2(25) Xxxxxxx

StaffPhoneNo Staff’s Varchar2(20) Xxxxxxx


phone
number

StaffEmail Staff’s email Varchar2(25) Xxxxxxx

StaffSalary Staff’s salary Number(5,0) 00000

OfficeID Office ID’s Varchar2(5) Xxxxx Yes FK OFFICE


for each staff

6
Entity’s Name : CUSTOMER

Entity’s Description : Records data of customer from Klezcar Rental

Attribute’s Name Contents Data Type Format Required PK Reference


(not null) or Table
FK

CustIC Customer’s Varchar2(25) Xxxxxxx Yes PK


IC

CustName Customer’s Varchar2(20) Xxxxxxx


Name

CustPhoneNo Customer’s Varchar2(20) Xxxxxxx


phone
number

CustAddress Customer’s Varchar2(30) Xxxxxxx


address

BookingMode Type of Varchar2(10) Xxxxxxx


booking
mode

OfficeID Office’s Id Varchar2(5) Xxxxxxx Yes FK1 OFFICE

StaffID Staff’s Id Varchar2(10) Xxxxxxx Yes FK2 STAFF

7
Entity’s Name : VEHICLE

Entity’s Description : Records data of Vehicle from Klezcar Rental

Attribute’s Name Contents Data Type Format Required PK Reference


(not null) or Table
FK

VehicleID Car’s Varchar2(10) Xxxxxxx Yes PK


registration
number

VehicleAvailability Availability Varchar2(10) Xxxxxxx


of car

VehicleClassID Type of Varchar2(5) Xxxxxxx Yes FK1 VEHICLE


vehicle
CLASSES

RentalID Rental Id Varchar2(5) Xxxxxxx Yes FK2 RENTSL

for each
customer

8
Entity’s Name : RENTAL

Entity’s Description : Records data rental from customer

Attribute’s Name Contents Data Type Format Required PK Reference


(not null) or Table
FK

RentalD Rental Id for Varchar2(5) Xxxxxxx Yes PK


each customer

RentalStartDate Rental Start Date dd-mm-yy


date

RentalReturnDate Rental return Date dd-mm-yy


date

ReturnTime Return time Varchar(10) Xxxxxxx

PickUptime Pickup time Varchar(10) Xxxxxxx

OfficeID Office Id Varchar2(5) Xxxxxxx Yes FK1 OFFICE

CustIC Customer IC Varchar2(25) Xxxxxxx Yes FK2 CUSTOMER

Entity’s Name : VEHICLECLASSES

Entity’s Description : Records data for type of each vehicle from Klezcar Rental

Attribute’s Name Contents Data Type Format Required PK Reference


(not null) or Table
FK

VehicleClassID ID for each Varchar2(5) Xxxxxxx Yes PK


classes

VehicleClassName Vehicle class Varchar2(15) Xxxxxxx


name

9
5. SQL COMMANDS
5.1. Data definition language

TABLE OFFICE

CREATE TABLE "OFFICE"

( "OFFICEID" VARCHAR2(5) NOT NULL ENABLE,

"OFFICELOCATIONS" VARCHAR2(30),

PRIMARY KEY ("OFFICEID")

USING INDEX ENABLE

TABLE STAFF

CREATE TABLE "STAFF"

( "STAFFID" VARCHAR2(10) NOT NULL ENABLE,

"OFFICEID" VARCHAR2(5) NOT NULL ENABLE,

"STAFFNAME" VARCHAR2(20),

"STAFFIC" VARCHAR2(25),

"STAFFEMAIL" VARCHAR2(25),

"STAFFPHONENO" VARCHAR2(20),

"STAFFSALARY" NUMBER(5,0),

PRIMARY KEY ("STAFFID")

USING INDEX ENABLE

10
/

ALTER TABLE "STAFF" ADD FOREIGN KEY ("OFFICEID")

REFERENCES "OFFICE" ("OFFICEID") ENABLE

TABLE CUSTOMER

CREATE TABLE "CUSTOMER"

( "CUSTIC" VARCHAR2(25),

"CUSTNAME" VARCHAR2(20),

"CUSTPHONENO" VARCHAR2(20),

"CUSTADDRESS" VARCHAR2(30),

"STAFFID" VARCHAR2(10) NOT NULL ENABLE,

"OFFICEID" VARCHAR2(5) NOT NULL ENABLE,

"BOOKINGMODE" VARCHAR2(10),

PRIMARY KEY ("CUSTIC")

USING INDEX ENABLE

ALTER TABLE "CUSTOMER" ADD FOREIGN KEY ("OFFICEID")

REFERENCES "OFFICE" ("OFFICEID") ENABLE

ALTER TABLE "CUSTOMER" ADD FOREIGN KEY ("STAFFID")

REFERENCES "STAFF" ("STAFFID") ENABLE

11
TABLE RENTAL

CREATE TABLE "RENTAL"

( "RENTALID" VARCHAR2(5) NOT NULL ENABLE,

"RENTALSTARTDATE" DATE,

"RENTALRETURNDATE" DATE,

"RENTALPRICE" VARCHAR2(5),

"OFFICEID" VARCHAR2(5) NOT NULL ENABLE,

"CUSTIC" VARCHAR2(25),

"RETURNTIME" VARCHAR2(10) NOT NULL ENABLE,

"PICKUPTIME" VARCHAR2(10) NOT NULL ENABLE,

PRIMARY KEY ("RENTALID")

USING INDEX ENABLE

ALTER TABLE "RENTAL" ADD FOREIGN KEY ("OFFICEID")

REFERENCES "OFFICE" ("OFFICEID") ENABLE

ALTER TABLE "RENTAL" ADD FOREIGN KEY ("CUSTIC")

REFERENCES "CUSTOMER" ("CUSTIC") ENABLE

12
TABLE VEHICLE

CREATE TABLE "VEHICLE"

( "VEHICLEID" VARCHAR2(10),

"VEHICLEAVAILABILITY" VARCHAR2(10),

"VEHICLECLASSID" VARCHAR2(5) NOT NULL ENABLE,

"RENTALID" VARCHAR2(5) NOT NULL ENABLE,

PRIMARY KEY ("VEHICLEID")

USING INDEX ENABLE

ALTER TABLE "VEHICLE" ADD FOREIGN KEY ("VEHICLECLASSID")

REFERENCES "VEHICLECLASSES" ("VEHICLECLASSID") ENABLE

ALTER TABLE "VEHICLE" ADD FOREIGN KEY ("RENTALID")

REFERENCES "RENTAL" ("RENTALID") ENABLE

13
TABLE VEHICLECLASSES

CREATE TABLE "VEHICLECLASSES"

( "VEHICLECLASSID" VARCHAR2(5) NOT NULL ENABLE,

"VEHICLECLASSNAME" VARCHAR2(15),

PRIMARY KEY ("VEHICLECLASSID")

USING INDEX ENABLE

14
5.2. Data manipulation language

1) POPULATE STAFF TABLE


INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid,staffsalary)

VALUES(110,'Saif','951006-03-5987','Saif@yahoo.com','016-5679867','2',1999);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(100,'Steven','980101-03-5001','steven98.gmail,com','019-2333582',1,3000);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(101,'David','960201-14-5211','david96.gmail,com','014-2788261',2,2500);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(102,'Amanda','930509-06-5004','amanda93.gmail,com','012-9870263',3,3600);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(103,'Rose','951112-03-5121','rose48.gmail,com','011-8762593',1,2500);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(104,'Jackie','870909-11-6782','Jackie87@gmail,com','019-9331954',2,3200);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(105,'Hafiz','850129-07-5012','Hafizsuip@gmail,com','011-4911234',3,3000);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(106,'Angela','890312-05-6002','angela89@gmail.com','014-7599791',1,3800);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(107,'Zaidin','941202-04-5108','ZaidinSain@gmail,com','011-8144367',2,1900);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(108,'Saif','951006-03-5987','Saif@yahoo.com','016-5679867',2,1999);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

15
VALUES(109,'Aiman','980116-01-5458','Aiman@yahoo.com','012-2672867',1,1998);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(110,'Ain','970416-02-5454','Ain@yahoo.com','018-9072867',1,1997);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(111,'Lily','960106-01-5447','Lily@yahoo.com','010-5678867',2,1996);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(112,'Nini','990416-05-5675','Nini@yahoo.com','012-9072867',1,1999);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(113,'Haikal','940303-05-5275','Haikal@yahoo.com','019-9079867',3,1994);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(114,'Haziq','950303-05-5275','Haziq@yahoo.com','010-9079867',4,1995);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(115,'Hakimi','970703-03-5275','Hakimiq@yahoo.com','012-2672867',4,1997);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(116,'Amy','920703-03-5275','Amy@yahoo.com','012-2672867',4,1992);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(117,'Najihah','980602-07-5567','Najihah@yahoo.com','012-2672867',5,1998);

INSERT INTO staff(staffid,staffname,staffic,staffemail,staffphoneno,officeid)

VALUES(118,'Nabihah','971602-02-5367','Nabihah@yahoo.com','012-9077767',5,1997);

16
2) POPULATE CUSTOMER TABLE
INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('990108-03-5252','Sten','017-2788261','lot 88 jalan tar kota bharu',1,100);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('990118-02-5224','lin','019-7068261','lot 108 kampung aman machang',2,101);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('960512-04-8952','Ain','013-4586211','no 1 jalan hawa pasir mas',3,102);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('960122-01-3022','Fazlina','014-9908261','lot 99 kota bharu',1,103);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('970707-03-6078','Izzati','012-2756761','lot 519 kota bharu',1,100);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('990318-06-5556','Jasmin','013-1238261','lot 777 kota bharu',2,101);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('990611-06-5253','aiman','013-8754654','lot 211 kota bharu',3,102);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('990516-03-5435','ali','013-1238260','lot 123 kota bharu',1,100);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('990412-03-5323','aqil','013-1234231','lot 432 kota bharu',2,101);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('940412-03-5323','aqif','010-1234231','lot 433 jalan mawar kota bharu',1,103);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

17
VALUES('950108-02-5252','Akim','010-2788267','lot 88 jalan titi kota bharu',2,104);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('960508-01-5352','Ahmad','010-2788227','lot 88 jalan bunga kota bharu',2,104);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('950508-04-5352','Siti','017-6788227','lot 88 jalan bulat machang',3,105);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('9901306-03-5352','Aminah','011-6788227','lot 109 jalan bulan machang',1,106);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('9901306-01-5352','Amin','019-6788227','lot 159 jalan bulan machang',2,107);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('9801306-02-5352','Ihsan','015-2088227','lot 159 jalan madu machang',2,108);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('9401309-03-5352','Munir','017-8988227','lot 188 jalan limau pasir hor',1,109);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('9901309-03-5352','Izy','013-3988227','lot 78 jalan limau pasir hor',1,110);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('960109-02-5452','Umar','014-4948224','lot 78 jalan harimau pasir mas',2,111);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('990108-03-5452','Amir','011-4948114','lot 9 jalan bintang pasir mas',1,112);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('990113-03-5452','Amirul','015-8848114','lot 99 jalan bintu kota bharu',3,113);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('960913-03-5452','Amini','018-9048114','lot 7 jalan lam kota bharu',4,114);

18
INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('960713-02-5882','Aminul','012-9042214','lot 7 jalan lam kota bharu',4,115);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('990713-02-5882','Zila','016-6642214','lot 87 jalan biri kota bharu',5,117);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('960713-03-5672','Mila','011-6642214','lot 877 jalan op kota bharu',5,118);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('970316-02-5672','Mini','013-6643214','lot 89 jalan opi kuala krai',5,118);

INSERT INTO customer(custic,custname,custphoneno,custaddress,officeid, staffid)

VALUES('990316-02-5672','Billy','018-9643214','lot 123 jalan poli kuala krai',5,117);

3) POPULATE OFFICE TABLE


INSERT INTO office(officeid,officelocations)

VALUES(1,'kota bharu');

INSERT INTO office(officeid,officelocations)

VALUES(2,'pasir mas');

INSERT INTO office(officeid,officelocations)

VALUES(3,'machang');

INSERT INTO office(officeid,officelocations)

VALUES(4,'kuala krai');

INSERT INTO office(officeid,officelocations)

VALUES(5,'gua musang');

19
4) POPULATE RENTAL TABLE
INSERT INTO rental
(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A004',TO_DATE('2020-02-19','YYYY/MM/DD'),TO_DATE('2020-02-
20','YYYY/MM/DD'),'11:45','12:50','30','960512-04-8952','3');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A005',TO_DATE('2020-02-20','YYYY/MM/DD'),TO_DATE('2020-02-
21','YYYY/MM/DD'),'16:45','09:50','30','960512-04-8952','2');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A006',TO_DATE('2020-02-21','YYYY/MM/DD'),TO_DATE('2020-02-
22','YYYY/MM/DD'),'17:15','16:00','30','940412-03-5323','1');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A007',TO_DATE('2020-02-22','YYYY/MM/DD'),TO_DATE('2020-02-
23','YYYY/MM/DD'),'15:15','19:19','20','9901306-03-5352','1');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A008',TO_DATE('2020-02-22','YYYY/MM/DD'),TO_DATE('2020-02-
23','YYYY/MM/DD'),'18:10','11:19','15','960109-02-5452','2');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A009',TO_DATE('2020-02-21','YYYY/MM/DD'),TO_DATE('2020-02-
22','YYYY/MM/DD'),'17:00','09:20','20','990318-06-5556','2');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

20
VALUES('A010',TO_DATE('2020-02-23','YYYY/MM/DD'),TO_DATE('2020-02-
25','YYYY/MM/DD'),'12:00','19:00','30','990611-06-5253','3');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A011',TO_DATE('2020-02-25','YYYY/MM/DD'),TO_DATE('2020-02-
26','YYYY/MM/DD'),'10:00','14:00','15','960508-01-5352','2');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A012',TO_DATE('2020-02-24','YYYY/MM/DD'),TO_DATE('2020-02-
26','YYYY/MM/DD'),'09:00','20:20','20','950508-04-5352','3');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A013',TO_DATE('2020-02-25','YYYY/MM/DD'),TO_DATE('2020-02-
26','YYYY/MM/DD'),'11:10','14:30','30','9901309-03-5352','1');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A013',TO_DATE('2020-02-26','YYYY/MM/DD'),TO_DATE('2020-02-
27','YYYY/MM/DD'),'08:10','10:30','20','990108-03-5452','1');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A014',TO_DATE('2020-02-28','YYYY/MM/DD'),TO_DATE('2020-03-
01','YYYY/MM/DD'),'14:10','18:30','30','990713-02-5882','5');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A015',TO_DATE('2020-03-02','YYYY/MM/DD'),TO_DATE('2020-03-
04','YYYY/MM/DD'),'14:45','10:20','20','970316-02-5672','5');

21
INSERT INTO rental
(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A016',TO_DATE('2020-03-04','YYYY/MM/DD'),TO_DATE('2020-03-
05','YYYY/MM/DD'),'11:20','18:30','30','990316-02-5672','5');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A017',TO_DATE('2020-03-04','YYYY/MM/DD'),TO_DATE('2020-03-
05','YYYY/MM/DD'),'11:20','18:30','30','990316-02-5672','5');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A018',TO_DATE('2020-03-05','YYYY/MM/DD'),TO_DATE('2020-03-
06','YYYY/MM/DD'),'08:10','16:00','15','960122-01-3022','1');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A019',TO_DATE('2020-03-06','YYYY/MM/DD'),TO_DATE('2020-03-
07','YYYY/MM/DD'),'09:10','17:00','20','990516-03-5435','1');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A020',TO_DATE('2020-03-07','YYYY/MM/DD'),TO_DATE('2020-03-
08','YYYY/MM/DD'),'10:10','21:00','30','9901306-01-5352','2');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A021',TO_DATE('2020-03-08','YYYY/MM/DD'),TO_DATE('2020-03-
10','YYYY/MM/DD'),'14:10','11:00','15','9801306-02-5352','2');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A022',TO_DATE('2020-03-10','YYYY/MM/DD'),TO_DATE('2020-03-

22
11','YYYY/MM/DD'),'09:00','22:00','30','9401309-03-5352','1');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A023',TO_DATE('2020-03-10','YYYY/MM/DD'),TO_DATE('2020-03-
11','YYYY/MM/DD'),'09:00','22:00','30','990113-03-5452','3');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A024',TO_DATE('2020-03-11','YYYY/MM/DD'),TO_DATE('2020-03-
12','YYYY/MM/DD'),'10:25','18:00','15','950108-02-5252','2');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A024',TO_DATE('2020-03-11','YYYY/MM/DD'),TO_DATE('2020-03-
12','YYYY/MM/DD'),'10:25','18:00','15','950108-02-5252','2');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A025',TO_DATE('2020-03-13','YYYY/MM/DD'),TO_DATE('2020-03-
14','YYYY/MM/DD'),'11:25','15:00','20','990118-02-5224','2');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A026',TO_DATE('2020-03-15','YYYY/MM/DD'),TO_DATE('2020-03-
16','YYYY/MM/DD'),'10:15','17:40','15','970707-03-6078','1');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A027',TO_DATE('2020-03-17','YYYY/MM/DD'),TO_DATE('2020-03-
18','YYYY/MM/DD'),'10:55','14:20','30','960913-03-5452','4');

INSERT INTO rental


(rentalid,rentalstartdate,rentalreturndate,pickuptime,returntime,rentalprice,custic,officeid)

VALUES('A028',TO_DATE('2020-03-18','YYYY/MM/DD'),TO_DATE('2020-03-

23
20','YYYY/MM/DD'),'13:15','17:10','20','960713-02-5882','4');

POPULATE VEHICLE TABLE

INSERT INTO vehicle (vehicleid,vehicleavailability, vehicleclassid, rentalid)

Values('WWW 10','yes','A',1);

INSERT INTO vehicle (vehicleid,vehicleavailability, vehicleclassid, rentalid)

Values('WAQ 20','no','A',2);

INSERT INTO vehicle (vehicleid,vehicleavailability, vehicleclassid, rentalid)

Values('DAD 1021','yes','B',3);

INSERT INTO vehicle (vehicleid,vehicleavailability, vehicleclassid, rentalid)

Values('KED 4021','no','C',4);

INSERT INTO vehicle (vehicleid,vehicleavailability, vehicleclassid, rentalid)

Values('TAT 6789','no','C',5);

POPULATE VEHICLECLASSES TABLE

INSERT INTO vehicleclasses (vehicleclassid,vehicleclassname)

Values('A','MPV');

INSERT INTO vehicleclasses (vehicleclassid,vehicleclassname)

Values('B','Sedan');

INSERT INTO vehicleclasses (vehicleclassid,vehicleclassname)

Values('C','4x4');

24
6. SCREENSHOTS OF DATABASE SYSTEMS (MENU, REPORTS, FORMS)
6.1. Sign-in administration

Figure 6.1.1 Sign-in administration


6.2. Home

Figure 6.2.1 Home

25
6.3. Dashboard

Figure 6.3.1 Dashboard of Klezcar Car Rental database system

 For example below: Staff id = 104 handles 2 customer

Figure 6.3.2 Dashboard - Number of customer based on staff ID

26
 Office id = 1 which is located at Kota Bharu has maximum staff’s salary is RM3800 and
minimum is RM2000

Figure 6.3.3 Dashboard – Total Salary (MIN & MAX) for each employee based on office id

Figure 6.3.4 Dashboard - Type of car

27
 If we click at “walk-in” or “online” value will come out which is number of customer
based on their preference booking mode.

Figure 6.3.5 Dashboard - Number of customer based on online

 Value for customer who choose walk-in as their booking mode is 17 people

Figure 6.3.6 Dashboard - Number of customer based on walk-in

28
 Calender above show all the booking made by customer in MARCH 2020 and based on
customer’s rental ID

Figure 6.3.7 Dashboard - Display date for all booking

29
6.4. List table
6.4.1. Customer

Figure 6.4.1.1 Customer list table

6.4.2. Vehicle

Figure 6.4.2.1 Vehicle list table

30
6.4.3. Rental

Figure 6.4.3.1 Rental list table

6.4.4. Office

Figure 6.4.4.1 Office list table

31
6.4.5. Employee

Figure 6.4.5.1 Employee list table

6.5. Administration page and control

Figure 6.5.1 Administration page and control

32
6.6. Forms
6.6.1. To insert new data to table CUSTOMER
i) Click “Add Row”

Figure 6.6.1.1 Add row

ii) Fill in the new data into the row

Figure 6.6.1.2 Fill in the new data into row

33
iii) Click “Save” and the new data successfully inserted

Figure 6.6.1.3 Save data

iv) To edit data just click button “edit” or just click at the data you want to change and
then click button “save” data will successfully inserted.

Figure 6.6.1.4 Edit data

34
v) Data was successfully edited

Figure 6.6.1.5 Save data

vi) To delete data just click line button next to Rental ID and then click “Delete Row”

Figure 6.6.1.6 Delete data

35
vii) Click “Save”

Figure 6.6.1.7 Click save

viii) Data successfully deleted

Figure 6.6.1.8 Save data

36
7. QUERIES AND OUTPUTS

QUESTION 1
The HR department has requested a report of customer name and their phone number. Display the
customer name concatenated with the phone number (separated by a comma and space) and name
the column Customer name and phone.

SELECT custName||', '||custPhoneNo "Customer name and phone"


FROM CUSTOMER;

Figure 7.1 Output Question 1

37
QUESTION 2
Display the staff name,staff ic, phone number and office ID of all staff in office 1 or 2 in
ascending alphabetical order by name.

SELECT StaffName, StaffIC, StaffPhoneNo,OfficeID


FROM STAFF
WHERE OfficeID IN ('1', '2')
ORDER BY staffName ASC;

Figure 7.2 Output Question 2

38
QUESTION 3
Write a query that displays the staff name (with the first letter in uppercase and all the other
letters in lowercase) and the length of the staff name for all staff whose name starts with the
letters “S,” “A,” or “R.” Give each column an appropriate label. Sort the results by the staff’
names.

SELECT INITCAP(StaffName) "Name",


LENGTH(StaffName) "Length"
FROM STAFF
WHERE StaffName LIKE 'S%' OR StaffName LIKE 'A%' OR StaffName LIKE 'R%'
ORDER BY StaffName ;

Figure 7.3 Output Question 3

39
QUESTION 4
Create a report that produces the following for each staff: <staff name> earns <salary> monthly
but wants <3 times salary.>. Label the column Dream Salaries.

SELECT StaffName || ' earns ' || TO_CHAR(STAFFSALARY, 'fm$99,999.00') || ' monthly but
wants ' || TO_CHAR(STAFFSALARY* 3, 'fm$99,999.00') || '.' "Dream Salaries"
FROM STAFF;

Figure 7.4 Output Question 4

40
QUESTION 5
Find the highest, lowest, sum, and average salary of all employees. Label the columns Maximum,
Minimum, Sum, and Average, respectively. Round your results to the nearest whole number.

SELECT ROUND(MAX(STAFFSALARY),0) "Maximum",


ROUND(MIN(STAFFSALARY),0) "Minimum", ROUND(SUM(STAFFSALARY),0)
"Sum", ROUND(AVG(STAFFSALARY),0) "Average"
FROM STAFF;

Figure 7.5 Output Question 5

41
QUESTION 6
The HR department needs a report of Customer in Gua Musang. Display the staff name,
Customer name and Staff Salary.

SELECT e.StaffName, d.custName, e.staffSalary

FROM STAFF e JOIN CUSTOMER d

ON (e.StaffID = d.StaffID)

JOIN OFFICE c

ON (e.officeID = c.officeID)

WHERE c.officeLocations = 'gua musang';

Figure 7.6 Output Question 6

42
QUESTION 7
The HR department needs a report that displays the staff id, staff name and office id of all staffs
whose the user is prompted for a location ID.

SELECT StaffID, StaffName, OfficeID


FROM STAFF
WHERE OfficeID IN (SELECT OfficeID
FROM OFFICE
WHERE officelocations = &Enter_location);

Figure 7.7 Output Question 7

43
QUESTION 8
Produce a list of office id is 1, 2, and 3, in that order. Display office id staff name by using the set
operators

SELECT distinct OFFICEID, STAFFNAME


FROM STAFF
WHERE OFFICEID = 1
UNION ALL
SELECT DISTINCT OFFICEID, STAFFNAME
FROM STAFF
WHERE OFFICEID = 2
UNION ALL
SELECT DISTINCT OFFICEID, STAFFNAME
FROM STAFF
WHERE OFFICEID = 3

Figure 7.8 Output Question 8

44
QUESTION 9
Insert and display a new staff into the database
STAFFID: 190
OFFICEID: 1
STAFFNAME: zaileros
STAFFIC: 990108035555
STAFFEMAIL: nuraisyahcantik@gmail.com
STAFFPHONENO: 018999999
STAFFSALARY: 2000

INSERT INTO STAFF (STAFFID,OFFICEID, STAFFNAME,


STAFFIC,STAFFEMAIL,STAFFPHONENO, STAFFSALARY)
VALUES ('190','1', 'zaileros', '990108035555', 'nuraisyahcantik@gmail.com','018999999', 2000);

Figure 7.9 Output Question 9

45
QUESTION 10
Office 1 needs access to its employee data. Create a view named STAFF1 that contains the staff
id, staff names, and office numbers for all staff in office 1. They have requested that you label the
view columns staffno, staff, officeno. Then display all information in STAFF1

CREATE VIEW STAFF1 AS SELECT STAFFID staffno, STAFFNAME staff, OFFICEID


officeno FROM STAFF

WHERE OFFICEID = 1 ;

Figure 7.10 Output Question 10

SELECT *

FROM STAFF1

Figure 7.11 Output Question 10(i)

46
8. REFERENCES

1. Entrust Consulting Associates. (2018, October 18). APEX Sample Database Application [Video].
Youtube
https://youtu.be/f0ddvFcYqzQ
2. Oracle Apex. (2018, Apr 22). Oracle APEX –APEX 18.1 New Feature [Video].Youtube

https://youtu.be/XAO-B0JtxrA

3. https://klezcar.com/blog/about-us/
4. https://www.klezcar.com/partnership.php
5. https://klezcar.com/blog/contact-us/

47
9. STAKEHOLDER

Ahmad Fuad Zainal Abidin


Company Owner of Klezcar (Office Phone: 03-2615 1111)

Branch Kota Bharu (HP: 012-6095900)


Branch Pasir Mas (HP: 019-7452555)
Branch Tanah merah (HP: 019-7045777)

48

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