Hi,
You can maintain 2 tables in your database namely,
TblProduct and
TblClient.
for ex:
create table TblProduct(
ProductID int primary key not null,
ProductName varchar(50) not null,
ProductDetails varchar(100) not null)
and
create table TblClient(
ClientId int primary key not null,
ClientName varchar(50) not null,
ClientDetails varchar(100) not null,
ProductID1 int not null)
Later you can use a query to retrieve what all details you need and display it as your end result.
select * from TblProduct
will yield:
ProductID ProductName ProductDetails
1 BMW vehicles
2 Lenovo PC
3 HP PC
4 Kingston Peripherals
select * from TblClient
will yield:
ClientId ClientName ClientDetails ProductID1
100 YY BeachSide 1
101 XX RiverSide 2
102 ZZ CountrySide 5
103 AA No Details 4
105 BB TownHall 6
Then you might use a query like:
select TblClient.* from TblClient join TblProduct on TblProduct.ProductID=TblClient.ProductID1
The answer based upon the above entries will yield:
ClientId ClientName ClientDetails ProductID1
100 YY BeachSide 1
101 XX RiverSide 2
103 AA No Details 4
It gives the details of the clients who have purchased the product which is present in the product list.You can store it in a separate table if you want.
Hope it helps