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)