DB Design Search data

I have vb.net customer database. there is some client sell many brand like HP,IBM,NEC and etc.
shoud i store all those brand into 1 column like HP,IBM,NEC
use diffrence column for 1 brand.

i need to search let say HP. so all those client who sell HP will show up from the dataset.
Who is Participating?
Jorge PaulinoConnect With a Mentor IT Pro/DeveloperCommented:
Three tables ....
Customers (CustomerId, customersName, etc)
Brands (BrandId and BrandName)
CustomerBrands (customerID  and BrandId)
In the Brands table you will have all the brands available and in the CustomerBrands you have a list of all customers and the brands they have. Then you can use a INNER JOIN view to show all

SELECT Customers.name, Brands.BrandName, Customers.customerID
       CustomerBrands ON Customers.customerID = CustomerBrands.customerID INNER JOIN
       Brands ON CustomerBrands.BrandId = Brands.BrandID

Open in new window

Aneesh RetnakaranDatabase AdministratorCommented:
You can store the brandIs in a different table and store their curresponding ids in the Client table

Table  Brands (BrandID int identity, BrandName varchar(120)  )
Table  ClientInfo (ClientId int, BrandID int )
aaronthamAuthor Commented:
If let say i have a client sell few brand then how to store?
Jorge PaulinoIT Pro/DeveloperCommented:
You should create a new table with the customer ID and the brand. Then you make a inner join to get all the brands for each customer.
aaronthamAuthor Commented:
Hi jpaulino,

can i have saome sample how this sample look like.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.