Professional Documents
Culture Documents
REPORT
Presentation By
Digital
Digital Library
Library Group 5
ABSTRAK
Praise and gratitude we pray to the presence of God Almighty who has bestowed His
blessings in the form of opportunities and knowledge, so that I can complete the
final examination assignment for the Introduction to Database course entitled
"Digital Library Database Program Using MySQL". This report was prepared to fulfill
one of the assignments for the second semester course, Introduction to Databases,
under the guidance of Ms. Ultach Enri. We would like to thank the course lecturers
who have provided guidance and supervision in the preparation of this report.
Hopefully this report can be a useful guide for understanding the concept and
implementation of a digital library using a MySQL database.
INTRODUCTION
One important aspect of operating an efficient digital
library is data management. With the MySQL database,
digital libraries can take advantage of features such as
efficient collection management. We will explain how
MySQL databases can be used to efficiently store,
manage, and access book data in the context of digital
libraries, and the benefits that can be derived from
implementing them.
Presentation By Group 5
Halaman 04
TABLE OF CONTENT
The following are the points that we will discuss at this time
CREATING
DATABASE
CREATING
TABLE CREATING TABLE AUTHORS
CREATING TABLE CATEGORIES
CREATING TABLE BOOKS
CREATING TABLE USERS
CREATING TABLE LOANS
This command is used to create a new table named "Authors" in the digital_library
database. This table will be used to store information about authors in the context
of digital libraries. The "Authors" table structure consists of two columns:
DESCRIBE AUTHORS
TABLE
This command is used to create a new table named "Categories" in the currently
active database. This table will be used to store information about categories in the
context of a digital library. The "Categories" table structure consists of two columns:
DESCRIBE CATEGORIES
TABLE
This command is used to create a new table named "Books" in the currently active database. This table
will be used to store information about books in the context of a digital library. The "Books" table
structure consists of four columns:
1. COLUMN "BOOKID" WITH DATA TYPE INT (INTEGER):
2. FIELD "BOOKTITLE" WITH DATA TYPE VARCHAR(100) (CHARACTER VARIABLE):
3. COLUMN "PUBLISHED" WITH DATA TYPE DATE:
4. COLUMN "CATEGORYID" WITH DATA TYPE INT (INTEGER):
This command is used to create a new table named "Users" in the currently active database. This table
will be used to store information about users in the context of a digital library. The "Users" table
structure consists of three columns:
1. COLUMN "USERID" WITH DATA TYPE INT (INTEGER):
2. FIELD "USERNAME" WITH DATA TYPE VARCHAR(100) (CHARACTER VARIABLE):
3. COLUMN "USERROLE" WITH DATA TYPE ENUM('ADMIN', 'MEMBER')
DML COMMANDS
(INSERT (10), UPDATE (10), DELETE (10))
Halaman 07
COMMAND
Halaman 07
DELETE COMMAND
Halaman 11
RELATIONAL ALGEBRA
Relational algebra is a formal query language used to perform operations on relational
database systems. It provides a theoretical foundation for querying and manipulating data
stored in tables, which are organized into relations.
• Project book titles and authors from the "books" and "authors" relations:
Π(BookTitle, AuthorName, books ⨝ authors)
• Select books with a category other than Fiction: σ(CategoryID <> 1, books)
Halaman 07
RELATIONAL ALGEBRA
• Calculate the average loan duration for each book: Π(BookID, AVG(ReturnDate - LoanDate), loans)
• Find the authors who have written at least one book in the Fiction category: Π(AuthorName,
authors ⨝ (Π(BookID, CategoryID, σ(CategoryName = 'Fiction', categories)) ⨝ books))
• Select books published before 2022 and borrowed by User2: σ(Published <
∧
'2022-01-01' UserID = 2, books ⨝ loans)
RELATIONAL CALCULUS
Relational calculus is another formal language used to describe and retrieve data from relational
databases. Unlike relational algebra, which focuses on the operations and transformations of data,
relational calculus describes the properties and conditions that data must satisfy in order to be
retrieved.
• Join "books" and "loans" relations on BookID: { t | ∃t1, t2 (books(t1) ∧ loans(t2) ∧ t1.BookID = t2.BookID) }
• Select books borrowed by User1: { t | ∃t1, t2 (loans(t1) ∧ books(t2) ∧ t1.UserID = 1 ∧ t1.BookID = t2.BookID) }
RELATIONAL CALCULUS
• Select books with a category other than Fiction: { t | ∃t (books(t) ∧ ¬(t.CategoryID = 1)) }
• Calculate the average loan duration for each book: { t.BookID, AVG(t.ReturnDate - t.LoanDate) |∃t (loans(t)) }
• Find the authors who have written at least one book in the Fiction category: { t.AuthorName | ∃t1, t2
(authors(t1) ∧ categories(t2) ∧ books(t3) ∧ t1.AuthorID = t3.AuthorID ∧ t2.CategoryID = t3.CategoryID ∧
t2.CategoryName = 'Fiction') }
• Select books published before 2022 and borrowed by User2: { t | ∃t1, t2 (books(t1) ∧ loans(t2) ∧ t1.Published <
'2022-01-01'∧ t2.UserID = 2 ∧t1.BookID = t2.BookID) }
SELECT 15
DQL COMMANDS
DQL COMMANDS
Halaman 10
DQL COMMANDS
Halaman 10
DQL COMMANDS
Halaman 10
DQL COMMANDS
Halaman 10
DQL COMMANDS
Halaman 10
DQL COMMANDS
Halaman 10
DQL COMMANDS
Halaman 10
DQL COMMANDS
Halaman 10
DQL COMMANDS
Halaman 10
DQL COMMANDS
Halaman 10
DQL COMMANDS
Halaman 10
DQL COMMANDS
Halaman 10
DCL COMMANDS
DCL Commands (create at least 3 users, GRANT (10), REVOKE (10))
CREATE USERS
GRANT COMMAND
REVOKE COMMAND
ERD
Halaman 10
CONCLUSION
In conclusion, the digital library system
implemented using MariaDB provides a
comprehensive solution for managing and
accessing digital resources. The logical
database design, represented by the Entity-
Relationship Diagram (ERD), ensures proper
organization and relationships between
entities. The Data Definition Language (DDL)
statements create the necessary tables, and
the Data Manipulation Language (DML)
commands enable efficient data manipulation
operations.
GROUP 5
TERIMA
KASIH!
Presentasi Oleh
group 5