Data Modeling Problem (Tasks / Timerecords / Users)
This should be close enough.



-- User USR exists.
--
user {USR}
  PK {USR}


-- Task TSK exists.
--
task {TSK}
  PK {TSK}


-- Task TSK is assigned to user USR,
-- with time estimate of EST hours.
--
task_user {TSK, USR, EST}
       PK {TSK, USR}

FK1 {TSK} REFERENCES task {TSK}
FK2 {USR} REFERENCES user {USR}


-- On date DTE user USR spent HRW hours
-- working on task TSK.
--
time_record {TSK, USR, DTE, HRW}
         PK {TSK, USR, DTE}

FK {TSK, USR} REFERENCES task_user {TSK, USR}


-- PostgreSQL, SQL Server
--
WITH
q_1 AS (
    SELECT USR
         , sum(EST) AS total_est
    FROM task_user
    GROUP BY USR
),
q_2 AS (
    SELECT USR
         , sum(HRW) AS total_log
    FROM time_record
    GROUP BY USR
)
SELECT a.USR
     , coalesce(b.total_est, 0) AS total_estimate
     , coalesce(c.total_log, 0) AS total_logged
FROM      user AS a
LEFT JOIN q_1  AS b ON b.USR = a.USR
LEFT JOIN q_2  AS c ON c.USR = a.USR ;


Note:

All attributes (columns) NOT NULL

PK = Primary Key
FK = Foreign Key