Tell me about the algorithms you used to analyze the data in your project.
Write a PostgreSQL query that analyzes project task data by calculating completion metrics and ranking eligible projects. Include projects with completed tasks that have valid timestamps, and ignore rows where the calculated average completion time is NULL.
project_id, project_name, total_tasks, completed_tasks, completion_rate, avg_completion_days, and project_rank.project_rank, then project_id.| Column | Type | Description |
|---|---|---|
| project_idPK | INT | Unique project identifier |
| project_name | VARCHAR(100) | Project name |
| Column | Type | Description |
|---|---|---|
| task_idPK | INT | Unique task identifier |
| project_id | INT | Project associated with the task |
| task_name | VARCHAR(150) | Task description |
| status | VARCHAR(30) | Current task status |
| started_at | TIMESTAMP | Task start timestamp |
| completed_at | TIMESTAMP | Task completion timestamp |