DEV Community

Sugumar R
Sugumar R

Posted on

Day 2 : Model Table list

Model Summary with Relationships

🔹 1. Student

Field Name Type
id Long (PK)
name String
email String
mobile String
gender String
dob LocalDate
address String
qualification String
batchTime String
course Course (ManyToOne)
fees List (OneToMany)

🔹 2. Course

Field Name Type
id Long (PK)
courseName String
duration String
fee Double
syllabus String
students List (OneToMany)
faculties List (OneToMany)

🔹 3. Faculty
Field Name Type
id Long (PK)
name String
email String
mobile String
department String
qualification String
experience int
course Course (ManyToOne)

🔹 4. Fee

Field Name Type
id Long (PK)
amount Double
paymentDate LocalDate
paymentMode String
receiptNo String
student Student (ManyToOne)

🔹 5. User (For Login)

Field Name Type
id Long (PK)
username String
password String
email String
role String (ADMIN / STUDENT / FACULTY)

🔹 6. LoginAttempt (Optional – for fraud monitoring)

Field Name Type
id Long (PK)
username String
success boolean
timestamp LocalDateTime
ipAddress String

7. Attendance Table (Student daily attendance)

Field Name Type
id Long (PK)
date LocalDate
status String (PRESENT, ABSENT)
student Student (ManyToOne)

👉 Use Case: Track student presence/absence
👉 Can create monthly report, SMS alert if absent

8. Notification Table (Email/SMS/WhatsApp logs)

Field Name Type
id Long (PK)
recipientEmail String
subject String
message String
status String (SENT, FAILED)
sentAt LocalDateTime

👉 Use Case: Track which student/faculty got which notification
👉 Useful for support & debugging

9. Feedback Table (Student Feedback)

Field Name Type
id Long (PK)
message String
rating Integer (1–5)
submittedAt LocalDateTime
student Student (ManyToOne)

👉 Use Case: Students can rate institute/faculty
👉 You can show average rating, dashboard chart

10. AuditLog Table (Admin change history log)

Field Name Type
id Long (PK)
action String (e.g. "DELETE_FEE")
module String (e.g. "FeeModule")
performedBy String (username)
timestamp LocalDateTime
ipAddress String

👉 Use Case: Fraud prevention, history trace
👉 If admin deletes or edits fees, log it

11. Enquiry Table (Public enquiry form submissions)

Field Name Type
id Long (PK)
name String
email String
mobile String
message String
submittedAt LocalDateTime

👉 Use Case: Website visitors enquiry – store & respond
👉 Admin dashboard la show panna useful

12. Batch Table (Batch-wise grouping)

Field Name Type
id Long (PK)
name String (e.g. "Morning Batch")
time String (e.g. "9 AM – 11 AM")
students List (OneToMany)

Real-time attendance system

✅ Communication tracking (Email/SMS logs)

✅ Feedback module

✅ Admin action logging (Audit)

✅ Enquiry form from homepage

✅ Batch time-wise student grouping

# Table Name
1 Student
2 Course
3 Faculty
4 Fee
5 User
6 LoginAttempt
7 Attendance ✅
8 Notification ✅
9 Feedback ✅
10 AuditLog ✅
11 Enquiry ✅
12 Batch ✅

👉 Use Case: Students split by batch
👉 Useful for batch attendance, scheduling


🔁 Relationship Summary (with Diagram Style Explanation)


Main Models

🧑‍🎓 Student

  • 🔁 ManyToOne → Course
  • 🔁 OneToMany → Fee
  • 🔁 OneToMany → Attendance
  • 🔁 OneToMany → Feedback
  • 🔁 ManyToOne → Batch

📘 Course

  • 🔁 OneToMany → Student
  • 🔁 OneToMany → Faculty

🧑‍🏫 Faculty

  • 🔁 ManyToOne → Course

💰 Fee

  • 🔁 ManyToOne → Student

👤 User

  • ❌ No FK, role-based (ADMIN / STUDENT / FACULTY)

LoginAttempt

  • No relationship — just username, timestamp, IP log


🟨 Advanced Tables & Relationships


📅 Attendance

  • 🔁 ManyToOne → Student 👉 Each student may have many attendance entries

💬 Feedback

  • 🔁 ManyToOne → Student 👉 One student gives multiple feedback entries

✉️ Notification

  • ❌ No direct FK — email/username based 👉 Store log of messages sent to students or faculty

📜 AuditLog

  • ❌ No direct FK — stores who performed what, IP-based 👉 Logs admin actions (e.g., fee deleted)

📞 Enquiry

  • ❌ No FK — submitted by external users 👉 Stores public form submission

Batch

  • 🔁 OneToMany → Student 👉 One batch may have many students

🔗 Full Relationship Flow (Simplified)

Course
 ├──┬──> Student
 │  ├──> Fee
 │  ├──> Attendance
 │  ├──> Feedback
 │  └──> Batch
 └──┬──> Faculty

User (Login only)
LoginAttempt (Logs only)

Enquiry (No relation)
Notification (Message log)
AuditLog (Admin log)
Enter fullscreen mode Exit fullscreen mode

Relationship Keywords

Relationship Meaning
OneToMany One record → Many linked rows
ManyToOne Many records → One reference
No Relation Table is stand-alone (log, form)

Top comments (0)