Skip to content
Advertisement

How to get details for a customer that is both a seller and a buyer

I have a database which contains customers that are both buyers and sellers. the customers can buy and sell houses.

I need to get details for the customers separately and still have a connection between them so i could know which customer sold to which customer.

In case a customer buys a house from a different customer how can i get the details for each customer separately?

The table I made so far for the customers is :

I have a sale table

I have a table that contains both sale and customers

Advertisement

Answer

Your entities are confused. A customer should be a person, with information about the persion. Then Sales should refer to it twice, once for buyers and o once for sellers:

In other words, “buyer” and “seller” are attributes of a sale, not of a person.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement