Solved

DB Design Search data

Posted on 2009-06-28
5
162 Views
Last Modified: 2013-12-25
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
or
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.
0
Comment
Question by:aarontham
  • 2
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24733612
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 )
0
 

Author Comment

by:aarontham
ID: 24733757
If let say i have a client sell few brand then how to store?
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 24734022
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.
0
 

Author Comment

by:aarontham
ID: 24734466
Hi jpaulino,

can i have saome sample how this sample look like.
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 24734518
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

FROM   Customers INNER JOIN

       CustomerBrands ON Customers.customerID = CustomerBrands.customerID INNER JOIN

       Brands ON CustomerBrands.BrandId = Brands.BrandID

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now