Could someone help me with a rough database schema for a timesheet application where the i would be able to
Store hours per day for a time period ( 2 weeks ) fo
Here is a rough sketch that will give you a good start:
Project
-------
ProjectId PK
ProjectName varchar(200)
Employee
---------
EmployeeId PK
EmployeeName (or first name/last name etc..)
// .. other employee attributes
ProjectTimesheet
----------------
ProjectTimesheetId PK
ProjectId FK -> Project.ProjectId
EmployeeId FK -> Employee.EmployeeId
StartTime DATETIME
EndTime DATETIME
Approved bit
EDIT: As an alternative to the approved flag in each ProjectTimesheet row, you could instead separate out the approved status to a separate table. For example, to allow approval for an employee's timesheet over a given period, a manager would add an approval entry to the Approval table:
Approval
--------
ApprovalID PK
EmployeeId FK -> Employee.EmployeeId
StartTime DATETIME
EndTime DATETIME
ApprovedBy FK -> Employee.EmployeeId (e.g. the manager)
ApprovedDate timestamp // date the approval was registered