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:

here's crow's foot diagram made:

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:
- your crow's foot on wrong site entities. employee can have several invoices, assume invoice "owned" 1 employee.
- why
employeehaveinvoiceid? can have more 1 invoice? - consider adding
address-table , give customershippingaddress,billingaddress(optional), both referencingaddress. - what difference between
quantity,amountintblproductline? - where price shipping , handling from?
- 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 , movesize,colorsub-table. if need rename product, change 1 record instead of many.
Comments
Post a Comment