Modelling a database for Employees Salary managementHow to design relationships for variant data?Completion...

Why isn't there any EEPROM in STM32F4 MCUs?

How do I handle a blinded enemy which wants to attack someone it's sure is there?

What are Holorydmachines?

Why Third 'Reich'? Why is 'reich' not translated when 'third' is? What is the English synonym of reich?

Does an increasing sequence of reals converge if the difference of consecutive terms approaches zero?

Is it ethical to apply for a job on someone's behalf?

Why is opening a file faster than reading variable content?

Define function that behaves almost identically to Mathematica function

MySQL: Is it a security risk to deactivate the setting "bind-address"?

Are there rules for falling in water vs. diving vs. just jumping in for various depths of water?

Why does RAM (any type) access time decrease so slowly?

Apparently I’m calling random numbers but there's nothing in the call log

Ramanujan's radical and how we define an infinite nested radical

Badly designed reimbursement form. What does that say about the company?

Run a command that requires sudo after a time has passed

The Late Queen Gives in to Remorse - Reverse Hangman

Why didn't Lorentz conclude that no object can go faster than light?

Father gets chickenpox, but doesn't infect his two children. How is this possible?

Should you blow through the final approach course if the ATC forgot about you?

Why did some CPUs use two Read/Write lines, and others just one?

Is candidate anonymity at all practical?

How to know if I am a 'Real Developer'

Under which circumstances can »werden« stand at the end of a sentence?

How does Artisan's Blessing handle rusted and mistreated weapons?



Modelling a database for Employees Salary management


How to design relationships for variant data?Completion of ERD, uncertainties about generalization/specialization and primary keysQuestion about choosing primary keyDB design for employee working hours constraintsIn a one-to-one relationship, where should the foreign key be placed?Is it possible for a weak entity, already related to a strong entity, to get related to another weak entity in an ER diagram?Design questionBridge table questionER Diagram with ERWin 3.5Designing MySQL Database For Two Different User Types (Staff and Client)?













0















I have two types of Employees within my database. One which are salaried (permanent staff) and those who are paid at an hourly rate (hour based staff). Both can be assigned two different roles at the restaurant so I'm quite confused on how to set out the table to work that out.



My current idea was the following:



TeamMember



Tmember_No
Employee_ID
Booking_ID
Hours


Supervisor



SupervisorID
Employee_ID
Booking_ID
Hours


However, I'm not sure how I will be able to get the payrate from the temporary staff table unless I use the primary keys from both permanent and temporary staff as foreign keys in the team Member or Supervisor table. I'll also supply the tables from that side of the database to make things clearer too.



tempStaffPay



TempRoleID (PK)
StaffID (FK)
HoursAssigned
Role (as there's two types of roles a temporary staff member may have)
PayRate


PermanentStaffSalary



PermanentID (PK)
StaffID (Fk)
Salary


EmployeeRole



EmployeeType (PK)
EmployeeID*
TempRoleID*
PermanentID*


Employee



EmployeeID (PK)
First Name
Last Name
NI number
Employee Type *
Phone
Address
Email









share|improve this question









New contributor




Julius Velvet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I have two types of Employees within my database. One which are salaried (permanent staff) and those who are paid at an hourly rate (hour based staff). Both can be assigned two different roles at the restaurant so I'm quite confused on how to set out the table to work that out.



    My current idea was the following:



    TeamMember



    Tmember_No
    Employee_ID
    Booking_ID
    Hours


    Supervisor



    SupervisorID
    Employee_ID
    Booking_ID
    Hours


    However, I'm not sure how I will be able to get the payrate from the temporary staff table unless I use the primary keys from both permanent and temporary staff as foreign keys in the team Member or Supervisor table. I'll also supply the tables from that side of the database to make things clearer too.



    tempStaffPay



    TempRoleID (PK)
    StaffID (FK)
    HoursAssigned
    Role (as there's two types of roles a temporary staff member may have)
    PayRate


    PermanentStaffSalary



    PermanentID (PK)
    StaffID (Fk)
    Salary


    EmployeeRole



    EmployeeType (PK)
    EmployeeID*
    TempRoleID*
    PermanentID*


    Employee



    EmployeeID (PK)
    First Name
    Last Name
    NI number
    Employee Type *
    Phone
    Address
    Email









    share|improve this question









    New contributor




    Julius Velvet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have two types of Employees within my database. One which are salaried (permanent staff) and those who are paid at an hourly rate (hour based staff). Both can be assigned two different roles at the restaurant so I'm quite confused on how to set out the table to work that out.



      My current idea was the following:



      TeamMember



      Tmember_No
      Employee_ID
      Booking_ID
      Hours


      Supervisor



      SupervisorID
      Employee_ID
      Booking_ID
      Hours


      However, I'm not sure how I will be able to get the payrate from the temporary staff table unless I use the primary keys from both permanent and temporary staff as foreign keys in the team Member or Supervisor table. I'll also supply the tables from that side of the database to make things clearer too.



      tempStaffPay



      TempRoleID (PK)
      StaffID (FK)
      HoursAssigned
      Role (as there's two types of roles a temporary staff member may have)
      PayRate


      PermanentStaffSalary



      PermanentID (PK)
      StaffID (Fk)
      Salary


      EmployeeRole



      EmployeeType (PK)
      EmployeeID*
      TempRoleID*
      PermanentID*


      Employee



      EmployeeID (PK)
      First Name
      Last Name
      NI number
      Employee Type *
      Phone
      Address
      Email









      share|improve this question









      New contributor




      Julius Velvet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have two types of Employees within my database. One which are salaried (permanent staff) and those who are paid at an hourly rate (hour based staff). Both can be assigned two different roles at the restaurant so I'm quite confused on how to set out the table to work that out.



      My current idea was the following:



      TeamMember



      Tmember_No
      Employee_ID
      Booking_ID
      Hours


      Supervisor



      SupervisorID
      Employee_ID
      Booking_ID
      Hours


      However, I'm not sure how I will be able to get the payrate from the temporary staff table unless I use the primary keys from both permanent and temporary staff as foreign keys in the team Member or Supervisor table. I'll also supply the tables from that side of the database to make things clearer too.



      tempStaffPay



      TempRoleID (PK)
      StaffID (FK)
      HoursAssigned
      Role (as there's two types of roles a temporary staff member may have)
      PayRate


      PermanentStaffSalary



      PermanentID (PK)
      StaffID (Fk)
      Salary


      EmployeeRole



      EmployeeType (PK)
      EmployeeID*
      TempRoleID*
      PermanentID*


      Employee



      EmployeeID (PK)
      First Name
      Last Name
      NI number
      Employee Type *
      Phone
      Address
      Email






      database-design






      share|improve this question









      New contributor




      Julius Velvet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Julius Velvet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 6 mins ago









      MDCCL

      6,76731745




      6,76731745






      New contributor




      Julius Velvet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 11 mins ago









      Julius VelvetJulius Velvet

      11




      11




      New contributor




      Julius Velvet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Julius Velvet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Julius Velvet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Julius Velvet is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230294%2fmodelling-a-database-for-employees-salary-management%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Julius Velvet is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Julius Velvet is a new contributor. Be nice, and check out our Code of Conduct.













          Julius Velvet is a new contributor. Be nice, and check out our Code of Conduct.












          Julius Velvet is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230294%2fmodelling-a-database-for-employees-salary-management%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          ORA-01691 (unable to extend lob segment) even though my tablespace has AUTOEXTEND onORA-01692: unable to...

          Always On Availability groups resolving state after failover - Remote harden of transaction...

          Circunscripción electoral de Guipúzcoa Referencias Menú de navegaciónLas claves del sistema electoral en...