title: Payroll Tax Database Schema (United States)
body: <p>So here is the basic question:</p>
  
  <p>US Federal Income Taxes can change yearly, or even in mid year. They're based on Tax Tables, whether or not you're single or married, how often you get paid and how many allowances you claim. Here is an example Tax table for someone who is Single and gets paid Bi-Weekly (for 2013):</p>
  
  <pre><code>Gross income between $42 and $214  - $0.00 plus 10% of excess over $85
  Gross income between $214 and $739  - $17.20 plus 15% of excess over $214
  Gross income between $1479 and $3463  - $191.95 plus 25% of excess over $1479
  Gross income between $3463 and $7133  - $687.95 plus 28% of excess over $3463
  Gross income between $7133 and $15406  - $1715.55 plus 33% of excess over $7133
  Gross income between $15406 and $15469  - $4445.64 plus 35% of excess over $15406
  Gross income between $15469+             - $4467.69 plus 39.6% of excess over $15469
  </code></pre>
  
  <p>So the different pay schedules are Weekly, BiWeekly, Semimonthly, Monthly, Quarterly, Semiannually, Annual and Daily. There are two tax tables per schedule (Married and Single) with different figures in each.</p>
  
  <p>So, to calculate a payroll you have to pull in an employees Deductions (health insurance, etc) Pay type, Pay schedule, garnishments (if any) then take the range of their gross pay and figure out where in these tax tables that figure falls then calculate taxes.</p>
  
  <p>What is the best way to setup the DB so I can edit any or all of these figures as needed  - but at the same time not make my SQL queries 100 lines long when trying to calculate a payroll for a group of employees? (If possible)</p>
  
  <p>Create a table for each Pay Schedule? Two tables (married and single) for each Pay Schedule? At this point I think that is the way to go, but I just want to make sure I'm not over complicating. Any or all advice welcome. Thanks in advance.</p>