Author: Carl ATTARA
This project implements a comprehensive task management database system designed to handle users, tasks, projects, and scoring mechanisms. The database supports task assignment, periodicity, categories, and progress tracking through a well-structured relational model.
BDD_CA/
βββ main.sql # Main script that orchestrates all other SQL files
βββ SQL_Tables.sql # Database schema creation (tables, constraints, views)
βββ test.sql # Sample data insertion for testing
βββ requetes.sql # SQL queries (Part 2 requirements)
βββ Modele_relationnel.html # Detailed relational model documentation
βββ README.md # This documentation
-
Utilisateur (User)
- Manages user accounts with authentication
- Tracks user scores and personal information
- Links to scoring programs
-
TΓ’che (Task)
- Base task entity with inheritance pattern
- Two specialized tables:
Tache_en_cours(ongoing) andTache_fini(completed) - Unified view through
Tachesview
-
Liste_tΓ’che (Task List)
- Organizes tasks into categorized lists
- Owned by specific users
-
PΓ©riodicitΓ© (Periodicity)
- Handles recurring task schedules
- Configurable start/end dates and intervals
-
Score_catΓ©gorie_tΓ’che (Task Category Scoring)
- Scoring system for different task categories
- Tracks completion status and points
-
Many-to-Many Relationships:
- Users β Tasks (through
Est_assigne) - Tasks β Task Lists (through
Tache_appartenant_a_liste) - Tasks β Tasks (through
Depend_defor dependencies) - Users β Projects (through
Travaille)
- Users β Tasks (through
-
One-to-Many Relationships:
- Users β Task Lists
- Users β Tasks (creator)
- Periodicity β Tasks
- Categories β Tasks
Run the main script to set up the complete database:
@@./main.sqlThis will execute in sequence:
- SQL_Tables.sql - Creates all tables and constraints
- test.sql - Inserts sample data
- requetes.sql - Executes required queries
If you prefer step-by-step execution:
-- 1. Create database structure
@@./SQL_Tables.sql
-- 2. Insert test data
@@./test.sql
-- 3. Run queries
@@./requetes.sql- ref_utilisateur (PK, INT, AUTO_INCREMENT)
- login (UNIQUE, VARCHAR(10))
- mot_de_passe (VARCHAR(255))
- score (INT)
- nom, prenom (VARCHAR(255))
- adresse (VARCHAR(511))
- pays (VARCHAR(100))
- date_de_naissance (DATE)
- date_d_inscription (DATE)
- nom_programme (VARCHAR(255), FK to Comporte)Tache (Base)
βββ Tache_en_cours (Ongoing tasks)
βββ Tache_fini (Completed tasks)Both inherit:
- Task details (title, description, priority, URL)
- Scheduling (due date, periodicity)
- Categorization and user assignment
- Status tracking
- ref_liste (PK, INT)
- nom_categorie (VARCHAR(255))
- ref_utilisateur (FK to Utilisateur)- Task Dependencies: Tasks can depend on other tasks completion
- Periodic Tasks: Configurable recurring tasks with intervals
- Scoring System: Category-based point system for task completion
- Project Management: Users can work on multiple projects
- Task Lists: Organize tasks in custom categorized lists
The test.sql file includes sample data:
- User: Theo Mabouk (login: tmabouk86)
- Project: "Cisaux"
- Task: "Papier" (ongoing task in "Bureau" category)
- Periodicity: 2-day interval recurring task
- Scoring: "Important" category worth 100 points
Additional user: Jean Dupon (login: jdupon86) with "France 4" scoring program.
- Create, assign, and track tasks
- Support for task dependencies
- Priority and deadline management
- URL attachments for task resources
- Multi-user support with authentication
- Project-based collaboration
- Personal task lists and categories
- Periodic task automation
- Flexible date/time handling
- Configurable recurrence patterns
- Category-based scoring system
- User score tracking
- Completion rewards
- Comprehensive foreign key constraints
- Business rule enforcement
- Clean separation of concerns
Unified view combining ongoing and completed tasks:
CREATE VIEW Taches AS
SELECT * FROM Tache_fini
UNION
SELECT * FROM Tache_en_cours;- Table Inheritance (Tache β Tache_en_cours/Tache_fini)
- Many-to-Many Relationships with junction tables
- Self-referencing relationships (task dependencies)
- Lookup tables for categories and scoring
- Audit trails with creation/modification dates
- Primary key constraints on all entities
- Foreign key relationships with proper cascading
- Unique constraints (user login)
- Check constraints for data validation
- NOT NULL constraints for required fields
The Modele_relationnel.html file contains detailed documentation of:
- Complete relational model
- Field descriptions and constraints
- Migration notes from conceptual to logical model
- Relationship explanations
INSERT INTO Utilisateur(login, mot_de_passe, nom, prenom, ...)
VALUES ('newuser', 'password123', 'Doe', 'John', ...);INSERT INTO Est_assigne(ref_utilisateur, ref_tache)
VALUES (user_id, task_id);SELECT t.*, u.nom, u.prenom
FROM Taches t
JOIN Est_assigne ea ON t.ref_tache = ea.ref_tache
JOIN Utilisateur u ON ea.ref_utilisateur = u.ref_utilisateur
WHERE u.ref_utilisateur = ?;This database system addresses typical task management requirements:
- β User authentication and management
- β Task creation, assignment, and tracking
- β Project-based organization
- β Recurring task scheduling
- β Category-based organization
- β Scoring and gamification
- β Task dependencies
- β Progress tracking
- β Data integrity and consistency