Solved

DB Design Search data

Posted on 2009-06-28
5
158 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
Comment Utility
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
Comment Utility
If let say i have a client sell few brand then how to store?
0
 
LVL 48

Expert Comment

by:jpaulino
Comment Utility
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
Comment Utility
Hi jpaulino,

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

Accepted Solution

by:
jpaulino earned 500 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

772 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

14 Experts available now in Live!

Get 1:1 Help Now