What you can do is create a schema similar to the one below. Of course, you need to add additional columns to hold additional data if you have any and also adjust the queries with datatypes specific to the RDBMS you're using.
CREATE TABLE Office(OfficeID integer , OfficeName VARCHAR(10)) CREATE TABLE Employee(EmployeeID integer , EmployeeName VARCHAR(10) , OfficeID integer , WorkingHoursID integer , UseOfficeDefaultWorkingHours Boolean) CREATE TABLE WorkingHours(ID integer , StartTime TIME , EndTime TIME , OfficeID integer , OfficeDefaultWorkingHours Boolean)
Also, don't forget to implement constraints and primary keys on your unique columns, in each of your tables.
In the Employee table you add a column to specify if the Employee is working under Default Office working hours (UseOfficeDefaultWorkingHours).
In the WorkingHours table you add a column to specify if the row contains the default working hours for the office with the help of another Boolean column, in this case OfficeDefaultWorkingHours.
You can query this schema to get the working hours for an employee with a query similar to the one below:
SELECT E.EmployeeName , W.StartTime , W.EndTime FROM Employee E INNER JOIN WorkingHours W ON E.OfficeID = WorkingHours.OfficeID AND E.UseOfficeDefaultWorkingHours = W.OfficeDefaultWorkingHours AND W.ID = CASE WHEN E.WorkingHoursID IS NOT NULL THEN E.WorkingHoursID ELSE W.ID END WHERE E.EmployeeID = 1
This query will work under a SQL Server RDBMS, but I am not sure if it will work on other RDBMS products and you might need to adjust accordingly.