Final Database Relationship
The complete application works around this relationship:
text
┌──────────────┐
│ STUDENTS │
│ │
│ student_id │
└──────┬───────┘
│
│ 1
│
│ many
▼
┌──────────────┐
│ BORROW │
│ │
│ borrow_id │
│ student_id │
│ book_id │
│ borrow_date │
│ return_date │
└──────┬───────┘
│
│ many
│
│ 1
▼
┌──────────────┐
│ BOOKS │
│ │
│ book_id │
│ book_title │
│ book_author │
└──────────────┘
borrow does not duplicate student or book information.
Instead, it stores their IDs:
text
student_id → students.student_id
book_id → books.book_id
JOIN query is required when displaying readable borrow information.
---
Summary
The application demonstrates three separate CRUD systems.Students
text
Create Student
Read Students
Update Student
Delete Student
Books
text
Create Book
Read Books
Update Book
Delete Book
Borrow
text
Borrow Book
Read Borrow Records
Return Book
Delete Borrow Record
sql
INSERT
SELECT
UPDATE
DELETE
php
prepare()
execute()
query()
fetch()
fetchAll()
Sign in to save your progress permanently.
Progress is saved in your browser session
Step 9 of 9