MINI PROJECT DB Restricted PDF
MINI PROJECT DB Restricted PDF
MINI PROJECT
2|P age
1. PROJECT PROPOSAL
i. A company of a book store have problem on saving, finding and updating their
document.
ii. It is because, all of their document is kept separately and it takes a minute to go to
where the document has been placed.
iii. Some of document are duplicate too. It creates confusion between employer at
information department to determine, which one is latest.
iv. Employer and manager need to check one by one in order to find and get the
documents they want.
v. Some of document are missing due to employer negligence.
vi. Some of documents are corrupted eaten by termites.
1.1 Objective
1.2 Requirement
To keep this mini project effective and succeed, the manager and all the employer in
information department at least know…
i. how to use and utilize PhpMyAdmin.
ii. the basic SQL code and able to implement Data Definition Language and Data
Manipulation Language in other to manage database system using SQL code.
and the company should have at least one central computer and XAMPP software.
iii. the needed entities and attributes to easier the designer to design the ER.
3|P age
2. PROJECT PLAN
- Actual Implementation
4|P age
3. DATABASE DESIGN
5|P age
4. IMPLEMENTATION AND LOADING
Table 1: Branch
Table 2: Book
6|P age
Table 3: Designer
Table 4: Manager
Table 5: Author
7|P age
Table 6: Employee
Table 7: Publisher
8|P age
4.1 Implementation of Data Definition Language
PART A
9|P age
d) CREATE TABLE Author
10 | P a g e
4.1.4 – Set the Foreign Key
11 | P a g e
4.1.5 Change the data type of Price_book on table book to Decimal (5,2)
12 | P a g e
PART B
DESCRIBE Author;
DESCRIBE Book;
DESCRIBE Branch;
13 | P a g e
DESCRIBE Customer;
DESCRIBE Designer;
DESCRIBE Employee;
DESCRIBE Manager;
14 | P a g e
DESCRIBE Publisher;
IN PhpMyAdmin :
15 | P a g e
4.2 Implementation of Data Manipulation Language
PART A
Show Table Manager:
16 | P a g e
Show Table Book:
17 | P a g e
Show book that are designed by designer with ID ‘MP341:
18 | P a g e
Show Table Employee:
Show All employee data, where the employee name start with character ‘s’:
19 | P a g e
Show Table Designer:
Show all the data for designer that use gmail as their email:
Show only Name and phone number from table designer, where the designer
name character end with N:
20 | P a g e
Show Table Book:
21 | P a g e
Show All the book that are sell on Branch = ‘B05’ and make all the book price
decreased by 5%:
Show only name and price of All the book that are sell on Branch = ‘B05’,
change the currency from MYR to USD. (RM4.17 = 1 USD). Present
Price_Book_RM as Price_Book_USD:
22 | P a g e
Show only name and price of All the book that are sell on Branch = ‘B05’,
change the currency from MYR to Rupiah Indonesia. (RM1 = 3417.13 Rupiah
Indonesia). Present Price_Book_RM as Price_Book_IDR:
23 | P a g e
Do comparison table for total of price of every branch:
Show all the book data where their price is between RM30 to RM40:
Show all the book data where their price in RM39.90 or RM33.16:
Show all the book data for Branch B05 or B02 where the price of the book is
under RM25:
24 | P a g e
PART B
Insert New Book to table book for branch B03 with the data below:
ID: MY777
Price: RM32.50
Title: Mencari Redha
Designer ID: DT380, Author ID: AU102, Publisher ID: PB860
25 | P a g e
PART C
DISTINCT:
UNION:
COUNT:
26 | P a g e
5. TESTING AND EVALUATION
Expected SQL :
SELECT * FROM Branch;
Expected SQL :
SELECT * FROM Manager;
ACTUAL :
27 | P a g e
b) Join the table Branch and Manager Where all the manager in charge in
Cahaya Sinar, Cahaya Sinar 2 and Cahaya Sinar 3.
Expected SQL :
Expected Output :
ID_Branch Name_Branch Address_Branch ID_Manager Name_Manager Phone_No_Manaager Branch_ID_in_Charge
B01 Cahaya Sinar Kota Kinabalu, MU001 Raykal Bin 0135336788 B01
Sabah Muhammadin
B02 Cahaya Sinar Sipitang, Sabah MU002 Intan Zulaika Binti 0198899892 B02
2 Leman
B03 Cahaya Sinar Kuala Lumpur MU003 Fazila Binti Idham 01129389902 B03
3
Actual Output :
28 | P a g e
c) Join the table Branch and Manager. Show only Branch Name and
manager name.
SQL:
Expected Output:
Name_Branch Name_Manager
Actual Output:
29 | P a g e
6. OPERATION
Ah Meng buy these book : Temptation Of Husband , Revenge Of Husband and Sains Alam
How much he need to pay?
30 | P a g e
7. MAINTENANCE AND EVOLUTION
Now, Company need one more table to record customer information. Using the same
database, create one table that contain;
- Cust_IC
- Cust_Name
- Purchased_Book_ID
- Phone_No
Make the Purchased_Book_ID as foreign key refer to table book where the column is
ID_Book.
Implementation:
Conclusion : The new table has been created. Database can have improvement and maintenance.
31 | P a g e
8. REFERENCES
Lucidchart. (2017, March 6) Entity Relationship Diagram (ERD) Tutorial – Part 1 [Video]. Youtube.
https://www.youtube.com/watch?v=QpdhBUYk7Kk
Rene van Eck. (2016, June 30) Crows Foot VS Chen Notation [Video].Youtube.
https://www.youtube.com/watch?v=EQg_zmGjzP4&feature=youtu.be
32 | P a g e
9. Attachment
33 | P a g e