sql server - Would you mind sorting through a few Beginner SQL invoice database creation questions? -


i'm new sql.

i need make invoice can queried create document looks this:

screenshot

here's crow's foot diagram made:

crow's foot diagram

i'm not sure if customer shipping , billing address should separate entity. i'm not sure tblproductline relationship tblitem , tblinvoice. did diagram right?

did match schema , setup relationships correctly? also, explain when foreign keys necessary ? (since wasn't sure put them) i'm assuming go @ end of 1 many relationships reference previous table called it, i'm not sure... tables need foreign key?

anyways... or comments great!

some thoughts in random order:

  1. your crow's foot on wrong site entities. employee can have several invoices, assume invoice "owned" 1 employee.
  2. why employee have invoiceid? can have more 1 invoice?
  3. consider adding address-table , give customer shippingaddress , billingaddress (optional), both referencing address.
  4. what difference between quantity , amount in tblproductline?
  5. where price shipping , handling from?
  6. you're storing size in field, not color. color part of itemdescription, can't find out red , blue jag something same product
    depending on requirements, might better normalize table , move size , color sub-table. if need rename product, change 1 record instead of many.

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -