Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

solution for single attribute in table

I am designing database architecture. I have user. User make request for order. Order is associated with payment. Once payment is completed, I want to generate sticker for that user.
Sticker has initial prize(i.e. $10). Now, admin can edit sticker prize. so, if admin change sticker prize then order will generate with new prize after change by admin.

By database architecture is as follow :

User(id, name, email, password)
Order(id, user_id, no_of_sticker,sticker_prize, address, status)
Payment(id, order_id, amount, date)
sticker(id, order_id, name, content)
sticker_info(sticker_prize)

Now, my question is--- is it good to create new table for just one single attribute. That sticker_prize is only available for admin to edit

Please give your valuable suggestion.
Thanks in adv.

like image 682
Ketan Ghumatkar Avatar asked Nov 02 '22 23:11

Ketan Ghumatkar


1 Answers

Creating the sticker_info table, for the purpose of storing a single value is ok from a database design perspective. You should ensure you have a primary key on the table so you can not get duplicate rows.

In larger systems, there are often lots of values like this, and often the solution is a table like: configuration( configId, configValue ).

like image 70
WW. Avatar answered Nov 09 '22 16:11

WW.