I’m new to database design,
please give me advice about this.
1 When should I use a composite index?
im not sure what does index does, but
i do know we should put it when it
will be heavly loaded like for WHERE
verified = 1 and in search like
company.name = something. am i right ?
2 MySQL indexes – how many are enough?
is it just enough ?
is it just right?
Thanks.
edit*
rules.
- each users( company member or owners ) could be a member of a
company- each company have some member of users.
- there are company admins ( ceo, admins) and there are company members
( inserts the products )- each company can have products.
for the number 3 i will add a bit at users_company
– 1 is for admin
– 0 is for members

Looks good, well normalised, to me at least.
I notice that each product can only belong to one company. If that’s what you intended that’s fine, otherwise you could have product have its own PID and have a product_company relation table, which would let more than one company sell a particular product. Depends who administers the products I guess.
I did notice that the user table is called ‘users’ (plural) and the others are singular (‘company’, ‘product’). That’s only a minor thing though.