?
Solved

DB Design Search data

Posted on 2009-06-28
5
Medium Priority
?
186 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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 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…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

801 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