Good day guys!,
I have a table named cake_catalog and it has some data as follows-
5 columns cakeCatalogId,prod_code,size,flavor,price respectively:

81 100050 JUMBO BUTTERMOIST 2530.00
82 100050 JUMBO CHOCOMOIST 2530.00
83 100050 JUMBO MOCCA 2230.00
84 100050 JUMBO VANILLA 2230.00
85 100050 REGULAR BUTTERMOIST 1970.00
86 100050 REGULAR CHOCOMOIST 1970.00
87 100050 REGULAR MOCCA 1820.00
88 100050 REGULAR VANILLA 1820.00

I made cakeCatalogId,size,flavor,and price primary key because combinations of size and flavor has different price.

and i have a form that maintains these data,I can add lets say a new flavor of a certain product for the JUMBO size,edit a current price, or delete a size.

My question is how can i present/maintain these data effectively?
My plan(and its an ugly one) is to just show all the size,flavor, and price of the user's selected product one by one an just have a button if he wants to edit each.so in this certain product, It will show:
JUMBO BUTTERMOIST 2530.00 [edit]
UMBO CHOCOMOIST 2530.00 [edit]
JUMBO MOCCA 2230.00 [edit]
JUMBO VANILLA 2230.00 [edit]
REGULAR BUTTERMOIST 1970.00 [edit]
REGULAR CHOCOMOIST 1970.00 [edit]
REGULAR MOCCA 1820.00 [edit]
REGULAR VANILLA 1820.00 [edit]

Thats not good to look at I know because of the repetitions
So how can I do this right?

I will try any help you guys can give me

thanks in advance!

P.S.: I will proceed with my first "ugly" plan if I cant get another solution to this.

I would create a "master size" and "master flavor" table. Then you could create an item, item size, and item flavor table and specify which combinations of item#/flavor/size are allowed and this would also give you the ability to add an up-charge based on either flavor or size. In the item flavor table you could add an upcharge of $5 for chocolate, regardless of size for example. In the item table you would have a base price then join the other item tables and sum up all of the upcharges for a final price.

This really depends on how the inventory is structured and how they price inventory.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.