Suggestion... Use separate tables for size and colors. This way you can set sized / color based individual pricing. Most of the time some particular size or color are in huge demand which stales the stock of other sizes if all are available in same price. For example, red may get sold out quicker but green may receive less sale. Result? Stale stocks for green tees. Solution? Make red costlier than green. Either you get more margin if red still sells or people opt for green. Same goes for sizes. Having same price might not be that of a flexible solution.
If we see this table Product_variants Id Product_id Color (optional) Size (optional) Price (float - 10,2) Stock_quantity (integer) First of all i think its not in 2NF since color and size is dependent on product_id and not id which is primary key and stock quantity is dependant on size and color which results in transitive dependency. Ideally we can have another table for stock and product_id can be foreign key as well as primary key Also if you need to insert size and color every time it will lead to insertion anomaly . But question may come too many tables will result in too many joins and slow performance. So in this case we need to index.
@@softboxmelody product table me , I'd , size I'd , attributes table, I'd size , jo fields chahiye le lo aap aur join query mar Dena aap jab value lena hoga to
Suggestion... Use separate tables for size and colors. This way you can set sized / color based individual pricing. Most of the time some particular size or color are in huge demand which stales the stock of other sizes if all are available in same price. For example, red may get sold out quicker but green may receive less sale. Result? Stale stocks for green tees. Solution? Make red costlier than green. Either you get more margin if red still sells or people opt for green. Same goes for sizes. Having same price might not be that of a flexible solution.
Sir please make end to end E-commerce in React JS🔥💪
If we see this table
Product_variants
Id
Product_id
Color (optional)
Size (optional)
Price (float - 10,2)
Stock_quantity (integer)
First of all i think its not in 2NF since color and size is dependent on product_id and not id which is primary key and stock quantity is dependant on size and color which results in transitive dependency.
Ideally we can have another table for stock and product_id can be foreign key as well as primary key
Also if you need to insert size and color every time it will lead to insertion anomaly . But question may come too many tables will result in too many joins and slow performance. So in this case we need to index.
how it can be more normalized?
Actually, you don't add a product image column in products table i think where will be store the path of image ?
Thank you sir ❤❤
database for any rental website?
Hello, Carts me product id and product varient id kyon.???
Carts can have multiple items.
how to handle this?
sir make a project where we can learn seo, large user database scaling, best practices tips etc
For e commerce app, no SQL is better? Isn't it?
Complete tutorial for e-commerce website development
Assalam walekum sar meri ek request hai aapse kya aap transport management system per complete database section video bnao with detail
please make also ola/uber db design video it will be helpful
Source code ha kaya bhai😊
apne rating reviews ka nhi attribute nhi add kiya
iska ER diagram mil sakta hai kya Sir please?
👍 thanks
Thank you
31:38 par aapne mentation Kiya 😅hai sir ye second but good video
❤❤❤
Source code
Cart me quantity kaha gaya sir ji 24.03
Yes, I used to forgot mentioning the required doc link in the description. By your comment I realized, so added it now.
Hello bro
Need help for db design for products and attributes
@@softboxmelody product table me , I'd , size I'd , attributes table, I'd size , jo fields chahiye le lo aap aur join query mar Dena aap jab value lena hoga to