Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2012
    Posts
    2

    Database for employee timekeeping

    Hello everyone,

    I'm somewhat of a novice when it comes to database design and so partly as an intellectual exercise and partly in the hopes it will in the future be beneficial to my department, I'm attempting to create a database using PostgreSQL to record clock-in, lunch duration and clock-out times for employees.The database will also keep track of the number of hours worked against the expected weekly hours, as well as keeping track of the number of holidays (vacation days) taken.

    While I feel I've identified classes and attributes I am unsure as to how to proceed with the storing of the times employees enter into the database - should this all be stored in one table for all employees or should each employee have their own table? Having all employees write to one table is uncomfortable from a security point of view (I don't want then to be able to modify each other's clock-in/clock-out times) but giving each employee their own table might result in a database with too may tables. Should I go even further and give each employee their own database?

    Any guidance is greatly appreciated

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Quote Originally Posted by kernelpanic View Post
    I'm attempting to create a database using PostgreSQL to record clock-in, lunch duration and clock-out times for employees.
    You're not exactly aiming to win a Mr. Popularity contest, are you?

    Do not use separate tables for each employee. A horrible idea (though you're not the first to think of it, and you wouldn't be the first to try it), it will lead to an administrative nightmare.

    The employees shouldn't be writing to any table. They should be calling code that writes to the table based upon their logon and password, and that's how security is implemented.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Sep 2012
    Posts
    2
    Quote Originally Posted by blindman View Post
    You're not exactly aiming to win a Mr. Popularity contest, are you?
    No, but if it makes it any better I'll be subject to the same system

    One table it is then, thankyou for helping me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •