Database Project Final
Database Project Final
This cover sheet must be completed, signed and firmly attached to the front of the submission. All work must be
submitted by the due date. If an extension of work is granted, an extension acknowledgement slip must be
signed by the lecturer/tutor and attached to the assignment/project/report. Please note that it is your
responsibility to retain copies of your assignment.
Plagiarism and Collusion are methods of cheating that are addressed in the Peraturan Akademik Universiti
Malaysia Sarawak para 11: Etika Akademik
Plagiarism
Plagiarism is the presentation of work which has been copied in whole or in part from another person’s work, or fro m any
other source such as the Internet, published books or periodicals without due acknowledgement given in the text.
Collusion
Collusion is the presentation of work that is the result in whole or in part of unauthorized collaboration with another person or
persons.
Where there are reasonable grounds for believing that cheating has occurred, the only action that may be taken when
plagiarism or collusion is detected is for the staff member not to mark the item of work and to report or refer the matter to
the Dean. This may result in work being disallowed and given a fail grade or if the circumstances warrant, the matter may
be referred to a Committee of inquiry for investigation. Such investigation may result in the matter being referred to the
University Discipline Committee, which has the power to exclude a student.
Upon placing signature above, I certify that I have not plagiarized the work of others or participated
in unauthorized collusion when preparing this assignment.
I also certify that I have taken proper case in safeguarding my work and have made all reasonable
efforts to ensure that my work is not able to be copied.
MARK :
1
Table of Contents
Simple Reports................................................................................................................ 14
2
Finalized ERD
The figure below shows the Entity Relationship Diagram (ERD) based on Assignment 2.
3
Command line interface (functions and data)
The database ‘db_tmb’ (The Midnight Baker MY’s database) and 4 tables ‘customers’,
‘items’, ‘bills’, and ‘purchases’ within the database were created. The figures below show
the screenshots of the functions that were involved in creating the database and tables.
4
Figure 4. Table 'bills' is created
The figures below show the usage of ‘ALTER TABLE’ function to add foreign keys and
primary keys.
5
Figure 7. Addition of 'item_id' as foreign keys
Figure 8. Setting 'bill_no' and 'item_id' as primary keys under table 'purchases'
The figures below show the usage of ‘ADD’, ‘UPDATE’, ‘DELETE’, ‘VIEW’ in the tables
created. The function ‘INSERT INTO’ is used to add new records.
1. Table ‘Items’:
6
Figure 10. Addition of more values for 'Items' table
7
2. Table ‘Customers’:
8
Create, Update, and Delete Orders
The figures below show the usage of ‘CREATE’, ‘UPDATE’, and ‘DELETE’ in the tables
created.
3. Table ‘Bills’:
9
4. Table ‘Purchases’:
10
Figures below show the usage of ‘UPDATE’ function to update the ‘quantity’.
11
Generate Reports
Figure 22. List of bills with their respective items and quantity ordered
12
Figure 23. List of bills with the respective customers, delivery details and pay status
13
Simple Reports
Figure 26. Customers' Names and Areas with their respective Orders Made
14
iii. Most-Ordered Desserts / Dessert Combo
15