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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -