Full Stackhard
How would you design the database schema for a task management application?
Outline the key entities, relationships, and attributes that should be included in a database schema for a task management app.
Answer
• Identify core entities: Users, Projects, Tasks, Comments. • Define relationships:
- Users can have multiple Projects.
- Projects can contain multiple Tasks.
- Tasks can have multiple Comments. • Key attributes:
- Users: id, name, email.
- Projects: id, name, userId (foreign key).
- Tasks: id, title, projectId (foreign key), status, dueDate.
- Comments: id, taskId (foreign key), userId (foreign key), content, timestamp. • Consider normalization to reduce redundancy and ensure data integrity.