Solved

DB Design Search data

Posted on 2009-06-28
5
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

749 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