Saving Matrix Data
-
Imagine a matrix,
S M L XL color1 10 20 30 0 color2 4 5 45 50 color3 1 0 4 5
You a sample matrix what i work on. columns are quantity of sizes (some of them may equals to 0 ) . Rows are colors. rows count and columns count are variable. How to save them to data base. rows are in a table, size are saved on other table. But i couldnt solve how to save values on table. what do you offer to me ? -
Imagine a matrix,
S M L XL color1 10 20 30 0 color2 4 5 45 50 color3 1 0 4 5
You a sample matrix what i work on. columns are quantity of sizes (some of them may equals to 0 ) . Rows are colors. rows count and columns count are variable. How to save them to data base. rows are in a table, size are saved on other table. But i couldnt solve how to save values on table. what do you offer to me ?A table containing three columns (to which you must add a primary key - unless size and colour are the primary key)
Size Colour Quantity
S 1 10
S 2 4
S 3 1
M 1 20
M 2 5
M 3 0
....Your matrix is a pivoted varient of what I have shown above. Does this help?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog