Академический Документы
Профессиональный Документы
Культура Документы
Contents
1.
Introduction.......................................................................................................... 4
1.1.
Opening structure.......................................................................................... 4
1.2.
Problem Statement........................................................................................ 4
2.
ER Modelling........................................................................................................ 5
3.
Business Rules..................................................................................................... 7
4.
Normalisation Process.......................................................................................... 8
4.1.
For Rental....................................................................................................... 8
4.1.1.
UNF.......................................................................................................... 8
4.1.2.
1NF.......................................................................................................... 8
4.1.3.
2NF.......................................................................................................... 8
4.1.4.
3NF.......................................................................................................... 9
4.2.
For Enquery.................................................................................................. 10
4.2.1.
UNF........................................................................................................ 10
4.2.2.
1NF........................................................................................................ 10
4.2.3.
2NF........................................................................................................ 10
4.2.4.
3NF........................................................................................................ 11
4.3.
For Order...................................................................................................... 11
4.3.1.
UNF........................................................................................................ 11
4.3.2.
1NF........................................................................................................ 12
4.3.3.
2NF........................................................................................................ 12
4.3.4.
3NF........................................................................................................ 12
5.
Data Schema...................................................................................................... 14
6.
Data Dictionary.................................................................................................. 15
7.
SQL Dictionary................................................................................................... 23
8.
7.1.
DDL.............................................................................................................. 23
7.2.
DML.............................................................................................................. 26
7.2.1.
7.2.2.
Webpage Queries..................................................................................28
STAFF MENU................................................................................................. 37
8.2.
SUPPLIER MENU........................................................................................... 40
8.3.
MEMBER MENU............................................................................................ 43
8.4.
Rental........................................................................................................... 52
8.6.
Login Screen................................................................................................ 56
8.7.
Branch......................................................................................................... 58
8.8.
Enquiries...................................................................................................... 64
8.9.
9.
10.
Workload Matrix................................................................................................. 68
References...................................................................................................... 69
1. Introduction
1.1.
Opening structure
A.P.U DVD & Movies is an entertainment facility that provides DVD &
Movies rentals to customers. The company was founded in the year 2000 in
Damansara. The company has been growing, where it now has many
branches which is located around Selangor and Kuala Lumpur.
A.P.U DVD & Movies have over 50 branches that are comprised of 2000
staff and 100,000 active members. For each and every branch, there is a
manager and a few supervisors. The job of the manager is to be responsible
in maintaining the branch according to the rules and regulation that are set
by the company and the supervisors are the ones with the responsibility of
supervising groups of staff that are assigned by the managers of the branch.
1.2.
Problem Statement
The A.P.U DVD & Movies Company is currently maintaining all of the data
mentioned below in a spreadsheet system that is giving difficulties to the
company.
Datas maintained
Customer Information
Available DVD stock
Returning and Rented Date of the DVDs
Supplier details
Staff details
Branch information
The A.P.U DVD & Movies Company is currently using a spreadsheet based
system to manage data. The data tends to be inaccurate and is normally
The rules below are implemented into the APU Online Movie Rental
System.
2 main users of the system:
a) Staff
b) Customer
Staff Registration
-
Member Registration
-
DVD Registration
-
4. Normalisation Process
4.1.
For Rental
1.1.1.
UNF
Member_Sex,
Member_Phone,
Member_Password,
Staff_DOB,
Staff_Sex,
Member_Address,
Staff_ID,
Staff_Address,
Member_RegDate,
Staff_Name,
Staff_RegDate,
Staff_NIC,
Staff_Phone,
1NF
Rent_TBL
RentID, RentDate, ReturnDate, MemID, Member_Name, Member_NIC,
Member_DOB,
Member_Sex,
Member_Phone,
Staff_DOB,
Member_Address,
Member_Password,
Staff_Sex,
Staff_Address,
Member_RegDate,
Staff_ID,Staff_Name,
Staff_RegDate,
Staff_NIC,
Staff_Phone,
BranchID, BranchName,
Branch_Address, Branch_PhoneNo
RentDetail
RentID, CopyID, DVDID, DVDName, DVD_Category, DVD_Year
1.1.3.
2NF
Rent_TBL
RentID, RentDate, ReturnDate, MemID, Member_Name, Member_NIC,
Member_DOB,
Member_Sex,
Member_Phone,
Member_Password,
Staff_DOB,Staff_Sex,
Member_Address,
Staff_ID,
Staff_Address,
Member_RegDate,
Staff_Name,
Staff_RegDate,
Staff_NIC,
Staff_Phone,
BranchID, BranchName,
Branch_Address, Branch_PhoneNo
RentDetail_TBL
RentID, CopyID
DVDCopy
DVDCopy_TBL
CopyID, DVDID, DVDName, DVD_Category, DVD_Year
1.1.4.
3NF
Rent_TBL
RentID, RentDate, ReturnDate, MemID, Staff_ID,
Member_TBL
MemID,
Member_Name,
Member_NIC,
Member_DOB,
Member_Sex,
10
Position_TBL
Position_ID, Description, Salary,
Branch_TBL
BranchID, BranchName, Branch_Address, Branch_PhoneNo,
RentDetail_TBL
No, RentID, copyID,
DVDCopy_TBL
No, CopyID, DVDID, BranchID,
DVDMaster_TBL
DVDID, DVDName, DVD_Category, DVD_Year
4.2.
For Enquery
1.1.5.
UNF
EnqueryID,Enquery,Feedback,Staff_ID,Staff_Name,Staff_NIC,Staff_DOB,Sta
ff_Sex,Staff_Address,Staff_RegDate,Staff_Phone,Staff_Password,Staff_Position,
Staff_Supervisor,BranchID,BranchName,Branch_Address,Branch_PhoneNo,Me
mID,Member_Name,Member_NIC,Member_DOB,Member_Sex,Member_Addres
s,Member_Address,Member_Phone,Member_Password
1.1.6.
1NF
Enquery_TBL
EnqueryID,Enquery,Feedback,Staff_ID,Staff_Name,Staff_NIC,Staff_DOB,Sta
ff_Sex,Staff_Address,Staff_RegDate,Staff_Phone,Staff_Password,Staff_Position,
11
Staff_Supervisor,BranchID,BranchName,Branch_Address,Branch_PhoneNo,Me
mID
Member_TBL
MemID,Member_Name,Member_NIC,Member_DOB,Member_Sex,Member_
Address,Member_Address,Member_Phone,Member_Password
1.1.7.
2NF
Enquery_TBL
EnqueryID,Enquery,Feedback,Staff_ID,Staff_Name,Staff_NIC,Staff_DOB,Sta
ff_Sex,Staff_Address,Staff_RegDate,Staff_Phone,Staff_Password,Staff_Position,
Staff_Supervisor,BranchID,BranchName,Branch_Address,Branch_PhoneNo,Me
mID
Member_TBL
MemID,Member_Name,Member_NIC,Member_DOB,Member_Sex,Member_
Address,Member_Address,Member_Phone,Member_Password
1.1.8.
3NF
Enquery_TBL
EnqueryID,Enquery,Feedback,Staff_ID,MemID
Staff_TBL
Staff_ID, Staff_Name, Staff_NIC, Staff_DOB, Staff_Sex, Staff_Address,
Staff_RegDate,
Staff_Phone,
Staff_Password,
Position_ID,
BranchID,
Staff_Supervisor
12
Position_TBL
Position_ID, Description, Salary,
Branch_TBL
BranchID,BranchName,Branch_Address,Branch_PhoneNo
Member_TBL
MemID,Member_Name,Member_NIC,Member_DOB,Member_Sex,Member_
Address,Member_Address,Member_Phone,Member_Password
4.3.
For Order
1.1.9.
OrderID,
UNF
OrderDate,
Staff_DOB,
OrderStatus,
Staff_Sex,
Staff_ID,
Staff_Address,
Staff_Name,
Staff_RegDate,
Staff_NIC,
Staff_Phone,
Branch_PhoneNo,
SupPhoneNo,
SupplierID,
CopyID,
DVDID,
SupName,
DVDName,
SupAddress,
DVD_Category,
DVD_Year, Qty
1.1.10.
1NF
Order_TBL
OrderID,
Staff_DOB,
OrderDate,
Staff_Sex,
OrderStatus,
Staff_ID,
Staff_Address,
Staff_Name,
Staff_RegDate,
Staff_NIC,
Staff_Phone,
Branch_PhoneNo,
SupplierID,
SupName,
SupAddress,
SupRegDate, SupPhoneNo
OrderDetail_TBL
13
2NF
Order_TBL
OrderID,
OrderDate,
Staff_DOB,
Staff_Sex,
OrderStatus,
Staff_ID,
Staff_Address,
Staff_Name,
Staff_RegDate,
Staff_NIC,
Staff_Phone,
Branch_PhoneNo,
SupplierID,
SupName,
SupAddress,
SupRegDate, SupPhoneNo
OrderDetail_TBL
OrderID, copyID, Qty
DVDCopy_TBL
CopyID, DVDID, DVDName, DVD_Category, DVD_Year, BranchID, Status
1.1.12.
3NF
Order_TBL
OrderID, OrderDate, OrderStatus, Staff_ID, SupplierID
Supplier_TBL
SupplierID, SupName, SupAddress, SupRegDate, SupPhoneNo,
Staff_TBL
14
Staff_Phone,
Staff_Password,
Position_ID,
BranchID,
Staff_Supervisor
Position_TBL
Position_ID, Description, Salary,
Branch_TBL
BranchID, BranchName, Branch_Address, Branch_PhoneNo
OrderDetail_TBL
No, OrderID, copyID, Qty
DVDCopy_TBL
CopyID, DVDID, BranchID, Status
DVDMaster_TBL
DVDID, DVDName, DVD_Category, DVD_Year
5. Data Schema
15
6. Data Dictionary
16
Branch Table
Table Name (Branch)
Fields
Data Type
Descriptio
n
Auto
Generate
Allow
Null
Values
Yes from
(100 and
Incremente
d by 1
NO
NO
NO
NO
NO
NO
BranchI
D
int
ID For
Branch
Name
varchar(30
)
varchar(80
)
int
Name of
the Branch
Address of
Branch
Phone No
of Branch
Address
PhoneN
O
Primar
y Key
or
Foreign
Key
PK
Referenc
e Table
Referenc
e Field
NO
Position Table
Table Name (Position)
Fields
Data Type
Descriptio
n
Auto Generate
Allow
Null
Values
Yes from (1
and
Incremented
by 1
NO
NO
NO
NO
PositionID
int
ID For
Position
Descriptio
n
varchar(20
)
Salary
int
Descriptio
n of the
staff
position
Salary of
the staff
Primary
Key or
Foreign
Key
PK
Referenc
e Table
Referenc
e Field
NO
17
Member Table
Table Name (Member)
Fields
Data Type
Descriptio
n
Auto
Generate
Allow
Null
Values
Yes from
(10000 and
Incremente
d by 1
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
MemID
Int
ID For
member
Name
DOB
varchar(30
)
varchar(15
)
date
Sex
char(1)
Address
varchar(80
)
Name of
member
NIC of
member
Date of
birth of
nember
Gender of
the
member
Address of
member
RegDate
date
Date of
registration
NO
NO
PhoneNo
int
NO
NO
Passwor
d
varchar(16
)
Phone
number of
member
Password
of the
member
NO
NO
NIC
Primary
Key or
Foreign
Key
PK
Referenc
e Table
Referenc
e Field
NO
18
Staff Table
Table Name (Staff)
Fields
Data Type
Descriptio
n
Auto
Generate
Allow
Null
Values
Yes from
(20000 and
Incremente
d by 1
NO
NO
NO
NO
NO
NO
NO
NO
Primary
Key or
Foreign
Key
PK
Referenc
e Table
Reference
Field
StaffID
int
ID for staff
Name
DOB
varchar(50
)
varchar(15
)
date
Sex
char(1)
Name of
staff
Address of
staff
Date of
birth of
staff
Gender of
the staff
Address
varchar(80
)
Address of
staff
NO
NO
RegDate
date
Date of
registration
NO
NO
PhoneNo
int
NO
NO
BranchID
int
Phone
number of
staff
Branch ID
for staff
NO
NO
FK
Branch
BranchID
PositionID
int
Position ID NO
for staff
NO
FK
Position
PositionI
D
SupervisorI
D
int
Supervisor
ID for staff
NO
YES
FK
Staff
StaffID
Password
varchar(16
)
Password
of the
member
NO
NO
NIC
NO
19
Enquiry Table
Table Name (Enquery)
Fields
Data Type
Description
Auto Generate
Allow
Null
Values
Yes from
(90000 and
Incremented
by 1
NO
NO
NO
NO
YES
NO
EnqID
int
ID for
enquiries
MemID
int
Enquery
varchar(200
)
varchar(200
)
int
Name of
member
enquiries of
member
Feedback of
member
Staff ID of
the staff
FeedBK
StaffID
Referenc
e Table
Referenc
e Field
NO
Primary
Key or
Foreign
Key
PK
NO
FK
Member
MemID
YES
FK
Staff
StaffID
Referenc
e Table
Referenc
e Field
Member
MemID
Reservation Table
Table Name (Reserve)
Fields
Data Type
Description
Auto Generate
Allow
Null
Values
ResevID
int
ID for
reservation
NO
MemID
int
NO
PK
Status
varchar(10
)
NO
NO
ReserveDat
e
date
ID of
member
Status of
Reservatio
n
Date of
Reservatio
n
Yes from
(30000 and
Incremented
by 1
NO
Primary
Key or
Foreign
Key
PK
NO
NO
20
Reservation Details
Table Name (ReserveDetail)
Fields
Data Type
Description
Auto
Generate
Allow
Null
Values
Reference
Table
Referenc
e Field
NO
Primary
Key or
Foreign
Key
PK
No
int
ResevID
int
Yes from (1
and
Incremente
d by 1
NO
CopyID
int
ID number
for
reservation
details
Reservatio
n ID
It is a
unique ID
for the
DVD
NO
FK
Reserve
ResevID
NO
NO
FK
DVDCop
y
CopyID
Primary
Key or
Foreign
Key
PK
Reference
Table
DVD Master
Table Name (DVDMaster)
Fields
Data Type
Descriptio
n
Auto
Generate
Allow
Null
Values
DVDID
int
ID for
DVD
NO
Name
varchar(50) Name of
DVD
varchar(10) Category
of DVD
int
Year of
DVD
Yes from
(40000 and
Incremente
d by 1
NO
NO
NO
NO
NO
Category
Year
Referenc
e Field
NO
21
Rent
Table Name (Rent)
Fields
Data Type
Descriptio
n
Auto
Generate
RentID
int
MemID
int
RentDate
date
ReturnDate
date
StaffID
int
Allow
Null
Values
Referenc
e Table
Referenc
e Field
NO
Primary
Key or
Foreign
Key
PK
NO
FK
Member
MemID
FK
Staff
StaffID
NO
YES
NO
Rent Detail
Table Name (RentDetail)
Fields
Data Type
Descriptio
n
Auto Generate
Allow
Null
Values
No
int
ID number
for rent
details
RentID
int
CopyID
int
Name of
member
ID of DVD
copy
Yes from (1
and
Incremented
by 1
NO
NO
Reference
Table
Referenc
e Field
NO
Primary
Key or
Foreign
Key
PK
NO
FK
Rent
RentID
NO
FK
DVDCop
y
CopyID
22
Supplier Table
Table Name (Supplier)
Fields
Data Type
Description
Auto
Generate
Allow
Null
Values
SupID
int
ID for
Supplier
NO
Name
varchar(30) Name of
supplier
varchar(80) Supplier
address
date
Registratio
n date
int
Phone
number of
supplier
Yes from
(1000 and
Incremente
d by 1
NO
NO
NO
NO
NO
NO
NO
Address
RegDate
PhoneNo
Primary
Key or
Foreign
Key
PK
Referenc
e Table
Referenc
e Field
Referenc
e Table
Referenc
e Field
NO
Order Table
Table Name (Order)
Fields
Data Type
Descriptio
n
Auto
Generate
Allow
Null
Values
OrderID
int
ID for
order
NO
StaffID
int
Yes from (1
and
Incremente
d by 1
NO
Primary
Key or
Foreign
Key
PK
NO
FK
Staff
StaffID
NO
NO
FK
Supplier
SupID
NO
NO
NO
NO
SupID
Date
Status
Name of
staff
int
ID for
supplier
date
Date of
order
varchar(10) Status of
order
23
Order Details
Table Name (OrderDetail)
Fields
Data
Type
Description
Auto Generate
Allow
Null
Values
No
int
ID number
for order
OrderID
DVDID
int
int
ID of order
ID of DVD
Yes from (1
and
Incremented
by 1
NO
NO
Qty
int
Quantity of
order details
NO
NO
Reference
Table
Referenc
e Field
NO
Primary
Key or
Foreign
Key
PK
NO
NO
FK
FK
Order
DvDMaste
r
OrderID
DVDID
24
7. SQL Dictionary
7.1.
DDL
Create Database
CREATE DATABASE APURENT;
Branch Table
CREATE TABLE [dbo].[Branch](
[BranchID] [int] IDENTITY(100,1) NOT NULL PRIMARY KEY,
[Name] [varchar](30) NOT NULL,
[Address] [varchar](80) NOT NULL,
[PhoneNo] [int] NOT NULL,)
Position Table
CREATE TABLE [dbo].[Position](
[PositionID] [int]IDENTITY (1,1) NOT NULL PRIMARY KEY,
[Description] [varchar](20) NOT NULL,
[Salary] [int] NOT NULL,)
Member Table
CREATE TABLE [dbo].[Member](
[MemID] [int] IDENTITY (10000,1) NOT NULL PRIMARY KEY,
[Name] [varchar](30) NOT NULL,
[NIC] [varchar](15) NOT NULL,
[DOB] [date] NOT NULL,
[Sex] [char](1) NOT NULL,
[Address] [varchar](80) NOT NULL,
[RegDate] [date] NOT NULL,
[PhoneNo] [int] NOT NULL,
[Password] [varchar](16) NOT NULL,)
25
Staff Table
CREATE TABLE [dbo].[Staff](
[StaffID] [int] IDENTITY (20000,1) NOT NULL PRIMARY KEY,
[Name] [varchar](50) NOT NULL,
[NIC] [varchar](15) NOT NULL,
[DOB] [date] NOT NULL,
[Sex] [varchar](1) NOT NULL,
[Address] [varchar](80) NOT NULL,
[RegDate] [date] NOT NULL,
[PhoneNo] [int] NOT NULL,
[BranchID]
[int]
NOT
NULL,
FOREIGN
KEY
REFERENCES
NOT
NULL,
FOREIGN
KEY
REFERENCES
Branch(BranchID),
[PositionID]
[int]
Position(PositionID),
[SupervisorID] [int] FOREIGN KEY REFERENCES Staff(StaffID),
[Password] [varchar](16) NOT NULL,)
Enquiry Table
CREATE TABLE [dbo].[Enquery](
[EnqID] [int] IDENTITY (90000,1) NOT NULL PRIMARY KEY,
[MemID] [int] FOREIGN KEY REFERENCES Member(MemID),
[Enquery] [varchar](200) NOT NULL,
[FeedBK] [varchar](200) NULL,
[StaffID] [int] FOREIGN KEY REFERENCES Staff(StaffID))
Reservation Table
CREATE TABLE [dbo].[Reserve](
[ResevID] [int] IDENTITY (30000,1) NOT NULL PRIMARY KEY,
[MemID] [int] NOT NULL FOREIGN KEY REFERENCES Member(MemID),
[Status] [varchar](10) NOT NULL,
26
[int]
NOT
NULL
FOREIGN
KEY
REFERENCES
Reserve(ResevID),
[CopyID] [int] NOT NULL FOREIGN KEY REFERENCES DVDCopy(CopyID))
DVD Master
CREATE TABLE [dbo].[DVDMaster](
[DVDID] [int] IDENTITY (40000,1) NOT NULL PRIMARY KEY,
[Name] [varchar](50) NOT NULL,
[Category] [varchar](10) NOT NULL,
[Year] [int] NOT NULL,
DVD Copy
CREATE TABLE [dbo].[DVDCopy](
[CopyID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
[DVDID]
[int]
NOT
NULL
FOREIGN
KEY
REFERENCES
DVDMaster(DVDID),
[BranchID]
[int]
NOT
NULL
FOREIGN
KEY
REFERENCES
Branch(BranchID),
[Status] [varchar](10) NOT NULL,)
Rent
CREATE TABLE [dbo].[Rent](
[RentID] [int] IDENTITY(50000,1) NOT NULL PRIMARY KEY,
[MemID] [int] NOT NULL FOREIGN KEY REFERENCES Member(MemID),
[RentDate] [date] NOT NULL,
27
[ReturnDate] [date],
[StaffID] [int] NOT NULL FOREIGN KEY REFERENCES Staff(StaffID))
Rent Detail
CREATE TABLE [dbo].[RentDetail](
[No] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
[RentID] [int] NOT NULL FOREIGN KEY REFERENCES Rent(RentID),
[CopyID] [int] NOT NULL FOREIGN KEY REFERENCES DVDCopy(CopyID))
Supplier Table
CREATE TABLE [dbo].[Supplier](
[SupID] [int]IDENTITY (1000,1) NOT NULL PRIMARY KEY,
[Name] [varchar](30) NOT NULL,
[Address] [varchar](80) NOT NULL,
[RegDate] [date] NOT NULL,
[PhoneNo] [int] NOT NULL,)
Order Table
CREATE TABLE [dbo].[Order](
[OrderID] [int] IDENTITY (1,1) NOT NULL PRIMARY KEY,
[StaffID] [int] NOT NULL FOREIGN KEY REFERENCES Staff(StaffID),
[SupID] [int] NOT NULL FOREIGN KEY REFERENCES Supplier(SupID),
[Date] [date] NOT NULL,
[Status] [varchar](10) NOT NULL,)
Order Details
CREATE TABLE [dbo].[OrderDetail](
[No] [int] IDENTITY (1,1) NOT NULL PRIMARY KEY,
[OrderID] [int] NOT NULL FOREIGN KEY REFERENCES [Order](OrderID),
28
[DVDID]
[int]
NOT
NULL
FOREIGN
KEY
REFERENCES
DvDMaster(DVDID),
[Qty] [int] NOT NULL,)
7.2.
DML
1.1.13.
Branches
INSERT INTO [APURENT].[dbo].[BRANCH] ([Name],[Address],[PhoneNo])
VALUES ('Kuala Lumpur Branch','Kuala Lumpur, Bangunan Bangkok Bank,
50000','322626222')
Staff
INSERT
[Address],
INTO
[APURENT].[dbo].[STAFF]
[RegDate],
[Password])
([Name],[NIC],[DOB],
[SEX],
[PhoneNo],[PositionID],[BranchID],[SupervisorID],
VALUES
','850116071344','01/16/1985','M','Kajang,
('Miles
5
Residency
Rodenberger
IOI
Resort,
43000','11/25/2000','362016088','3','101','NULL','welcome')
Member
INSERT INTO [APURENT].[dbo].[MEMBER] ([Name], [NIC], [DOB], [SEX],
[Address], [RegDate], [PhoneNo], [Password]) VALUES ('Stuart Shumate ',
'880128049836', '1/28/1988', 'M', 'Gopeng,
31600',
29
INTO
[APURENT].[dbo].[DVDCopy]
([DVDID],
[BRANCHID],
Order Data
INSERT INTO [APURENT].[dbo].[Order] ([StaffID] , [SupID] , [Date],
[Status]) VALUES ('20065', '1004', '01/04/2011', 'Delivered')
Order Detail
INSERT INTO [APURENT].[dbo].[OrderDetail] ([OrderID] ,[DVDID] ,[Qty])
VALUES ('1','40006','10')
Rent
INSERT
INTO
[APURENT].[dbo].[Rent]
([MemID]
[RentDate]
Webpage Queries
30
SELECT Staff.StaffID,
Staff.NIC,
Staff.Sex,
Staff.Name,
Position.Description AS Position,
Staff.Address,
Staff.PhoneNo,
Staff_1.Name AS
Supervisor
FROM Staff INNER JOIN
Position ON Staff.PositionID = Position.PositionID LEFT OUTER JOIN
Staff AS Staff_1 ON Staff.SupervisorID = Staff_1.StaffID
WHERE (Staff.Name LIKE '%' + @Name + '%')
Search By Staff ID
SELECT * FROM [Staff] WHERE ([StaffID] = @StaffID)
Update Query for Staff
UPDATE
Staff
SET Name = @Name, NIC = @NIC, DOB = @DOB, Sex = @Sex, Address
= @Address, RegDate = @RegDate, PhoneNo = @PhoneNo, BranchID =
@BranchID,
PositionID = @PositionID,
SupervisorID = @SupervisorID,
Password = @Password
WHERE (StaffID = @original_StaffID) AND (Name = @original_Name) AND
(NIC
@original_NIC)
AND
(DOB
@original_DOB)
AND
(Sex
@original_Password)
AND
(PositionID
@original_SupervisorID)
OR
(StaffID
@original_PositionID)
AND
@original_StaffID)
AND
(Password
AND
(Name
31
32
SELECT
StaffID,
Name,
NIC,
DOB,
Sex,
Address,
RegDate,
Staff
(StaffID =
(SELECT
MAX(StaffID) AS Expr1
FROM
Staff AS Staff_1))
MAX(SupID) AS Expr1
FROM
Supplier AS Supplier_1))
MemID,
Name,
NIC,
DOB,
Sex,
Address,
RegDate,
PhoneNo, Password
FROM
WHERE
Member
(MemID =
(SELECT
FROM
MAX(MemID) AS Expr1
Member AS Member_1))
Update member
ASIAN PACIFIC UNIVERSITY
33
UPDATE
Member
SET
(MemID = @MemID)
Delete member
DELETE FROM Member
WHERE
(MemID = @MemID)
Select Member
SELECT
MemID,
Name,
NIC,
DOB,
Sex,
Address,
RegDate,
PhoneNo, Password
FROM
WHERE
Member
(Name LIKE '%' + @Name + '%')
Max DVD
SELECT
FROM
WHERE
MAX(DVDID) AS MaxDVD
FROM
DVDMaster AS DVDMaster_1))
Edit DVD
UPDATE
SET
WHERE
DVDMaster
Name = @Name, Category = @Category, Year = @Year
(DVDID = @DVDID)
Insert DVD
ASIAN PACIFIC UNIVERSITY
34
Delete DVD
DELETE FROM [DVDMaster] WHERE [DVDID] = @DVDID
MAX(CopyID) AS MAxCopy
DVDCopy AS DVDCopy_1))
DVDCopy
SET
@Status
WHERE
(CopyID = @CopyID)
(CopyID = @CopyID)
35
DVDCopy.CopyID,
DVDMaster.Name,
Branch.BranchID,
JOIN
Branch ON DVDCopy.BranchID = Branch.BranchID
WHERE
Select Enquiry
SELECT Enquery AS [Please State your Question in Breif],
MemID AS
Enquery.EnqID,
Enquery.MemID,
Enquery.Enquery,
OUTER
JOIN
Staff
ON
Enquery.StaffID
Staff.StaffID
WHERE
(Enquery.MemID = 10000)
Answered Enquiries
SELECT EnqID, MemID, Enquery, FeedBK, StaffID FROM Enquery WHERE
(FeedBK IS NOT NULL)
Update Enquiries
ASIAN PACIFIC UNIVERSITY
36
[Enquery] = @Enquery,
[Member Name],
Rent.RentDate,
Rent.ReturnDate,
Member.Name AS
Staff.Name AS [Staff
Name]
FROM
JOIN
DVDCopy ON RentDetail.CopyID = DVDCopy.CopyID INNER
JOIN
DVDMaster ON DVDCopy.DVDID = DVDMaster.DVDID
INNER JOIN
Member ON Rent.MemID = Member.MemID INNER JOIN
Staff ON Rent.StaffID = Staff.StaffID
WHERE
(Rent.RentID = @RentID)
37
SELECT
Branch.BranchID,
Branch.PhoneNo,
Branch.Name,
Branch.Address,
Staff.PhoneNo AS
[Manager Phone]
FROM
WHERE
Update Branches
UPDATE [Branch] SET [Name] = @Name,
[Address] = @Address,
MAX(BranchID) AS BRN
FROM
Branch AS Branch_1))
INNER JOIN
ASIAN PACIFIC UNIVERSITY
38
([Order].OrderID = @OrderID)
[Order].OrderID,
[Order].Date, [Order].Status
FROM
INNER JOIN
Supplier ON [Order].SupID = Supplier.SupID INNER JOIN
DVDMaster ON OrderDetail.DVDID = DVDMaster.DVDID
WHERE
([Order].OrderID = @OrderID)
Search Oder
SELECT * FROM [Order] WHERE ([OrderID] = @OrderID)
Rent Member
SELECT
Rent.RentID,
Rent.RentDate, Rent.ReturnDate
FROM
WHERE
(Rent.RentID = @RentID)
Branch.Name AS [Branch
Name]
39
FROM
JOIN
Branch ON Staff.BranchID = Branch.BranchID
40
8.1.
STAFF MENU
This is the staff search menu. There are four buttons at the top, whereby
the user is able to input a new staff, search for a staff, edit the details of a
staff and return to the home page. In this search menu, the user will type in
41
the name of the staff and click search. The results are displayed in a table at
the bottom of the page.
Figure 2 Edit
This is the staff edit menu. The user is able to edit a staffs detail by
searching the staffs ID. In the edit page, information can also be deleted.
The results will appear in a table at the bottom of the page.
42
This is the staff menu to register new staff members. In this page, the
user is able to update the database with information of a new staff member.
43
8.2.
SUPPLIER MENU
Figure 4 Supplier
This is the supplier search menu. There are four buttons at the top,
whereby the user is able to input a new supplier, search for a supplier, edit
the details of a supplier and return to the home page. In this search menu,
the user will type in the name of the supplier and click search. The results
are displayed in a table at the bottom of the page.
44
Figure 5 Edit
This is the supplier edit menu. The user is able to edit a suppliers detail
by searching the suppliers ID. In the edit page, information can also be
deleted. The results will appear in a table at the bottom of the page.
45
This is the supplier menu to register new suppliers. In this page, the user
is able to update the database with information of a new supplier. Once the
registration is done, the name will be in the system towards all of the
branches.
46
8.3.
MEMBER MENU
This is the member search menu. There are four buttons at the top,
whereby the user is able to input a new member, search for a member, edit
the details of a member and return to the home page. In this search menu,
the user will type in the ID of the member and click search. The results are
displayed in a table at the bottom of the page.
47
This is the member edit menu. The staff is able to edit a members detail
by searching the members name. In the edit page, information can also be
deleted. The results will appear in a table at the bottom of the page.
48
This is the member menu to register new members. In this page, the user
is able to update the database with information of a new member. Whenever,
there is a new member that is registered, it will save into the system towards
all of the branches.
49
8.4.
This is the DVD master search menu. There are four buttons at the top,
whereby the user is able to input a new DVD, search for a DVD, edit the
details of a DVD and return to the home page. In this search menu, the user
will type in the name of the DVD and click search. The results are displayed
in a table at the bottom of the page.
50
This is the DVD master edit menu. The user is able to edit a DVDs detail
by searching the DVDs ID. In the edit page, information can also be deleted.
The results will appear in a table at the bottom of the page.
51
This is the DVD master menu to register new DVDs. In this page, the user
is able to update the database with information of a new DVD.
52
This is the DVD copy search menu. There are four buttons at the top,
whereby the user is able to input a new duplicate DVD, search for a duplicate
DVD, edit the details of a duplicate DVD and return to the home page. In this
search menu, the user will type in the name of the DVD and click search. The
results of duplicate DVDs are displayed in a table at the bottom of the page.
53
This is the DVD copy edit menu. The user is able to edit a duplicate DVDs
detail by searching the duplicate DVDs ID. In the edit page, information can
also be deleted. The results will appear in a table at the bottom of the page.
54
This is the DVD copy menu to register new duplicate DVDs. In this page,
the user is able to update the database with information of a new duplicate
DVD.
55
8.5.
Rental
To Create a new rental key in the reservation ID which is provided by the member
and change the status to Processed so that it will be marked as processed and
rented
56
This screen is about returning DVD. Enter the Rent ID and key in the Return Date for
the entry.
57
58
To edit a rent key in the rent id and the detail will be displayed below.
Once its displayed edit the entries. But to delete the entry the user will have
to delete all the detail below before delete in the rent.
59
8.6.
Login Screen
60
61
8.7.
Branch
62
63
64
Select new order and add the new order header details and then add the order
details and will be listed below in a grid
65
66
67
8.8.
Enquiries
68
Customer Enters new question on the above screen and click insert which will be
displayed by the staff and answered. The status can checked for the status button.
Here customer can list all the question which they have asked.
69
8.9.
Customer can browser for the DVD from this screen at the top right is the search
field box.
70
To make a reservation member first create a reservation number and add the DVD
which he required to the reservation. Once added it will be displayed in a grid below.
71
9. Workload Matrix
Workd
BENJAMIN
LEONG KIAN JIN
(TP019597)
IBRAHIM IRUFAN
MERVYN
(TP031779)
HOW KEAN YIP
(TP025423)
Introduction
33.33
33.33
33.33
ER Modeling
33.33
33.33
33.33
Business Rules
33.33
33.33
33.33
Normalization Process
33.33
33.33
33.33
Data Schema
33.33
33.33
33.33
Data Dictionary
33.33
33.33
33.33
SQL Dictionary
33.33
33.33
33.33
33.33
33.33
33.33
72
10.
References
Alohatechsupport.net. 2013. Image Menu with Jquery - Design Tips & Techniques - Maui Blog.
[online] Available at: http://www.alohatechsupport.net/webdesignmaui/maui-web-sitedesign/create_image_menu_with_jquery.html [Accessed: 01 Sep 2013].
Cinemas, G. 2013. Golden Screen Cinemas ::. [online] Available at: http://www.gsc.com.my/
[Accessed: 1 Sep 2013].
Haahr, M. 2013. RANDOM.ORG - List Randomizer. [online] Available at:
http://www.random.org/lists/ [Accessed: 02 Sep 2013].
Imdb.com. 2013. IMDb - Movies, TV and Celebrities. [online] Available at:
http://www.imdb.com/ [Accessed: 15 Aug 2013].
Listofrandomnames.com. 2013. List of Random Names. [online] Available at:
http://listofrandomnames.com/index.cfm?textarea [Accessed: 7 Sep 2013].
Lou, M., Lou, M. and Lou, M. 2010. Awesome Cufonized Fly-out Menu with jQuery and CSS3 |
Codrops. [online] Available at: http://tympanus.net/codrops/2010/06/28/awesomecufonized-fly-out-menu/ [Accessed: 29 Aug 2013].
73