You are on page 1of 41

SKJ2063

DATABASE MANAGEMENT SYSTEM


RESIDENTIALCOLLEGE INVENTORY MANAGEMENT SYSTEM
(ALL RESIDENTIAL COLEGE IN USIM)

NAME OF GROUP MEMBER MATRIC NUMBER

NUR AFIFAH BINTI MOHD SAMSUDIN 1170049

NUR SYAKIRAH YASMIN BINTI MOHAMAD 1170074

NUR AKMA DZARIFAH BINTI MOHD 1170076


MARDZUAN

JAMILAH HUSNA BT HJ MOHAMAD AFANDY 1151584

DR. NURZI JUANA BINTI MOHD ZAIZI


1.1 PROBLEM STATEMENT

Challenge. Our team is conducting a research on college residential inventory management


system. Every new semester registration, USIM’s Residential Colleges will distribute college inventory
form to the student in order to collect the college inventory data. USIM’s Residential Colleges consist of
students. In order to be able to collect the entire college inventory’s data systematically, effective
documentation is extremely essential. A database management system (DBMS) solution would be
extremely beneficial for this situation, but first, the database must be designed effectively and efficiently
in order to comply with the needs of this research. USIM’s Residential College does not currently have a
database system designed to conduct the data storage and management. The college is in fact using a
paper-based system where all students’ inventory records are kept in physical chart. There are several
challenges that must be overcome in order to design the database needed for this research.

Some of the challenges presented in working with paper-based are the process in designing its
database, the high cost of paper and ink printer purchases in order to print out student inventory forms.
The form must be printed according to the number of students enrolling in the USIM’s Residential
Colleges for the current semester. Furthermore, what makes this database even more worst is the fact
that some students may not submit their inventory form, in which case this may happen as students
need to fill out the form manually and need to send it to the office. On certain factors such as the
distance between residential blocks and residential college offices make it difficult for them to submit
the form. This causes the data to be taken incompletely. Moreover, every USIM’s Residential Colleges
using different system and caused unsynchronized data.
1.2BUSINESS REQUIREMENTS

We listed several requirements and expectations through this project research. The
requirements for this research are the administrator is able to view their students’ records. Next,
providing the administrator with the ability to view their facilities information of each room in the
building of residential college. Furthermore, allowing students to comment and inform the damage or
condition of the inventory in their residential college. Then, providing the agreement between students
and USIM to make sure the facilities are in good condition.

The expectations may include the automatically stored and organized databases for the
student’s facilities in their room including their comments and reports on their inventory. Next, creating
an advanced security for the access to the data, to prevent the loss of sensitive information’s of
students, the database is protected from unauthorized users. Then, ensure the safety of data.

This project will occupied the need of administrator of residential college and create a
significant management system to store students information’s in residential college. It is important to
make sure the databases are more secured and more effective. The new database system will create a
new system that fit to the need of administrator of residential college and change the paper-based
system with the better database system. It is the alternative way to keep all the information protected
and only authorized user can access the database and easier for the supervisors to check the condition
of residential college. The technician will be in charge when there are some problems with the
maintenance of the building and damage of any facilities. The problems of the inventory can be
detected by the supervisors through the new system easily and fast. Then they can inform the
technician on duty to check and repair the facilities. The students that having problems in their
residential area can inform the administrator quickly through online system so that they can save their
time and energy to go at the administrator office and write the report manually. The new system of
database will help the administrator to ensure all students had registered their residential area
electronically and record the withdrawal of the student automatically when they checked out from the
residential college. The new system will make sure the database will be managed in effective way.
1.3 LIMITATION OF CURRENT SYSTEM

As stated earlier, the current system used by the residential college to conduct the study for it
management system does not seem to contain a database structure, but instead it is based on hard-
copy paper forms. Information is collected using paper forms which are then simply kept in files. The
management officer review those file to check for the residential college problem. Undoubtedly, this
could be extremely time-consuming which may ultimately result a delay to manage and repair the
college inventory. Data of the management also cannot be retrieved to do any query because all the
data is not interacted. The possibility to have data redundancy and inconsistency is also high due to the
students that don’t send the paper form or filling the form twice. Moreover, the data would highly be
unsafe and insecure because the paper form can either lost or damage due to climate change and
natural disaster or been stolen.

1.4 PROPOSED SOLUTION

Having used a paper-based system for its student, USIM’s Residential Colleges does not have
the necessary tool or resources to enter the college information in an electronic database. This suggests
that a database design should be implemented to the college inventory information which is Residential
College Inventory Management System (RCIMS) using the database management system. The current
system makes it difficult to collect information from the student and possibly increase the level of error
when entering inventory information provided from the paper form into the computer. If the students
have the opportunity to fill the inventory information electronically, then the level of error may be
decreased as the information will automatically added to the database. The new database is designed to
increase the efficiency on managing and maintaining the inventory data in the residential college. The
new database design is also will have login permission for staff members so only authorized person can
access to the data will consequently increase the data security. The college principal data will also be
kept in the new database system so the data will be easily updated and the damage on the inventory
can be controlled. The fast update will eventually decrease the possible of data inconsistency and
redundancy. The new database system will also keep the inventory code so the process managing and
fixing the inventory will be more efficient and fast.
1.5 AYAT QURAN AND HADITH RELATED

Our project is related to a verse of Quran and two Hadith. Surah al-Saff is related to an affair and
organization. So, the organization according to this verse is a group or congregation that has a system of
order and the order is to achieve common goals. In surah al-Saff verse 4 is presented: “Indeed, Allah
loves those who fight in His cause in a row as though they are a [single] structure joined firmly.”
According to Al –Qurtubi, the intention of word ‘saff’ is to courage people to enter a line (organization)
so that they can be more systematic to achieve their goal. This project is related to this surah because
we rearrange the data to be more organized and secured. In a task,if we done it systematically and
organized, then the result will also be good. In a hadith it is explained, Aishah’s narration, that the
messenger of Allah said, “Surely Allah loves a servant who, when he works, he itqan (complete) the
work.” (HR Thabrani). In another hadith, when Aishah our prophet’s wife was asked how the prophet
conducted his affairs, she responded “His deed and actions were continuous and stable”. (Sahih Muslim)
2.1 ENTITY RELATIONSHIP DIAGRAM (ERD)

stud_email

stud_Name
stud_ID
Call_Phonenum coll_Name
coll_Name
stud_Phoneum

Student
College has

coll_Add

Assigned to
has

princ_Name
coll_name
stud_ID get

room_Num
Principle
Room

princ_ID

princ_Phonenum
contain

clarification
quantity

stud_ID
Inventory

inv_Code
room_Num
2.2 RELATIONAL MODEL

Principle

Princ_ID Coll_name Princ_name Princ_phonenum

Student

Coll_name
Stu_ID Stu_name Stu_email Stu_phonenum

College

Coll_name Coll_add Coll_phonenum

Room

Room_num
Stu_ID

Inventory

Inv_code Stu_ID Room_num Quantity Clarification


2.3 TABLE

TABLE: PRINCIPLE
PRIMARY KEY: PRINCIPLE_NAME
FOREIGN KEY: COLL_NAME

PRINC_ID PRINC_NAME PRINC_PHONENUM COLL_NAME


201 MUHAMMAD ZAINUDIN B 019-9795422 ACACIA AVENUE
JUSOH
202 SITI MARYAM BT HUSIN 012-7854306 DESA JATI
203 ABDUL LATIF B ABDUL 018-8420611 SUTERA INDAH
AZIZ
204 KAIRUDDIN B AHMAD 014-9758766 NILAM COURT
KHIR
205 KHAIRUNNISA BT JASNI 014-2309654 KIARA SATU
206 ABDULLAH B KAMALUDIN 013-8786391 PANDAN INDAH
207 SAMSUL B MOHD SAHAK 011-4321230 SINAR PERMATA
208 NUR HARLINA BT AWANG 011-3454899 KASTURI
209 MUHAMMAD JAAFAR B 017-0909822 TAMAN WANGI
TALIB
210 ZURAIDAH BT ABDUL 019-5453987 SINAR SURIA
GHANI
TABLE: STUDENT
PRIMARY KEY: STU_ID
STU_ID COLL_NAME STU_NAME STU_EMAIL STU_PHONENU
M
916098 ACACIA AVENUE MAISARAH BT HUSNI Maisarah98@gmail.com 011-9298766
916099 ACACIA AVENUE NURUL HUSNA BT KARIM princessdd@gmail.com 011-0654788
916082 DESA JATI SULAIMAN B SHAH sulaimshah@gmail.com 012-2324570
916083 DESA JATI SITI MARIAH BT BASHIR maryyB@gmailcom 014-5987433
916084 DESA JATI KHAIRINA BT HASHIM littlecaliph@gmail.com 016-7630111
916073 SUTERA INDAH KHADIJAH BT YUSUF khadyy@gmail.com 018-9138889
916074 SUTERA INDAH HAZLINA BT NASROL hazlinas@gmail.com 017-9991441
916065 NILAM COURT SAMSURI B GHANI samsughani@gmail.com 019-6224876
916066 NILAM COURT NIK AMIR B IDRIS amiridris@gmail.com 013-8776543
916067 NILAM COURT ZAHIRAH BT AHMAD bungamelur@gmail.com 011-8885532
916068 NILAM COURT ZUNAINI BT RAMLI zucomeyy@gmail.com 014-5254230
916059 KIARA SATU SYAKIRAH BT HILMI syahilmi@gmail.com 018-1298445
916060 KIARA SATU ISMAIL B ABDUL GHAFAR ismail@gmail.com 012-7765430
916061 KIARA SATU NUKMAN B ZAINI superstar@gmail.com 011-1212455
916044 PANDAN INDAH HUDA BT FAIRUZ hudafairuzzz@gmail.com 013-8777655
916045 PANDAN INDAH NUR FAIQA BT FAQRUL nurfaiqaaa@gmail.com 014-9898100
916046 PANDAN INDAH NURUL AISYAH BT MARZUKI nurulawesome@gmail.com 017-8777222
916035 SINAR PERMATA MOHD AQIL B JOHARI aqiljohari@gmail.com 012-2234166
916036 SINAR PERMATA ABDUL MUIZ B AZHAR bubblegum@gmail.com 018-9298166
916037 SINAR PERMATA JUNAIDI B ROSLI catlover@gmail.com 013-9133665
916020 KASTURI AHMAD ARIS B RAIMI arisraimi@gmail.com 019-7867866
916021 KASTURI LAILATUL HUDA BT ZAHARI mujahidah@gmail.com 011-3344112
916011 TAMAN WANGI OSMAN B ABDUL RAHIM osmanrahim@gmail.com 014-2990877
916012 TAMAN WANGI NUR NADHIRAH BT BAHARI nadirahbahari@gmail.com 017-6556455
916006 SINAR SURIA ATHIRA BT AZIZ athiraziz@gmail.com 011-7666099
916007 SINAR SURIA SAIFUL B ABDUL WAHAB saifulwahab@gmail.com 014-8866775
916008 SINAR SURIA AMALIN SOFIA BT HAKIMI amalinsofia@gmail.com 017-9133668
FOREIGN KEY: COLL_NAME
TABLE: COLLEGE
PRIMARY KEY: COLL_NAME

COLL_NAME COLL_ADD COLL_PHONENUM


ACACIA AVENUE Kolej Kediaman Acacia Avenue, 06-9876543
Blok B-1-19, Acacia Avenue
Persiaran Perdana BBN,
Taman Desa Jati,
71800 Bandar Baru Nilai,
Negeri Sembilan.
DESA JATI Desa Jati, 71800 Nilai, 06-7475312
Negeri Sembilan,
SUTERA INDAH Kolej Kediaman Sutera Indah, 06-8964509
B-08, Jalan BBN 1/3, Putra Point
Fasa 2
71800 Nilai, Negeri Sembilan
NILAM COURT Kolej Kediaman Nilam Court 06-2341689
Jalan Nilam 4/9, Fasa 5A, Taman
Nilai Utama(Nilai Impian),
Bandar Baru Nilai,
71800 Nilai, Negeri Sembilan
KIARA SATU Kiara Satu, 06-5432987
Universiti Sains Islam Malaysia,
Bandar Baru Nilai, 71800 Nilai,
Negeri Sembilan.
PANDAN INDAH Kolej Kediaman Pandan 03-3435460
L1-C, Blok A, Tingkat 1,
Glennviewvilla Apartment,
Jalan 49, Off Jalan Kuari, Taman
Pinggiran Cheras
56100 Kuala Lumpur.
SINAR PERMATA No. 2, Jalan Nilai Impian 3, Nilai 06-4309890
Impian, 71800 Nilai,
Negeri Sembilan
KASTURI Kasturi, 06-4908712
Universiti Sains Islam Malaysia,
Bandar Baru Nilai, 71800 Nilai,
Negeri Sembilan.
TAMAN WANGI 12940, Jalan BBN 1/7d, Bandar Baru 06-4539080
Nilai, 71800 Nilai, Negeri Sembilan,
SINAR SURIA Sinar Suria, 71800 Nilai, 06-3214532
Negeri Sembilan,
FOREIGN KEY: STU_ID

TABLE: ROOM

PRIMARY KEY: ROOM_NUM

ROOM_NUM STU_ID
AA001 916098
AA002 916099
DJ001 916082
DJ002 916083
DJ003 916084
SI001 916073
SI002 916074
NC001 916065
NC002 916066
NC003 916067
NC004 916068
KS001 916059
KS002 916060
KS003 916061
PI001 916044
PI002 916045
PI003 916046
SP001 916035
SP002 916036
SP003 916037
K001 916020
K002 916021
TW001 916011
TW002 916012
SS001 916006
SS002 916007
SS003 916008
FOREIGN KEY: STU_ID, ROOM_NUM

TABLE: INVENTORY

PRIMARY KEY: INV_CODE

INV_CODE STU_ID ROOM_NUM QUANTITY CLARIFICATION


AA001-1 916098 AA001 5 COMPLETE
AA002-3 916099 AA002 5 COMPLETE
DJ001-2 916082 DJ001 4 NOT COMPLETE
DJ002-1 916083 DJ002 5 COMPLETE
DJ003-2 916084 DJ003 4 NOT COMPLETE
SI001-4 916073 SI001 5 COMPLETE
SI002-3 916074 SI002 5 COMPLETE
NC001-1 916065 NC001 4 NOT COMPLETE
NC002-2 916066 NC002 4 NOT COMPLETE
NC003-3 916067 NC003 4 NOT COMPLETE
NC004-3 916068 NC004 4 NOT COMPLETE
KS001-4 916059 KS001 5 COMPLETE
KS002-1 916060 KS002 5 COMPLETE
KS003-2 916061 KS003 4 NOT COMPLETE
PI001-3 916044 PI001 5 COMPLETE
PI002-4 916045 PI002 4 NOT COMPLETE
PI003-1 916046 PI003 4 NOT COMPLETE
SP001-2 916035 SP001 5 COMPLETE
SP002-3 916036 SP002 5 COMPLETE
SP003-4 916037 SP003 5 COMPLETE
K001-1 916020 K001 4 NOT COMPLETE
K002-2 916021 K002 4 NOT COMPLETE
TW001-3 916011 TW001 5 COMPLETE
TW002-4 916012 TW002 4 NOT COMPLETE
SS001-1 916006 SS001 5 COMPLETE
SS002-2 916007 SS002 4 NOT COMPLETE
SS003-3 916008 SS003 5 COMPLETE
3.1 CREATE a database

CREATE DATABASE residentialcollegeinventorymanagementsystem;

3.2 CREATE TABLE statement

CREATE TABLE principle

( princ_id int,

princ_name varchar(255),

princ_phonenum int,

PRIMARY KEY (princ_id),

FOREIGN KEY (coll_name) REFERENCES college(coll_name));


CREATE TABLE student

( stu_id int,

stu_name varchar(255),

stu_email varchar(25),

stu_phonenum int,

PRIMARY KEY (stu_id),

FOREIGN KEY (coll_name) REFERENCES college(coll_name));

CREATE TABLE college

(coll_name varchar(25),

coll_add varchar(255),

coll_phonenum int,

PRIMARY KEY (coll_name));


CREATE TABLE room

( room_num varchar(10),

PRIMARY KEY (room_num),

FOREIGN KEY (stu_id) REFERENCES student(stu_id));

CREATE TABLE inventory

( inv_code varchar(10),

quantity int,

clarification char(20),

PRIMARY KEY (inv_code),

FOREIGN KEY (stu_id) REFERENCES student(stu_id),

FOREIGN key (room_num) REFERENCES room(room_num));


3.3 INSERT INTO statement

INSERT INTO principle

INSERT INTO principle (princ_id,princ_name,princ_phonenum,coll_name)

VALUES ('201','MUHAMMAD ZAINUDIN B JUSOH','0199795422','ACACIA AVENUE');

INSERT INTO principle (princ_id,princ_name,princ_phonenum,coll_name)

VALUES ('202','SITI MARYAM BT HUSIN','0127854306','DESA JATI');

INSERT INTO principle (princ_id,princ_name,princ_phonenum,coll_name)

VALUES ('203','ABDUL LATIF B ABDUL AZIZ','0188420611','SUTERA INDAH');

INSERT INTO principle (princ_id,princ_name,princ_phonenum,coll_name)

VALUES ('204','KAIRUDDIN B AHMAD KHIR','0149758766','NILAM COURT');

INSERT INTO principle (princ_id,princ_name,princ_phonenum,coll_name)

VALUES ('205','KHAIRUNNISA BT JASNI','0142309654','KIARA SATU');

INSERT INTO principle (princ_id,princ_name,princ_phonenum,coll_name)

VALUES ('206','ABDULLAH B KAMALUDIN','0138786391','PANDAN INDAH');

INSERT INTO principle (princ_id,princ_name,princ_phonenum,coll_name)

VALUES ('207','SAMSUL B MOHD SAHAK','0114321230','SINAR PERMATA');

INSERT INTO principle (princ_id,princ_name,princ_phonenum,coll_name)

VALUES ('208','NUR HARLINA BT AWANG','0113454899','KASTURI');

INSERT INTO principle (princ_id,princ_name,princ_phonenum,coll_name)

VALUES ('209','MUHAMMAD JAAFAR B TALIB','0170909822','TAMAN WANGI');


INSERT INTO principle (princ_id,princ_name,princ_phonenum,coll_name)

VALUES ('210','ZURAIDAH BT ABDUL GHANI','0195453987','SINAR SURIA');

INSERT INTO student

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916098','ACACIA AVENUE','MAISARAH BT HUSNI','Maisarah98@gmail.com','0119298766');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)


vALUES ('916099','ACACIA AVENUE','NURUL HUSNA BT KARIM','princessdd@gmail.com','0110654788');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916082','DESA JATI','SULAIMAN B SHAH','sulaimshah@gmail.com','0122324570');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916083','DESA JATI','SITI MARIAH BT BASHIR','maryyB@gmailcom','0145987433');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916084','DESA JATI','KHAIRINA BT HASHIM','littlecaliph@gmail.com','0167630111');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916073','SUTERA INDAH','KHADIJAH BT YUSUF','khadyy@gmail.com','0189138889');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916074','SUTERA INDAH','HAZLINA BT NASROL','hazlinas@gmail.com','0179991441');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916065','NILAM COURT','SAMSURI B GHANI','samsughani@gmail.com','0196224876');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916066','NILAM COURT','NIK AMIR B IDRIS','amiridris@gmail.com','0138776543');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916067','NILAM COURT','ZAHIRAH BT AHMAD','bungamelur@gmail.com','0118885532');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916068','NILAM COURT','ZUNAINI BT RAMLI','zucomeyy@gmail.com','0145254230');


INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916059','KIARA SATU','SYAKIRAH BT HILMI','syahilmi@gmail.com','0181298445');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916060','KIARA SATU','ISMAIL B ABDUL GHAFAR','ismail@gmail.com','0127765430');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916061','KIARA SATU','NUKMAN B ZAINI','superstar@gmail.com','0111212455');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916044','PANDAN INDAH','HUDA BT FAIRUZ','hudafairuzzz@gmail.com','0138777655');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916045','PANDAN INDAH','NUR FAIQA BT FAQRUL','nurfaiqaaa@gmail.com','0149898100');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916046','PANDAN INDAH','NURUL AISYAH BT


MARZUKI','nurulawesome@gmail.com','0178777222');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916035','SINAR PERMATA','MOHD AQIL B JOHARI','aqiljohari@gmail.com','0122234166');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916036','SINAR PERMATA','ABDUL MUIZ B AZHAR','bubblegum@gmail.com','0189298166');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916037','SINAR PERMATA','JUNAIDI B ROSLI','catlover@gmail.com','0139133665');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)


VALUES ('916020','KASTURI','AHMAD ARIS B RAIMI','arisraimi@gmail.com','0197867866');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916021','KASTURI','LAILATUL HUDA BT ZAHARI','mujahidah@gmail.com','0113344112');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916011','TAMAN WANGI','OSMAN B ABDUL RAHIM','osmanrahim@gmail.com','0142990877');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916012','TAMAN WANGI','NUR NADHIRAH BT


BAHARI','nadirahbahari@gmail.com','0176556455');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916006','SINAR SURIA','ATHIRA BT AZIZ','athiraziz@gmail.com','0117666099');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916007','SINAR SURIA','SAIFUL B ABDUL WAHAB','saifulwahab@gmail.com','0148866775');

INSERT INTO student (stu_id,coll_name,stu_name,stu_email,stu_phonenum)

VALUES ('916008','SINAR SURIA','AMALIN SOFIA BT HAKIMI','amalinsofia@gmail.com','0179133668');


INSERT INTO college

INSERT INTO college (coll_name,coll_add,coll_phonenum)

VALUES ('ACACIA AVENUE','Kolej Kediaman Acacia Avenue,Blok B-1-19, Acacia Avenue Persiaran
Perdana BBN,Taman Desa Jati,71800 Bandar Baru Nilai,Negeri Sembilan','069876543');

INSERT INTO college (coll_name,coll_add,coll_phonenum)

VALUES ('DESA JATI','Desa Jati, 71800 Nilai, Negeri Sembilan','067475312');

INSERT INTO college (coll_name,coll_add,coll_phonenum)

VALUES ('SUTERA INDAH','Kolej Kediaman Sutera Indah, B-08, Jalan BBN 1/3, Putra Point Fasa 2, 71800
Nilai, Negeri Sembilan','068964509');

INSERT INTO college (coll_name,coll_add,coll_phonenum)

VALUES ('NILAM COURT','Kolej Kediaman Nilam Court,Jalan Nilam 4/9, Fasa 5A, Taman Nilai Utama(Nilai
Impian),Bandar Baru Nilai,71800 Nilai, Negeri Sembilan','062341689');

INSERT INTO college (coll_name,coll_add,coll_phonenum)

VALUES ('KIARA SATU','Kiara Satu,Universiti Sains Islam Malaysia,Bandar Baru Nilai, 71800 Nilai,Negeri
Sembilan.','065432987');

INSERT INTO college (coll_name,coll_add,coll_phonenum)

VALUES ('PANDAN INDAH','Kolej Kediaman Pandan,L1-C, Blok A, Tingkat 1, Glennviewvilla


Apartment,Jalan 49, Off Jalan Kuari, Taman Pinggiran Cheras,56100 Kuala Lumpur.','033435460');

INSERT INTO college (coll_name,coll_add,coll_phonenum)

VALUES ('SINAR PERMATA ','No. 2, Jalan Nilai Impian 3, Nilai Impian, 71800 Nilai, Negeri
Sembilan','064309890');

INSERT INTO college (coll_name,coll_add,coll_phonenum)

VALUES ('KASTURI','Kasturi,Universiti Sains Islam Malaysia,Bandar Baru Nilai, 71800 Nilai,Negeri


Sembilan','064908712');
INSERT INTO college (coll_name,coll_add,coll_phonenum)

VALUES ('TAMAN WANGI','12940, Jalan BBN 1/7d, Bandar Baru Nilai, 71800 Nilai, Negeri
Sembilan,','064539080');

INSERT INTO college (coll_name,coll_add,coll_phonenum)

VALUES ('SINAR SURIA ','Sinar Suria, 71800 Nilai,Negeri Sembilan,','063214532');

INSERT INTO room

INSERT INTO room (room_num,stu_id)

VALUES ('AA001','916098');
INSERT INTO room (room_num,stu_id)

VALUES ('AA002','916099');

INSERT INTO room (room_num,stu_id)

VALUES ('DJ001','916082');

INSERT INTO room (room_num,stu_id)

VALUES ('DJ002','916083');

INSERT INTO room (room_num,stu_id)

VALUES ('DJ003','916084');

INSERT INTO room (room_num,stu_id)

VALUES ('SI001','916073');

INSERT INTO room (room_num,stu_id)

VALUES ('SI002','916074');

INSERT INTO room (room_num,stu_id)

VALUES ('NC001','916065');

INSERT INTO room (room_num,stu_id)

VALUES ('NC002','916066');

INSERT INTO room (room_num,stu_id)

VALUES ('NC003','916067');

INSERT INTO room (room_num,stu_id)


VALUES ('NC004','916068');

INSERT INTO room (room_num,stu_id)

VALUES ('KS001','916059');

INSERT INTO room (room_num,stu_id)

VALUES ('KS002','916060');

INSERT INTO room (room_num,stu_id)

VALUES ('KS003','916061');

INSERT INTO room (room_num,stu_id)

VALUES ('PI001','916044');

INSERT INTO room (room_num,stu_id)

VALUES ('PI002','916045');

INSERT INTO room (room_num,stu_id)

VALUES ('PI003','916046');

INSERT INTO room (room_num,stu_id)

VALUES ('SP001','916035');

INSERT INTO room (room_num,stu_id)

VALUES ('SP002','916036');

INSERT INTO room (room_num,stu_id)

VALUES ('SP003','916037');
INSERT INTO room (room_num,stu_id)

VALUES ('K001','916020');

INSERT INTO room (room_num,stu_id)

VALUES ('K002','916021');

INSERT INTO room (room_num,stu_id)

VALUES ('TW001','916011');

INSERT INTO room (room_num,stu_id)

VALUES ('TW002','916012');

INSERT INTO room (room_num,stu_id)

VALUES ('SS001','916006');

INSERT INTO room (room_num,stu_id)

VALUES ('SS002','916007');

INSERT INTO room (room_num,stu_id)

VALUES ('SS003','916008');
INSERT INTO inventory

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('AA001-1','916098','AA001','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('AA002-3','916099','AA002','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('DJ001-2','916099','DJ001','4','NOT COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('DJ002-1','916084','DJ003','4','NOT COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('SI001-4','916073','SI001','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('SI002-3','916074','S1002','5','COMPLETE');
INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('NC001-1','916065','NC001','4','NOT COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('NC002-2','916066','NC002','4','NOT COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('NC003-3','916067','NC003','4','NOT COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('NC004-3','916068','NC004','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('KS001-4','916059','KS001','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('KS002-1','916060','KS002','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('KS003-2','916061','KS003','4','NOT COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('PI001-3','916044','PI003','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('PI002-4','916045','PI002','4','NOT COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('PI003-1','916046','P1003','4','NOT COMPLETE');


INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('SP001-2','916035','SP001','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('SP002-3','916036','SP002','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('SP003-4','916037','SP003','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('K001-1','916020','K001','4','NOT COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('K002-2','916021','K002','4','NOT COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('TW001-3','916011','TW001','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('TW002-4','916012','TW002','4','NOT COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('TW002-4','916012','TW002','4','NOT COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('SS001-1','916006','SS001','5','COMPLETE');

INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('SS002-2','916007','SS002','4','NOT COMPLETE');


INSERT INTO inventory (inv_code,stu_id,room_num,quantity,clarification)

VALUES ('SS003-3','916008','SS003','5','COMPLETE');
3.4 SQL CODE to display all records

SELECT *FROM principle;

SELECT *FROM student;


SELECT *FROM college;

SELECT *FROM room;


SELECT *FROM inventory;
3.5 DISTINCT code

SELECT DISTINCT coll_name

FROM student;

3.6 COMPARISON SEARCH CONDITION

List all student with the quantity of inventory set greater then 4

SELECT inv_code, stu_id, room_num, quantity

FROM inventory

WHERE quantity >4;


3.7 PATTERN MATCHING

List all student with the string ‘COMPLETE’ in their clarification

SELECT inv_code, stu_id, room_num, quantity, clarification

FROM inventory

WHERE clarification LIKE 'COMPLETE%';

3.8 MIN, MAX and AVG

Find minimum, maximum, and average inventory quantity

SELECT MIN (quantity) AS myMin,

MAX (quantity) AS myMax,

AVG (quantity) AS myAvg FROM inventory;


4.0 REFERENCESS

1. (https://dev.mysql.com/downloads/file/?id=473605, 12 November 2017)

2. (https://www.youtube.com/watch?v=FAXhXI2Gxdc, 12 November 2017)

3. (https://www.youtube.com/watch?v=WA4SpOOYMGc&spfreload=10, 12 November 2017)

4. (https://www.youtube.com/watch?v=YH7MDcAQQ_c, 12 November 2017)

5. (https://www.youtube.com/watch?v=zQem0vL-kv8, 12 November 2017)

You might also like