sqlite - Database: Design customer orders -
i creating android application should use sqlite database. in case, need strore "product type", "bill" , "list of purchased products"
bill:
id customer data -> link list of purchased products price
product types:
id name price
my question is: 1 customer have more products connected 1 bill. how design it? using use 1 row every bills:
id bill_id product
or rather insert more products 1 row , parse in application? suppose, there better solution these mine. thank help.
you said in question, "one customer have more products connected 1 bill."
another way of saying is, 1 customer can have 0 or more bills, , 1 bill can have 1 or more products.
after rephrasing statement, database normalization becomes more obvious.
customer -------- customer id customer name ... bill ---- bill id customer id bill time stamp bill-product ------------ bill id product id product ------- product id product name product price ...
Comments
Post a Comment