Some unclear questions about db construction

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
bagi
Forum Newbie
Posts: 24
Joined: Thu Oct 31, 2013 10:50 am

Some unclear questions about db construction

Post by bagi »

1) i have feedbacks on the site. Should I dublicate information: i have itemId column (item id on which is written a feedback). Using it I can find out a seller. Should i create each one column for a seller or i need to find out it every time using itemId?

2) I have soldItems table. Inside contains information about purchases. A seller and for a buyer has some operations (deleting, archiving of a purchase, ect). How i can organise that? Should i dublicate records for a seller and for a buyer (and mark every time a record as archived, deleted ect) or i should choice an another way? For example, two columns for buyer's status and seller's status
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Some unclear questions about db construction

Post by Celauran »

Don't duplicate information. Use foreign keys and joins.
bagi
Forum Newbie
Posts: 24
Joined: Thu Oct 31, 2013 10:50 am

Re: Some unclear questions about db construction

Post by bagi »

Yes, thanks. What about second question?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Some unclear questions about db construction

Post by Celauran »

Your second question isn't terribly clear. I still maintain that you don't want to duplicate data. Could you please elaborate on the question/problem at hand and maybe provide the table structure for clarity?
bagi
Forum Newbie
Posts: 24
Joined: Thu Oct 31, 2013 10:50 am

Re: Some unclear questions about db construction

Post by bagi »

See, A buyer and a seller will interact with thier purchases, right? I wanna give him some opportunities (moving to archive, to trash and ect). But i need to store those statuses anywhere. How?
1) Create double records for a seller and for a buyer where everyone may interact as he want.
2) Create columns sellerStatus and buyerStatus
Post Reply