A
A
Ayom Khabibov2021-04-05 13:42:24
Database design
Ayom Khabibov, 2021-04-05 13:42:24

How to create clothing size charts?

help plz. can't figure out the logic for the size chart. I have a brand in the brand has (women's, men's and children's) now they have two types of trousers jeans and trousers. how do i write down their dimensions

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis, 2021-04-05
@Aiyom

Google on the topic Entity-attribute-value (EAV) Model
https://community.intersystems.com/post/entity-att...
Or you can make a flat table like
id|name|qty|price
1|Jeans Brand for men 50r |3|1000
2|Jeans Brand for men 32r|3|1000
2|Jeans Brand for women 25r|3|1000

S
Slava Rozhnev, 2021-04-05
@rozhnev

In this case, I see 3 tables:

create table brands (
  id int auto_increment primary key,
  	name varchar(64)
);

create table products (
  code varchar(8) primary key,
  	brand_id int,
  	name varchar(64)
);

create table product_sizes (
  product_code varchar(8),
  	size varchar(64),
  	quantity int,
  	price decimal(7,2)
);

Example here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question